Trait ExecuteEvm

pub trait ExecuteEvm {
    type Output;
    type Tx: Transaction;
    type Block: Block;

    // Required methods
    fn set_tx(&mut self, tx: Self::Tx);
    fn set_block(&mut self, block: Self::Block);
    fn replay(&mut self) -> Self::Output;

    // Provided method
    fn transact(&mut self, tx: Self::Tx) -> Self::Output { ... }
}
Expand description

Execute EVM transactions. Main trait for transaction execution.

Required Associated Types§

type Output

Output of transaction execution.

type Tx: Transaction

Transaction type.

type Block: Block

Block type.

Required Methods§

fn set_tx(&mut self, tx: Self::Tx)

Set the transaction.

fn set_block(&mut self, block: Self::Block)

Set the block.

fn replay(&mut self) -> Self::Output

Transact the transaction that is set in the context.

Provided Methods§

fn transact(&mut self, tx: Self::Tx) -> Self::Output

Transact the given transaction.

Internally sets transaction in context and use replay to execute the transaction.

Implementations on Foreign Types§

§

impl<CTX, INSP, PRECOMPILE> ExecuteEvm for OpEvm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILE>
where CTX: OpContextTr + ContextSetters, PRECOMPILE: PrecompileProvider<CTX, Output = InterpreterResult>,

§

type Output = Result<ResultAndState<OpHaltReason>, EVMError<<<CTX as ContextTr>::Db as Database>::Error, OpTransactionError>>

§

type Tx = <CTX as ContextTr>::Tx

§

type Block = <CTX as ContextTr>::Block

§

fn set_tx( &mut self, tx: <OpEvm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILE> as ExecuteEvm>::Tx, )

§

fn set_block( &mut self, block: <OpEvm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILE> as ExecuteEvm>::Block, )

§

fn replay( &mut self, ) -> <OpEvm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILE> as ExecuteEvm>::Output

Implementors§

§

impl<CTX, INSP, PRECOMPILES> ExecuteEvm for Evm<CTX, INSP, EthInstructions<EthInterpreter, CTX>, PRECOMPILES>
where CTX: ContextTr + ContextSetters, <CTX as ContextTr>::Journal: JournalTr<FinalOutput = JournalOutput>, PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>,

§

type Output = Result<ResultAndState, EVMError<<<CTX as ContextTr>::Db as Database>::Error>>

§

type Tx = <CTX as ContextTr>::Tx

§

type Block = <CTX as ContextTr>::Block