New mining framework.

Fixes #756.
This commit is contained in:
Gav Wood
2016-03-24 23:03:22 +01:00
parent 3be2763929
commit 830ef7ddfc
10 changed files with 105 additions and 148 deletions

View File

@@ -31,6 +31,7 @@ use block_queue::BlockQueueInfo;
use block::{SealedBlock, ClosedBlock};
use executive::Executed;
use error::Error;
use engine::Engine;
/// Test client.
pub struct TestBlockChainClient {
@@ -249,7 +250,7 @@ impl BlockChainClient for TestBlockChainClient {
}
fn prepare_sealing(&self, _author: Address, _gas_floor_target: U256, _extra_data: Bytes, _transactions: Vec<SignedTransaction>) -> (Option<ClosedBlock>, HashSet<H256>) {
(None, vec![])
(None, HashSet::new())
}
fn try_seal(&self, block: ClosedBlock, _seal: Vec<Bytes>) -> Result<SealedBlock, ClosedBlock> {
@@ -404,4 +405,8 @@ impl BlockChainClient for TestBlockChainClient {
best_block_number: self.blocks.read().unwrap().len() as BlockNumber - 1,
}
}
fn engine(&self) -> &Engine {
unimplemented!();
}
}