Merge pull request #243 from ethcore/rpc

impl missing methods in tests
This commit is contained in:
Gav Wood 2016-01-27 17:01:16 +01:00
commit ec42dd6b28

View File

@ -51,6 +51,10 @@ impl TestBlockChainClient {
}
impl BlockChainClient for TestBlockChainClient {
fn block_total_difficulty(&self, _h: &H256) -> Option<U256> {
unimplemented!();
}
fn block_header(&self, h: &H256) -> Option<Bytes> {
self.blocks.read().unwrap().get(h).map(|r| Rlp::new(r).at(0).as_raw().to_vec())
@ -76,6 +80,10 @@ impl BlockChainClient for TestBlockChainClient {
}
}
fn block_total_difficulty_at(&self, _number: BlockNumber) -> Option<U256> {
unimplemented!();
}
fn block_header_at(&self, n: BlockNumber) -> Option<Bytes> {
self.numbers.read().unwrap().get(&(n as usize)).and_then(|h| self.block_header(h))
}