Trait EvmFactory

pub trait EvmFactory {
    type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<<DB as Database>::Error>, Spec = Self::Spec>;
    type Context<DB: Database>: ContextTr<Db = DB>
       where <Self::Context<DB> as ContextTr>::Journal: JournalExt;
    type Tx: IntoTxEnv<Self::Tx>;
    type Error<DBError: Error + Send + Sync + 'static>: EvmError;
    type HaltReason: HaltReasonTr + Send + Sync + 'static;
    type Spec: Debug + Copy + Send + Sync + 'static;

    // Required methods
    fn create_evm<DB>(
        &self,
        db: DB,
        evm_env: EvmEnv<Self::Spec>,
    ) -> Self::Evm<DB, NoOpInspector>
       where DB: Database;
    fn create_evm_with_inspector<DB, I>(
        &self,
        db: DB,
        input: EvmEnv<Self::Spec>,
        inspector: I,
    ) -> Self::Evm<DB, I>
       where DB: Database,
             I: Inspector<Self::Context<DB>>;
}
Available on crate feature evm only.
Expand description

A type responsible for creating instances of an ethereum virtual machine given a certain input.

Required Associated Types§

type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm<DB = DB, Tx = Self::Tx, HaltReason = Self::HaltReason, Error = Self::Error<<DB as Database>::Error>, Spec = Self::Spec>

The EVM type that this factory creates.

type Context<DB: Database>: ContextTr<Db = DB> where <Self::Context<DB> as ContextTr>::Journal: JournalExt

The EVM context for inspectors

type Tx: IntoTxEnv<Self::Tx>

Transaction environment.

type Error<DBError: Error + Send + Sync + 'static>: EvmError

EVM error. See Evm::Error.

type HaltReason: HaltReasonTr + Send + Sync + 'static

Halt reason. See Evm::HaltReason.

type Spec: Debug + Copy + Send + Sync + 'static

The EVM specification identifier, see Evm::Spec.

Required Methods§

fn create_evm<DB>( &self, db: DB, evm_env: EvmEnv<Self::Spec>, ) -> Self::Evm<DB, NoOpInspector>
where DB: Database,

Creates a new instance of an EVM.

fn create_evm_with_inspector<DB, I>( &self, db: DB, input: EvmEnv<Self::Spec>, inspector: I, ) -> Self::Evm<DB, I>
where DB: Database, I: Inspector<Self::Context<DB>>,

Creates a new instance of an EVM with an inspector.

Note: It is expected that the [Inspector] is usually provided as &mut Inspector so that it remains owned by the call site when Evm::transact is invoked.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl EvmFactory for OpEvmFactory

§

type Evm<DB: Database, I: Inspector<Context<BlockEnv, OpTransaction<TxEnv>, CfgEnv<OpSpecId>, DB, Journal<DB>, L1BlockInfo>>> = OpEvm<DB, I>

§

type Context<DB: Database> = Context<BlockEnv, OpTransaction<TxEnv>, CfgEnv<OpSpecId>, DB, Journal<DB>, L1BlockInfo>

§

type Tx = OpTransaction<TxEnv>

§

type Error<DBError: Error + Send + Sync + 'static> = EVMError<DBError, OpTransactionError>

§

type HaltReason = OpHaltReason

§

type Spec = OpSpecId

§

impl EvmFactory for EthEvmFactory

§

type Evm<DB: Database, I: Inspector<Context<BlockEnv, TxEnv, CfgEnv, DB>>> = EthEvm<DB, I>

§

type Context<DB: Database> = Context<BlockEnv, TxEnv, CfgEnv, DB>

§

type Tx = TxEnv

§

type Error<DBError: Error + Send + Sync + 'static> = EVMError<DBError>

§

type HaltReason = HaltReason

§

type Spec = SpecId