EvmFactory

Trait EvmFactory 

Source
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::Error>, Spec = Self::Spec, BlockEnv = Self::BlockEnv, Precompiles = Self::Precompiles, Inspector = I>;
    type Context<DB: Database>: ContextTr<Db = DB, 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 + Hash + Eq + Send + Sync + Default + 'static;
    type BlockEnv: BlockEnvironment;
    type Precompiles;

    // Required methods
    fn create_evm<DB: Database>(
        &self,
        db: DB,
        evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
    ) -> Self::Evm<DB, NoOpInspector>;
    fn create_evm_with_inspector<DB: Database, I: Inspector<Self::Context<DB>>>(
        &self,
        db: DB,
        input: EvmEnv<Self::Spec, Self::BlockEnv>,
        inspector: I,
    ) -> Self::Evm<DB, I>;
}
Expand description

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

Required Associated Types§

Source

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

The EVM type that this factory creates.

Source

type Context<DB: Database>: ContextTr<Db = DB, Journal: JournalExt>

The EVM context for inspectors

Source

type Tx: IntoTxEnv<Self::Tx>

Transaction environment.

Source

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

EVM error. See Evm::Error.

Source

type HaltReason: HaltReasonTr + Send + Sync + 'static

Halt reason. See Evm::HaltReason.

Source

type Spec: Debug + Copy + Hash + Eq + Send + Sync + Default + 'static

The EVM specification identifier, see Evm::Spec.

Source

type BlockEnv: BlockEnvironment

Block environment used by the EVM. See Evm::BlockEnv.

Source

type Precompiles

Precompiles used by the EVM.

Required Methods§

Source

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

Creates a new instance of an EVM.

Source

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

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§