reth_evm

Trait ConfigureEvm

Source
pub trait ConfigureEvm: ConfigureEvmEnv {
    type DefaultExternalContext<'a>;

    // Required method
    fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a>;

    // Provided methods
    fn evm<DB: Database>(
        &self,
        db: DB,
    ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> { ... }
    fn evm_with_env<DB: Database>(
        &self,
        db: DB,
        env: EnvWithHandlerCfg,
    ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> { ... }
    fn evm_with_env_and_inspector<DB, I>(
        &self,
        db: DB,
        env: EnvWithHandlerCfg,
        inspector: I,
    ) -> Evm<'_, I, DB>
       where DB: Database,
             I: GetInspector<DB> { ... }
    fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
       where DB: Database,
             I: GetInspector<DB> { ... }
}
Expand description

Trait for configuring the EVM for executing full blocks.

Required Associated Types§

Source

type DefaultExternalContext<'a>

Associated type for the default external context that should be configured for the EVM.

Required Methods§

Source

fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a>

Provides the default external context.

Provided Methods§

Source

fn evm<DB: Database>( &self, db: DB, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>

Returns new EVM with the given database

This does not automatically configure the EVM with ConfigureEvmEnv methods. It is up to the caller to call an appropriate method to fill the transaction and block environment before executing any transactions using the provided EVM.

Source

fn evm_with_env<DB: Database>( &self, db: DB, env: EnvWithHandlerCfg, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>

Returns a new EVM with the given database configured with the given environment settings, including the spec id.

This will preserve any handler modifications

Source

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, env: EnvWithHandlerCfg, inspector: I, ) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Returns a new EVM with the given database configured with the given environment settings, including the spec id.

This will use the given external inspector as the EVM external context.

This will preserve any handler modifications

Source

fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Returns a new EVM with the given inspector.

Caution: This does not automatically configure the EVM with ConfigureEvmEnv methods. It is up to the caller to call an appropriate method to fill the transaction and block environment before executing any transactions using the provided EVM.

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§

Source§

impl<'b, T: 'b + ConfigureEvm + ?Sized> ConfigureEvm for &'b T

Source§

type DefaultExternalContext<'a> = <T as ConfigureEvm>::DefaultExternalContext<'a>

Source§

fn evm<DB: Database>( &self, db: DB, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>

Source§

fn evm_with_env<DB: Database>( &self, db: DB, env: EnvWithHandlerCfg, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>

Source§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, env: EnvWithHandlerCfg, inspector: I, ) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Source§

fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Source§

fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a>

Source§

impl<T: ConfigureEvm + ?Sized> ConfigureEvm for Arc<T>
where Arc<T>: ConfigureEvmEnv,

Source§

type DefaultExternalContext<'a> = <T as ConfigureEvm>::DefaultExternalContext<'a>

Source§

fn evm<DB: Database>( &self, db: DB, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>

Source§

fn evm_with_env<DB: Database>( &self, db: DB, env: EnvWithHandlerCfg, ) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>

Source§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, env: EnvWithHandlerCfg, inspector: I, ) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Source§

fn evm_with_inspector<DB, I>(&self, db: DB, inspector: I) -> Evm<'_, I, DB>
where DB: Database, I: GetInspector<DB>,

Source§

fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a>

Implementors§