InspectorEvmTr

Trait InspectorEvmTr 

Source
pub trait InspectorEvmTr: EvmTr<Frame: InspectorFrame<IT = EthInterpreter>, Instructions: InstructionProvider<InterpreterTypes = EthInterpreter, Context = Self::Context>, Context: ContextTr<Journal: JournalExt>> {
    type Inspector: Inspector<Self::Context, EthInterpreter>;

    // Required methods
    fn all_inspector(
        &self,
    ) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>, &Self::Inspector);
    fn all_mut_inspector(
        &mut self,
    ) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>, &mut Self::Inspector);

    // Provided methods
    fn inspector(&mut self) -> &mut Self::Inspector { ... }
    fn ctx_inspector(&mut self) -> (&mut Self::Context, &mut Self::Inspector) { ... }
    fn ctx_inspector_frame(
        &mut self,
    ) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame) { ... }
    fn ctx_inspector_frame_instructions(
        &mut self,
    ) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame, &mut Self::Instructions) { ... }
    fn inspect_frame_init(
        &mut self,
        frame_init: <Self::Frame as FrameTr>::FrameInit,
    ) -> Result<FrameInitResult<'_, Self::Frame>, ContextDbError<Self::Context>> { ... }
    fn inspect_frame_run(
        &mut self,
    ) -> Result<FrameInitOrResult<Self::Frame>, ContextDbError<Self::Context>> { ... }
}
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§

Source

type Inspector: Inspector<Self::Context, EthInterpreter>

The inspector type used for EVM execution inspection.

Required Methods§

Source

fn all_inspector( &self, ) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>, &Self::Inspector)

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

This is one of two functions that need to be implemented for Evm. Second one is all_mut.

Source

fn all_mut_inspector( &mut self, ) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>, &mut Self::Inspector)

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

This is one of two functions that need to be implemented for Evm. Second one is all.

Provided 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 ctx_inspector_frame( &mut self, ) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame)

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

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

Source

fn ctx_inspector_frame_instructions( &mut self, ) -> (&mut Self::Context, &mut Self::Inspector, &mut Self::Frame, &mut Self::Instructions)

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

Source

fn inspect_frame_init( &mut self, frame_init: <Self::Frame as FrameTr>::FrameInit, ) -> Result<FrameInitResult<'_, Self::Frame>, ContextDbError<Self::Context>>

Initializes the frame for the given frame input. Frame is pushed to the frame stack.

Source

fn inspect_frame_run( &mut self, ) -> Result<FrameInitOrResult<Self::Frame>, ContextDbError<Self::Context>>

Run the frame from the top of the stack. Returns the frame init or result.

If frame has returned result it would mark it as finished.

Implementations on Foreign Types§

Source§

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

Source§

type Inspector = INSP

Source§

fn all_inspector( &self, ) -> (&Self::Context, &Self::Instructions, &Self::Precompiles, &FrameStack<Self::Frame>, &Self::Inspector)

Source§

fn all_mut_inspector( &mut self, ) -> (&mut Self::Context, &mut Self::Instructions, &mut Self::Precompiles, &mut FrameStack<Self::Frame>, &mut Self::Inspector)

Implementors§