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, Precompiles = Self::Precompiles<DB>, Inspector = I>;
    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 + Hash + Eq + Send + Sync + Default + 'static;
    type Precompiles<DB: Database>;

    // 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>>;
}
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, Precompiles = Self::Precompiles<DB>, Inspector = I>

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 + Hash + Eq + Send + Sync + Default + 'static

The EVM specification identifier, see Evm::Spec.

type Precompiles<DB: Database>

Precompiles used by the EVM.

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.

Implementations on Foreign Types§

§

impl<T> EvmFactory for SeismicEvmFactory<T>
where T: SyncEnclaveApiClientBuilder,

§

type Evm<DB: Database, I: Inspector<Context<BlockEnv, SeismicTransaction<TxEnv>, CfgEnv<SeismicSpecId>, DB, Journal<DB>, SeismicChain>>> = SeismicEvm<DB, I>

§

type Context<DB: Database> = Context<BlockEnv, SeismicTransaction<TxEnv>, CfgEnv<SeismicSpecId>, DB, Journal<DB>, SeismicChain>

§

type Tx = SeismicTransaction<TxEnv>

§

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

§

type HaltReason = SeismicHaltReason

§

type Spec = SeismicSpecId

§

type Precompiles<DB: Database> = SeismicPrecompiles<<SeismicEvmFactory<T> as EvmFactory>::Context<DB>>

§

fn create_evm<DB>( &self, db: DB, input: EvmEnv<SeismicSpecId>, ) -> <SeismicEvmFactory<T> as EvmFactory>::Evm<DB, NoOpInspector>
where DB: Database,

§

fn create_evm_with_inspector<DB, I>( &self, db: DB, input: EvmEnv<SeismicSpecId>, inspector: I, ) -> <SeismicEvmFactory<T> as EvmFactory>::Evm<DB, I>
where DB: Database, I: Inspector<<SeismicEvmFactory<T> as EvmFactory>::Context<DB>>,

Implementors§