vm factory to mining client

This commit is contained in:
NikVolf 2016-06-29 17:23:29 +03:00
parent c096c087df
commit 580913fa7d
3 changed files with 11 additions and 10 deletions

View File

@ -515,9 +515,6 @@ impl BlockChainClient for Client {
ret
}
fn vm_factory(&self) -> &EvmFactory {
&self.vm_factory
}
fn block_header(&self, id: BlockID) -> Option<Bytes> {
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 {

View File

@ -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<Executed, ExecutionError>;
/// Returns EvmFactory.
fn vm_factory(&self) -> &EvmFactory;
/// Returns traces matching given filter.
fn filter_traces(&self, filter: TraceFilter) -> Option<Vec<LocalizedTrace>>;
@ -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;
}

View File

@ -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<Vec<LocalizedTrace>> {
unimplemented!();
}