pub trait InspectorHandler: Handlerwhere
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
:
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::first_frame_init
replaced withInspectorHandler::inspect_first_frame_init
Handler::frame_call
replaced withInspectorHandler::inspect_frame_call
Handler::run_exec_loop
replaced withInspectorHandler::inspect_run_exec_loop
Required Associated Types§
type IT: InterpreterTypes
Provided Methods§
Sourcefn inspect_run(
&mut self,
evm: &mut Self::Evm,
) -> Result<ResultAndState<Self::HaltReason>, Self::Error>
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.
Sourcefn inspect_run_without_catch_error(
&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>
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_first_frame_init(
&mut self,
evm: &mut Self::Evm,
frame_input: <Self::Frame as Frame>::FrameInit,
) -> Result<FrameOrResult<Self::Frame>, 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>
Initialize first frame.
This method replaces the Handler::first_frame_init
method from Handler
.
- It calls
Inspector::call
/Inspector::create
/Inspector::eofcreate
methods to allow inspection of the frame and its modification. - If new frame is created a
Inspector::initialize_interp
method will be called. - If creation of new frame returns the result, the
Inspector
_end
methods will be called.
Sourcefn inspect_frame_call(
&mut self,
frame: &mut Self::Frame,
evm: &mut Self::Evm,
) -> Result<FrameInitOrResult<Self::Frame>, Self::Error>
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.
Sourcefn inspect_run_exec_loop(
&mut self,
evm: &mut Self::Evm,
frame: Self::Frame,
) -> Result<FrameResult, Self::Error>
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:
InspectorHandler::inspect_frame_call
to inspect Interpreter execution loop.Inspector::call
,Inspector::create
,Inspector::eofcreate
to inspect call, create and eofcreate.Inspector::call_end
,Inspector::create_end
,Inspector::eofcreate_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.