jsonrpc uses client and sync interfaces as a preparetion for jsonrpc tests

This commit is contained in:
debris
2016-03-09 17:31:43 +01:00
parent 798c348d0e
commit 082a4d9078
6 changed files with 81 additions and 58 deletions

View File

@@ -25,6 +25,7 @@ use ethcore::receipt::Receipt;
use ethcore::transaction::LocalizedTransaction;
use ethcore::filter::Filter;
use ethcore::log_entry::LocalizedLogEntry;
use ethcore::block::ClosedBlock;
pub struct TestBlockChainClient {
pub blocks: RwLock<HashMap<H256, Bytes>>,
@@ -125,6 +126,14 @@ impl BlockChainClient for TestBlockChainClient {
unimplemented!();
}
fn sealing_block(&self) -> &Mutex<Option<ClosedBlock>> {
unimplemented!();
}
fn submit_seal(&self, _pow_hash: H256, _seal: Vec<Bytes>) -> Result<(), Error> {
unimplemented!();
}
fn block_header(&self, id: BlockId) -> Option<Bytes> {
self.block_hash(id).and_then(|hash| self.blocks.read().unwrap().get(&hash).map(|r| Rlp::new(r).at(0).as_raw().to_vec()))
}