removed engine retrieval from client public api

This commit is contained in:
Nikolay Volf 2016-05-16 19:43:48 +03:00
parent 994d056922
commit 7c28b1cef9
4 changed files with 2 additions and 16 deletions

View File

@ -430,10 +430,6 @@ impl<V> BlockChainClient for Client<V> where V: Verifier {
block.try_seal(self.engine.deref().deref(), seal) block.try_seal(self.engine.deref().deref(), seal)
} }
fn engine(&self) -> &Engine {
self.engine.deref().deref()
}
// TODO [todr] Should be moved to miner crate eventually. // TODO [todr] Should be moved to miner crate eventually.
fn prepare_sealing(&self, author: Address, gas_floor_target: U256, extra_data: Bytes, transactions: Vec<SignedTransaction>) fn prepare_sealing(&self, author: Address, gas_floor_target: U256, extra_data: Bytes, transactions: Vec<SignedTransaction>)
-> (Option<ClosedBlock>, HashSet<H256>) { -> (Option<ClosedBlock>, HashSet<H256>) {

View File

@ -134,12 +134,6 @@ pub trait BlockChainClient : Sync + Send {
/// Makes a non-persistent transaction call. /// Makes a non-persistent transaction call.
fn call(&self, t: &SignedTransaction) -> Result<Executed, ExecutionError>; fn call(&self, t: &SignedTransaction) -> Result<Executed, ExecutionError>;
/// Attempt to seal the block internally. See `Engine`.
fn generate_seal(&self, block: &ExecutedBlock, accounts: Option<&AccountProvider>) -> Option<Vec<Bytes>> { self.engine().generate_seal(block, accounts) }
/// Executes a function providing it with a reference to an engine.
fn engine(&self) -> &Engine;
/// Returns traces matching given filter. /// Returns traces matching given filter.
fn filter_traces(&self, filter: TraceFilter) -> Option<Vec<LocalizedTrace>>; fn filter_traces(&self, filter: TraceFilter) -> Option<Vec<LocalizedTrace>>;

View File

@ -430,10 +430,6 @@ impl BlockChainClient for TestBlockChainClient {
} }
} }
fn engine(&self) -> &Engine {
unimplemented!();
}
fn filter_traces(&self, _filter: TraceFilter) -> Option<Vec<LocalizedTrace>> { fn filter_traces(&self, _filter: TraceFilter) -> Option<Vec<LocalizedTrace>> {
unimplemented!(); unimplemented!();
} }

View File

@ -121,7 +121,7 @@ impl Miner {
Some(old_block) => { Some(old_block) => {
trace!(target: "miner", "Already have previous work; updating and returning"); trace!(target: "miner", "Already have previous work; updating and returning");
// add transactions to old_block // add transactions to old_block
let e = chain.engine(); let e = self.engine();
let mut invalid_transactions = HashSet::new(); let mut invalid_transactions = HashSet::new();
let mut block = old_block.reopen(e); let mut block = old_block.reopen(e);
let block_number = block.block().fields().header.number(); let block_number = block.block().fields().header.number();
@ -277,7 +277,7 @@ impl MinerService for Miner {
state.sub_balance(&sender, &balance); state.sub_balance(&sender, &balance);
state.add_balance(&sender, &U256::max_value()); state.add_balance(&sender, &U256::max_value());
let options = TransactOptions { tracing: false, check_nonce: false }; let options = TransactOptions { tracing: false, check_nonce: false };
Executive::new(&mut state, &env_info, chain.engine()).transact(t, options) Executive::new(&mut state, &env_info, self.engine()).transact(t, options)
}, },
None => { None => {
chain.call(t) chain.call(t)