Skip to main content

Evm

Trait Evm 

Source
pub trait Evm {
    type EvmTypes: EvmTypes<Tx = Self::Transaction>;
    type Transaction;

Show 13 methods // Required methods fn transact( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResultWithState<Self::EvmTypes>, BlockExecutionError>; fn transact_commit( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResult<Self::EvmTypes>, BlockExecutionError>; fn transact_result( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResult<Self::EvmTypes>, BlockExecutionError>; fn transact_with_inspector<I>( &mut self, transaction: &Recovered<Self::Transaction>, inspector: I, ) -> Result<(I, TxResultWithState<Self::EvmTypes>), BlockExecutionError> where I: Inspector<Self::EvmTypes> + 'static; fn set_inspector<I>(&mut self, inspector: I) where I: Inspector<Self::EvmTypes> + 'static; fn state_db_mut(&mut self) -> &mut dyn DynDatabase; fn commit_state(&mut self, state: &PendingState); fn take_state_cache(&mut self) -> Cache; fn precompile_ids(&self) -> Vec<(Address, PrecompileId)>; fn has_precompile(&self, address: &Address) -> bool; fn account_info( &mut self, address: &Address, ) -> Result<Option<AccountInfo>, BlockExecutionError>; fn move_precompiles( &mut self, moves: impl IntoIterator<Item = (Address, Address)>, ) -> Result<(), MovePrecompileError>; fn transact_and_discard<R>( &mut self, transaction: &Recovered<Self::Transaction>, observe: impl FnOnce(&ExecutedTx<'_, '_, Self::EvmTypes>) -> R, ) -> Result<R, BlockExecutionError>;
}
Expand description

A configured EVM instance.

Required Associated Types§

Source

type EvmTypes: EvmTypes<Tx = Self::Transaction>

Runtime EVM type family.

Source

type Transaction

Transaction environment consumed by this EVM.

Required Methods§

Source

fn transact( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResultWithState<Self::EvmTypes>, BlockExecutionError>

Executes a transaction without committing its state changes.

Source

fn transact_commit( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResult<Self::EvmTypes>, BlockExecutionError>

Executes and accepts writes in the EVM’s block-scoped state without detaching them.

Source

fn transact_result( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResult<Self::EvmTypes>, BlockExecutionError>

Executes a transaction and discards writes without materializing detached state.

Source

fn transact_with_inspector<I>( &mut self, transaction: &Recovered<Self::Transaction>, inspector: I, ) -> Result<(I, TxResultWithState<Self::EvmTypes>), BlockExecutionError>
where I: Inspector<Self::EvmTypes> + 'static,

Executes a transaction with an inspector without committing its state changes.

Source

fn set_inspector<I>(&mut self, inspector: I)
where I: Inspector<Self::EvmTypes> + 'static,

Sets the inspector used by subsequent transactions.

Source

fn state_db_mut(&mut self) -> &mut dyn DynDatabase

Returns the accepted state overlay, including earlier committed transactions.

Source

fn commit_state(&mut self, state: &PendingState)

Accepts detached changes after a tracing callback has consumed the pre-state.

Source

fn take_state_cache(&mut self) -> Cache

Takes cached reads and accepted writes for a caller that continues using its database.

Source

fn precompile_ids(&self) -> Vec<(Address, PrecompileId)>

Returns active precompile addresses and identifiers.

Source

fn has_precompile(&self, address: &Address) -> bool

Returns whether an address is an active precompile.

Source

fn account_info( &mut self, address: &Address, ) -> Result<Option<AccountInfo>, BlockExecutionError>

Returns account information visible through the accepted state overlay.

Source

fn move_precompiles( &mut self, moves: impl IntoIterator<Item = (Address, Address)>, ) -> Result<(), MovePrecompileError>

Applies precompile address moves to the active precompile set.

Source

fn transact_and_discard<R>( &mut self, transaction: &Recovered<Self::Transaction>, observe: impl FnOnce(&ExecutedTx<'_, '_, Self::EvmTypes>) -> R, ) -> Result<R, BlockExecutionError>

Executes a transaction, lets observe inspect the executed transaction and its state changes, then discards its writes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T: EvmTypes<Tx: Typed2718>> Evm for Evm<'a, T>

Source§

type EvmTypes = T

Source§

type Transaction = <T as EvmTypesHost>::Tx

Source§

fn transact( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResultWithState<T>, BlockExecutionError>

Source§

fn transact_commit( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResult<T>, BlockExecutionError>

Source§

fn transact_result( &mut self, transaction: &Recovered<Self::Transaction>, ) -> Result<TxResult<T>, BlockExecutionError>

Source§

fn transact_with_inspector<I: Inspector<T> + 'a>( &mut self, transaction: &Recovered<Self::Transaction>, inspector: I, ) -> Result<(I, TxResultWithState<T>), BlockExecutionError>

Source§

fn set_inspector<I: Inspector<T> + 'a>(&mut self, inspector: I)

Source§

fn state_db_mut(&mut self) -> &mut dyn DynDatabase

Source§

fn commit_state(&mut self, state: &PendingState)

Source§

fn take_state_cache(&mut self) -> Cache

Source§

fn precompile_ids(&self) -> Vec<(Address, PrecompileId)>

Source§

fn has_precompile(&self, address: &Address) -> bool

Source§

fn account_info( &mut self, address: &Address, ) -> Result<Option<AccountInfo>, BlockExecutionError>

Source§

fn move_precompiles( &mut self, moves: impl IntoIterator<Item = (Address, Address)>, ) -> Result<(), MovePrecompileError>

Source§

fn transact_and_discard<R>( &mut self, transaction: &Recovered<Self::Transaction>, observe: impl FnOnce(&ExecutedTx<'_, '_, T>) -> R, ) -> Result<R, BlockExecutionError>

Implementors§