fixed ethsync tests

This commit is contained in:
debris 2016-02-09 18:34:06 +01:00
parent 75ccb22d26
commit 27acdf38e2

View File

@ -22,6 +22,7 @@ use ethcore::error::*;
use io::SyncIo; use io::SyncIo;
use chain::{ChainSync}; use chain::{ChainSync};
use ethcore::receipt::Receipt; use ethcore::receipt::Receipt;
use ethcore::transaction::LocalizedTransaction;
pub struct TestBlockChainClient { pub struct TestBlockChainClient {
pub blocks: RwLock<HashMap<H256, Bytes>>, pub blocks: RwLock<HashMap<H256, Bytes>>,
@ -86,6 +87,10 @@ impl BlockChainClient for TestBlockChainClient {
unimplemented!(); unimplemented!();
} }
fn transaction(&self, hash: &H256) -> Option<LocalizedTransaction> {
unimplemented!();
}
fn block_header(&self, h: &H256) -> Option<Bytes> { 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()) self.blocks.read().unwrap().get(h).map(|r| Rlp::new(r).at(0).as_raw().to_vec())
} }