removed EthEngine alias (#10805)

This commit is contained in:
Marek Kotewicz
2019-06-28 16:18:18 +08:00
committed by Andronik Ordian
parent cff1bc88fa
commit 7f02a08741
28 changed files with 112 additions and 121 deletions

View File

@@ -18,7 +18,7 @@
use std::sync::Arc;
use engines::{EthEngine, EpochVerifier};
use engines::{Engine, EpochVerifier};
use blockchain::BlockChain;
use parking_lot::RwLock;
@@ -32,12 +32,12 @@ const HEAVY_VERIFY_RATE: f32 = 0.02;
/// epoch.
pub struct AncientVerifier {
cur_verifier: RwLock<Option<Box<dyn EpochVerifier>>>,
engine: Arc<dyn EthEngine>,
engine: Arc<dyn Engine>,
}
impl AncientVerifier {
/// Create a new ancient block verifier with the given engine.
pub fn new(engine: Arc<dyn EthEngine>) -> Self {
pub fn new(engine: Arc<dyn Engine>) -> Self {
AncientVerifier {
cur_verifier: RwLock::new(None),
engine,

View File

@@ -60,7 +60,7 @@ use client::{
IoClient, BadBlocks,
};
use client::bad_blocks;
use engines::{MAX_UNCLE_AGE, EthEngine, EpochTransition, ForkChoice, EngineError, SealingState};
use engines::{MAX_UNCLE_AGE, Engine, EpochTransition, ForkChoice, EngineError, SealingState};
use engines::epoch::PendingTransition;
use error::{
ImportError, ExecutionError, CallError, BlockError,
@@ -165,7 +165,7 @@ struct Importer {
pub ancient_verifier: AncientVerifier,
/// Ethereum engine to be used during import
pub engine: Arc<dyn EthEngine>,
pub engine: Arc<dyn Engine>,
/// A lru cache of recently detected bad blocks
pub bad_blocks: bad_blocks::BadBlocks,
@@ -187,7 +187,7 @@ pub struct Client {
chain: RwLock<Arc<BlockChain>>,
tracedb: RwLock<TraceDB<BlockChain>>,
engine: Arc<dyn EthEngine>,
engine: Arc<dyn Engine>,
/// Client configuration
config: ClientConfig,
@@ -245,7 +245,7 @@ pub struct Client {
impl Importer {
pub fn new(
config: &ClientConfig,
engine: Arc<dyn EthEngine>,
engine: Arc<dyn Engine>,
message_channel: IoChannel<ClientIoMessage>,
miner: Arc<Miner>,
) -> Result<Importer, ::error::Error> {
@@ -857,7 +857,7 @@ impl Client {
}
/// Returns engine reference.
pub fn engine(&self) -> &dyn EthEngine {
pub fn engine(&self) -> &dyn Engine {
&*self.engine
}
@@ -1661,7 +1661,7 @@ impl Call for Client {
}
impl EngineInfo for Client {
fn engine(&self) -> &dyn EthEngine {
fn engine(&self) -> &dyn Engine {
Client::engine(self)
}
}

View File

@@ -59,7 +59,7 @@ use client::{
Call, StateClient, EngineInfo, AccountData, BlockChain, BlockProducer, SealedBlockImporter, IoClient,
BadBlocks
};
use engines::EthEngine;
use engines::Engine;
use error::{Error, EthcoreResult};
use executed::CallError;
use executive::Executed;
@@ -627,7 +627,7 @@ impl StateClient for TestBlockChainClient {
}
impl EngineInfo for TestBlockChainClient {
fn engine(&self) -> &dyn EthEngine {
fn engine(&self) -> &dyn Engine {
unimplemented!()
}
}

View File

@@ -43,7 +43,7 @@ use vm::LastHashes;
use block::{OpenBlock, SealedBlock, ClosedBlock};
use client::Mode;
use engines::EthEngine;
use engines::Engine;
use error::{Error, EthcoreResult};
use executed::CallError;
use executive::Executed;
@@ -184,7 +184,7 @@ pub trait Call {
/// Provides `engine` method
pub trait EngineInfo {
/// Get underlying engine object
fn engine(&self) -> &dyn EthEngine;
fn engine(&self) -> &dyn Engine;
}
/// IO operations that should off-load heavy work to another thread.