Owning views of blockchain data (#3982)

* owning views of blockchain data

* port blockchain and client traits to owning views

* fix ethcore tests

* use strong headers and bodies in ethcore_light

* port ethsync to use owning views

* port rpc to owning views

* port parity informant and blockchain export
This commit is contained in:
Robert Habermeier
2016-12-28 13:44:51 +01:00
committed by Gav Wood
parent 592a3ac623
commit fe1f542c4f
22 changed files with 493 additions and 212 deletions

View File

@@ -94,7 +94,7 @@ impl<'a> BlockView<'a> {
}
/// Return List of transactions in given block.
pub fn transaction_views(&self) -> Vec<TransactionView> {
pub fn transaction_views(&self) -> Vec<TransactionView<'a>> {
self.rlp.at(1).iter().map(TransactionView::new_from_rlp).collect()
}
@@ -132,7 +132,7 @@ impl<'a> BlockView<'a> {
}
/// Return List of transactions in given block.
pub fn uncle_views(&self) -> Vec<HeaderView> {
pub fn uncle_views(&self) -> Vec<HeaderView<'a>> {
self.rlp.at(2).iter().map(HeaderView::new_from_rlp).collect()
}

View File

@@ -71,7 +71,7 @@ impl<'a> BodyView<'a> {
}
/// Return List of transactions in given block.
pub fn transaction_views(&self) -> Vec<TransactionView> {
pub fn transaction_views(&self) -> Vec<TransactionView<'a>> {
self.rlp.at(0).iter().map(TransactionView::new_from_rlp).collect()
}
@@ -106,7 +106,7 @@ impl<'a> BodyView<'a> {
}
/// Return List of transactions in given block.
pub fn uncle_views(&self) -> Vec<HeaderView> {
pub fn uncle_views(&self) -> Vec<HeaderView<'a>> {
self.rlp.at(1).iter().map(HeaderView::new_from_rlp).collect()
}