Trait ExecuteCommitEvm

pub trait ExecuteCommitEvm: ExecuteEvm {
    // Required method
    fn commit(&mut self, state: Self::State);

    // Provided methods
    fn commit_inner(&mut self) { ... }
    fn transact_commit(
        &mut self,
        tx: Self::Tx,
    ) -> Result<Self::ExecutionResult, Self::Error> { ... }
    fn transact_many_commit(
        &mut self,
        txs: impl Iterator<Item = Self::Tx>,
    ) -> Result<Vec<Self::ExecutionResult>, Self::Error> { ... }
    fn replay_commit(&mut self) -> Result<Self::ExecutionResult, Self::Error> { ... }
}
Expand description

Extension of the ExecuteEvm trait that adds a method that commits the state after execution.

Required Methods§

fn commit(&mut self, state: Self::State)

Commit the state.

Provided Methods§

fn commit_inner(&mut self)

Finalize the state and commit it to the database.

Internally calls finalize and commit functions.

fn transact_commit( &mut self, tx: Self::Tx, ) -> Result<Self::ExecutionResult, Self::Error>

Transact the transaction and commit to the state.

fn transact_many_commit( &mut self, txs: impl Iterator<Item = Self::Tx>, ) -> Result<Vec<Self::ExecutionResult>, Self::Error>

Transact multiple transactions and commit to the state.

Internally calls transact_many and commit_inner functions.

fn replay_commit(&mut self) -> Result<Self::ExecutionResult, Self::Error>

Replay the transaction and commit to the state.

Internally calls replay and commit functions.

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<CTX, INSP, PRECOMPILE> ExecuteCommitEvm for OpEvm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILE>
where CTX: OpContextTr + ContextSetters, <CTX as ContextTr>::Db: DatabaseCommit, PRECOMPILE: PrecompileProvider<CTX, Output = InterpreterResult>,

§

fn commit( &mut self, state: <OpEvm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILE> as ExecuteEvm>::State, )

Implementors§

§

impl<CTX, INSP, INST, PRECOMPILES> ExecuteCommitEvm for Evm<CTX, INSP, INST, PRECOMPILES, EthFrame>
where CTX: ContextTr + ContextSetters, <CTX as ContextTr>::Journal: JournalTr<State = HashMap<Address, Account, RandomState>>, <CTX as ContextTr>::Db: DatabaseCommit, INST: InstructionProvider<Context = CTX, InterpreterTypes = EthInterpreter>, PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>,