From 580913fa7dbe1291be493451b80f7e449e52f17f Mon Sep 17 00:00:00 2001 From: NikVolf Date: Wed, 29 Jun 2016 17:23:29 +0300 Subject: [PATCH] vm factory to mining client --- ethcore/src/client/client.rs | 7 ++++--- ethcore/src/client/mod.rs | 6 +++--- ethcore/src/client/test_client.rs | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 1a437bfac..5d157b654 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -515,9 +515,6 @@ impl BlockChainClient for Client { ret } - fn vm_factory(&self) -> &EvmFactory { - &self.vm_factory - } fn block_header(&self, id: BlockID) -> Option { Self::block_hash(&self.chain, id).and_then(|hash| self.chain.block(&hash).map(|bytes| BlockView::new(&bytes).rlp().at(0).as_raw().to_vec())) @@ -829,6 +826,10 @@ impl MiningBlockChainClient for Client { open_block } + + fn vm_factory(&self) -> &EvmFactory { + &self.vm_factory + } } impl MayPanic for Client { diff --git a/ethcore/src/client/mod.rs b/ethcore/src/client/mod.rs index 2098d8a2f..bef814b4e 100644 --- a/ethcore/src/client/mod.rs +++ b/ethcore/src/client/mod.rs @@ -172,9 +172,6 @@ pub trait BlockChainClient : Sync + Send { // TODO: should be able to accept blockchain location for call. fn call(&self, t: &SignedTransaction, analytics: CallAnalytics) -> Result; - /// Returns EvmFactory. - fn vm_factory(&self) -> &EvmFactory; - /// Returns traces matching given filter. fn filter_traces(&self, filter: TraceFilter) -> Option>; @@ -253,4 +250,7 @@ pub trait MiningBlockChainClient : BlockChainClient { /// Returns OpenBlock prepared for closing. fn prepare_open_block(&self, author: Address, gas_range_target: (U256, U256), extra_data: Bytes) -> OpenBlock; + + /// Returns EvmFactory. + fn vm_factory(&self) -> &EvmFactory; } diff --git a/ethcore/src/client/test_client.rs b/ethcore/src/client/test_client.rs index a7f508a51..ed1f10e09 100644 --- a/ethcore/src/client/test_client.rs +++ b/ethcore/src/client/test_client.rs @@ -244,6 +244,10 @@ impl MiningBlockChainClient for TestBlockChainClient { fn prepare_open_block(&self, _author: Address, _gas_range_target: (U256, U256), _extra_data: Bytes) -> OpenBlock { unimplemented!(); } + + fn vm_factory(&self) -> &EvmFactory { + unimplemented!(); + } } impl BlockChainClient for TestBlockChainClient { @@ -463,10 +467,6 @@ impl BlockChainClient for TestBlockChainClient { } } - fn vm_factory(&self) -> &EvmFactory { - unimplemented!(); - } - fn filter_traces(&self, _filter: TraceFilter) -> Option> { unimplemented!(); }