rpc eth_getFilterChanges returns new blocks, implemented eth_uninstallFilter

This commit is contained in:
debris
2016-02-24 14:16:05 +01:00
parent 932b31227f
commit 0318907fb3
3 changed files with 30 additions and 3 deletions

View File

@@ -114,6 +114,9 @@ pub trait BlockChainClient : Sync + Send {
/// Get block total difficulty.
fn block_total_difficulty(&self, id: BlockId) -> Option<U256>;
/// Get block hash.
fn block_hash(&self, id: BlockId) -> Option<H256>;
/// Get address code.
fn code(&self, address: &Address) -> Option<Bytes>;
@@ -416,6 +419,11 @@ impl BlockChainClient for Client {
Self::block_hash(&chain, id).and_then(|hash| chain.block_details(&hash)).map(|d| d.total_difficulty)
}
fn block_hash(&self, id: BlockId) -> Option<H256> {
let chain = self.chain.read().unwrap();
Self::block_hash(&chain, id)
}
fn code(&self, address: &Address) -> Option<Bytes> {
self.state().code(address)
}