Trait InspectorEvmTr

Source
pub trait InspectorEvmTr: EvmTr {
    type Inspector;

    // Required methods
    fn inspector(&mut self) -> &mut Self::Inspector;
    fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector);
    fn run_inspect_interpreter(
        &mut self,
        interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>,
    ) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output;
}
Expand description

Inspector EVM trait. Extends the EvmTr trait with inspector related methods.

It contains execution of interpreter with crate::Inspector calls crate::Inspector::step and crate::Inspector::step_end calls.

It is used inside crate::InspectorHandler to extend evm with support for inspection.

Required Associated Types§

Required Methods§

Source

fn inspector(&mut self) -> &mut Self::Inspector

Returns a mutable reference to the inspector.

Source

fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector)

Returns a tuple of mutable references to the context and the inspector.

Useful when you want to allow inspector to modify the context.

Source

fn run_inspect_interpreter( &mut self, interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>, ) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output

Runs the inspector on the interpreter.

This function is called by the EVM when it needs to inspect the Interpreter loop. It is responsible for calling the inspector’s methods and instructions from table.

Implementations on Foreign Types§

Source§

impl<CTX, INSP, I, P> InspectorEvmTr for Evm<CTX, INSP, I, P>
where CTX: ContextTr<Journal: JournalExt> + ContextSetters, I: InstructionProvider<Context = CTX, InterpreterTypes: InterpreterTypes<Output = InterpreterAction>>, INSP: Inspector<CTX, I::InterpreterTypes>,

Source§

type Inspector = INSP

Source§

fn inspector(&mut self) -> &mut Self::Inspector

Source§

fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector)

Source§

fn run_inspect_interpreter( &mut self, interpreter: &mut Interpreter<<Self::Instructions as InstructionProvider>::InterpreterTypes>, ) -> <<Self::Instructions as InstructionProvider>::InterpreterTypes as InterpreterTypes>::Output

Implementors§