pub trait InspectorHandler: Handlerwhere
Self::Evm: InspectorEvmTr<Inspector: Inspector<<<Self as Handler>::Evm as EvmTr>::Context, Self::IT>>,{
type IT: InterpreterTypes;
// Provided methods
fn inspect_run(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error> { ... }
fn inspect_run_without_catch_error(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error> { ... }
fn inspect_execution(
&mut self,
evm: &mut Self::Evm,
init_and_floor_gas: &InitialAndFloorGas,
) -> Result<FrameResult, Self::Error> { ... }
fn inspect_run_exec_loop(
&mut self,
evm: &mut Self::Evm,
first_frame_input: <<Self::Evm as EvmTr>::Frame as FrameTr>::FrameInit,
) -> 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
:
- [
Handler::run
] replaced withInspectorHandler::inspect_run
- [
Handler::run_without_catch_error
] replaced withInspectorHandler::inspect_run_without_catch_error
- [
Handler::execution
] replaced withInspectorHandler::inspect_execution
- [
Handler::run_exec_loop
] replaced withInspectorHandler::inspect_run_exec_loop
run_exec_loop
callsinspect_frame_init
andinspect_frame_run
that call inspector inside.
Required Associated Types§
Sourcetype IT: InterpreterTypes
type IT: InterpreterTypes
The interpreter types used by this handler.
Provided Methods§
Sourcefn inspect_run(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
fn inspect_run( &mut self, evm: &mut Self::Evm, ) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
Entry point for inspection.
This method is acts as [Handler::run
] method for inspection.
Sourcefn inspect_run_without_catch_error(
&mut self,
evm: &mut Self::Evm,
) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
fn inspect_run_without_catch_error( &mut self, evm: &mut Self::Evm, ) -> Result<ExecutionResult<Self::HaltReason>, Self::Error>
Run inspection without catching error.
This method is acts as [Handler::run_without_catch_error
] method for inspection.
Sourcefn inspect_execution(
&mut self,
evm: &mut Self::Evm,
init_and_floor_gas: &InitialAndFloorGas,
) -> Result<FrameResult, Self::Error>
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.
Sourcefn inspect_run_exec_loop(
&mut self,
evm: &mut Self::Evm,
first_frame_input: <<Self::Evm as EvmTr>::Frame as FrameTr>::FrameInit,
) -> Result<FrameResult, Self::Error>
fn inspect_run_exec_loop( &mut self, evm: &mut Self::Evm, first_frame_input: <<Self::Evm as EvmTr>::Frame as FrameTr>::FrameInit, ) -> Result<FrameResult, Self::Error>
Run inspection on execution loop.
This method acts as [Handler::run_exec_loop
] method for inspection.
It will call:
Inspector::call
,Inspector::create
to inspect call, create and eofcreate.Inspector::call_end
,Inspector::create_end
to inspect call, create and eofcreate end.Inspector::initialize_interp
to inspect initialized interpreter.
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.