miner and client take spec reference (#1853)

* miner and client take spec reference

* fix tests
This commit is contained in:
Robert Habermeier
2016-08-05 23:33:55 +02:00
committed by Gav Wood
parent 2f52425387
commit e72fc5398a
15 changed files with 67 additions and 69 deletions

View File

@@ -22,7 +22,6 @@ use tests::helpers::*;
use devtools::*;
use spec::Genesis;
use ethjson;
use ethjson::blockchain::BlockChain;
use miner::Miner;
use io::IoChannel;
@@ -43,7 +42,7 @@ pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
flush!(" - {}...", name);
let spec = |blockchain: &BlockChain| {
let spec = {
let genesis = Genesis::from(blockchain.genesis());
let state = From::from(blockchain.pre_state.clone());
let mut spec = match era {
@@ -61,9 +60,9 @@ pub fn json_chain_test(json_data: &[u8], era: ChainEra) -> Vec<String> {
{
let client = Client::new(
ClientConfig::default(),
&spec(&blockchain),
&spec,
temp.as_path(),
Arc::new(Miner::with_spec(spec(&blockchain))),
Arc::new(Miner::with_spec(&spec)),
IoChannel::disconnected()
).unwrap();
for b in &blockchain.blocks_rlp() {