Trait InspectorHandler

Source
pub trait InspectorHandler: Handler
where Self::Evm: InspectorEvmTr<Inspector: Inspector<<<Self as Handler>::Evm as EvmTr>::Context, Self::IT>>, Self::Frame: InspectorFrame<IT = Self::IT>,
{ type IT: InterpreterTypes; // Provided methods fn inspect_run( &mut self, evm: &mut Self::Evm, ) -> Result<ResultAndState<Self::HaltReason>, Self::Error> { ... } fn inspect_run_without_catch_error( &mut self, evm: &mut Self::Evm, ) -> Result<ResultAndState<Self::HaltReason>, Self::Error> { ... } fn inspect_execution( &mut self, evm: &mut Self::Evm, init_and_floor_gas: &InitialAndFloorGas, ) -> Result<FrameResult, Self::Error> { ... } fn inspect_first_frame_init( &mut self, evm: &mut Self::Evm, frame_input: <Self::Frame as Frame>::FrameInit, ) -> Result<FrameOrResult<Self::Frame>, Self::Error> { ... } fn inspect_frame_call( &mut self, frame: &mut Self::Frame, evm: &mut Self::Evm, ) -> Result<FrameInitOrResult<Self::Frame>, Self::Error> { ... } fn inspect_run_exec_loop( &mut self, evm: &mut Self::Evm, frame: Self::Frame, ) -> Result<FrameResult, Self::Error> { ... } }
Expand description

Trait that extends Handler with inspection functionality.

Similar how Handler::run method serves as the entry point, InspectorHandler::inspect_run method serves as the entry point for inspection.

Notice that when inspection is run it skips few functions from handler, this can be a problem if custom EVM is implemented and some of skipped functions have changed logic. For custom EVM, those changed functions would need to be also changed in InspectorHandler.

List of functions that are skipped in InspectorHandler:

Required Associated Types§

Provided Methods§

Source

fn inspect_run( &mut self, evm: &mut Self::Evm, ) -> Result<ResultAndState<Self::HaltReason>, Self::Error>

Entry point for inspection.

This method is acts as Handler::run method for inspection.

Source

fn inspect_run_without_catch_error( &mut self, evm: &mut Self::Evm, ) -> Result<ResultAndState<Self::HaltReason>, Self::Error>

Run inspection without catching error.

This method is acts as Handler::run_without_catch_error method for inspection.

Source

fn inspect_execution( &mut self, evm: &mut Self::Evm, init_and_floor_gas: &InitialAndFloorGas, ) -> Result<FrameResult, Self::Error>

Run execution loop with inspection support

This method acts as Handler::execution method for inspection.

Source

fn inspect_first_frame_init( &mut self, evm: &mut Self::Evm, frame_input: <Self::Frame as Frame>::FrameInit, ) -> Result<FrameOrResult<Self::Frame>, Self::Error>

Initialize first frame.

This method replaces the Handler::first_frame_init method from Handler.

Source

fn inspect_frame_call( &mut self, frame: &mut Self::Frame, evm: &mut Self::Evm, ) -> Result<FrameInitOrResult<Self::Frame>, Self::Error>

Run inspection on frame.

This method acts as Handler::frame_call method for inspection.

Internally it will call Inspector::step, Inspector::step_end for each instruction. And Inspector::log,Inspector::selfdestruct for each log and selfdestruct instruction.

Source

fn inspect_run_exec_loop( &mut self, evm: &mut Self::Evm, frame: Self::Frame, ) -> Result<FrameResult, Self::Error>

Run inspection on execution loop.

This method acts as Handler::run_exec_loop method for inspection.

It will call:

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<EVM, ERROR, FRAME> InspectorHandler for MainnetHandler<EVM, ERROR, FRAME>
where EVM: InspectorEvmTr<Context: ContextTr<Journal: JournalTr<FinalOutput = JournalOutput>>, Inspector: Inspector<<<Self as Handler>::Evm as EvmTr>::Context, EthInterpreter>>, ERROR: EvmTrError<EVM>, FRAME: Frame<Evm = EVM, Error = ERROR, FrameResult = FrameResult, FrameInit = FrameInput> + InspectorFrame<IT = EthInterpreter>,

Implementors§