Trait InspectorEvmTr

pub trait InspectorEvmTr: EvmTr<Frame = EthFrame>
where Self::Instructions: InstructionProvider<InterpreterTypes = EthInterpreter, Context = Self::Context>, Self::Context: ContextTr, <Self::Context as ContextTr>::Journal: JournalExt,
{ type Inspector: Inspector<Self::Context>; // Required 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); // Provided methods fn inspect_frame_init( &mut self, frame_init: <Self::Frame as FrameTr>::FrameInit, ) -> Result<ItemOrResult<&mut Self::Frame, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>> { ... } fn inspect_frame_run( &mut self, ) -> Result<ItemOrResult<<Self::Frame as FrameTr>::FrameInit, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>> { ... } }
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§

type Inspector: Inspector<Self::Context>

The inspector type used for EVM execution inspection.

Required Methods§

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

Returns a mutable reference to the inspector.

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.

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.

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.

Provided Methods§

fn inspect_frame_init( &mut self, frame_init: <Self::Frame as FrameTr>::FrameInit, ) -> Result<ItemOrResult<&mut Self::Frame, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>>

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

fn inspect_frame_run( &mut self, ) -> Result<ItemOrResult<<Self::Frame as FrameTr>::FrameInit, <Self::Frame as FrameTr>::FrameResult>, ContextError<<<Self::Context as ContextTr>::Db as Database>::Error>>

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§

§

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

§

type Inspector = INSP

§

fn inspector( &mut self, ) -> &mut <OpEvm<CTX, INSP, I, P> as InspectorEvmTr>::Inspector

§

fn ctx_inspector( &mut self, ) -> (&mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Context, &mut <OpEvm<CTX, INSP, I, P> as InspectorEvmTr>::Inspector)

§

fn ctx_inspector_frame( &mut self, ) -> (&mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Context, &mut <OpEvm<CTX, INSP, I, P> as InspectorEvmTr>::Inspector, &mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Frame)

§

fn ctx_inspector_frame_instructions( &mut self, ) -> (&mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Context, &mut <OpEvm<CTX, INSP, I, P> as InspectorEvmTr>::Inspector, &mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Frame, &mut <OpEvm<CTX, INSP, I, P> as EvmTr>::Instructions)

Implementors§

§

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

§

type Inspector = INSP