Trait ExecuteEvm

Source
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§

Source

type Output

Output of transaction execution.

Source

type Tx: Transaction

Transaction type.

Source

type Block: Block

Block type.

Required Methods§

Source

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

Set the transaction.

Source

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

Set the block.

Source

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

Transact the transaction that is set in the context.

Provided Methods§

Source

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§

Source§

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

Source§

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

Source§

type Tx = <CTX as ContextTr>::Tx

Source§

type Block = <CTX as ContextTr>::Block

Source§

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

Source§

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

Source§

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

Implementors§