Merge remote-tracking branch 'origin/master' into check-updates
This commit is contained in:
@@ -1130,6 +1130,10 @@ impl BlockChainClient for Client {
|
||||
self.transaction_address(id).and_then(|address| self.chain.read().transaction(&address))
|
||||
}
|
||||
|
||||
fn transaction_block(&self, id: TransactionId) -> Option<H256> {
|
||||
self.transaction_address(id).map(|addr| addr.block_hash)
|
||||
}
|
||||
|
||||
fn uncle(&self, id: UncleId) -> Option<Bytes> {
|
||||
let index = id.position;
|
||||
self.block_body(id.block).and_then(|body| BodyView::new(&body).uncle_rlp_at(index))
|
||||
|
||||
@@ -432,6 +432,10 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
None // Simple default.
|
||||
}
|
||||
|
||||
fn transaction_block(&self, _id: TransactionId) -> Option<H256> {
|
||||
None // Simple default.
|
||||
}
|
||||
|
||||
fn uncle(&self, _id: UncleId) -> Option<Bytes> {
|
||||
None // Simple default.
|
||||
}
|
||||
|
||||
@@ -129,6 +129,9 @@ pub trait BlockChainClient : Sync + Send {
|
||||
/// Get transaction with given hash.
|
||||
fn transaction(&self, id: TransactionId) -> Option<LocalizedTransaction>;
|
||||
|
||||
/// Get the hash of block that contains the transaction, if any.
|
||||
fn transaction_block(&self, id: TransactionId) -> Option<H256>;
|
||||
|
||||
/// Get uncle with given id.
|
||||
fn uncle(&self, id: UncleId) -> Option<Bytes>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user