11use crate :: { Inspector , InspectorEvmTr , JournalExt } ;
22use context:: { result:: ExecutionResult , ContextTr , JournalEntry , JournalTr , Transaction } ;
3- use handler:: { evm :: FrameTr , EvmTr , FrameResult , Handler , ItemOrResult } ;
3+ use handler:: { EvmTr , FrameResult , Handler } ;
44use interpreter:: {
55 instructions:: InstructionTable ,
66 interpreter_types:: { Jumps , LoopControl } ,
@@ -24,7 +24,7 @@ use state::bytecode::opcode;
2424/// * [`Handler::run`] replaced with [`InspectorHandler::inspect_run`]
2525/// * [`Handler::run_without_catch_error`] replaced with [`InspectorHandler::inspect_run_without_catch_error`]
2626/// * [`Handler::execution`] replaced with [`InspectorHandler::inspect_execution`]
27- /// * [`Handler ::run_exec_loop`] replaced with [`InspectorHandler ::inspect_run_exec_loop`]
27+ /// * [`EvmTr ::run_exec_loop`] replaced with [`InspectorEvmTr ::inspect_run_exec_loop`]
2828/// * `run_exec_loop` calls `inspect_frame_init` and `inspect_frame_run` that call inspector inside.
2929/// * [`Handler::run_system_call`] replaced with [`InspectorHandler::inspect_run_system_call`]
3030pub trait InspectorHandler : Handler
@@ -75,56 +75,13 @@ where
7575 let first_frame_input = self . first_frame_input ( evm, gas_limit) ?;
7676
7777 // Run execution loop
78- let mut frame_result = self . inspect_run_exec_loop ( evm , first_frame_input) ?;
78+ let mut frame_result = evm . inspect_run_exec_loop ( first_frame_input) ?;
7979
8080 // Handle last frame result
8181 self . last_frame_result ( evm, & mut frame_result) ?;
8282 Ok ( frame_result)
8383 }
8484
85- /* FRAMES */
86-
87- /// Run inspection on execution loop.
88- ///
89- /// This method acts as [`Handler::run_exec_loop`] method for inspection.
90- ///
91- /// It will call:
92- /// * [`Inspector::call`],[`Inspector::create`] to inspect call, create and eofcreate.
93- /// * [`Inspector::call_end`],[`Inspector::create_end`] to inspect call, create and eofcreate end.
94- /// * [`Inspector::initialize_interp`] to inspect initialized interpreter.
95- fn inspect_run_exec_loop (
96- & mut self ,
97- evm : & mut Self :: Evm ,
98- first_frame_input : <<Self :: Evm as EvmTr >:: Frame as FrameTr >:: FrameInit ,
99- ) -> Result < FrameResult , Self :: Error > {
100- let res = evm. inspect_frame_init ( first_frame_input) ?;
101-
102- if let ItemOrResult :: Result ( frame_result) = res {
103- return Ok ( frame_result) ;
104- }
105-
106- loop {
107- let call_or_result = evm. inspect_frame_run ( ) ?;
108-
109- let result = match call_or_result {
110- ItemOrResult :: Item ( init) => {
111- match evm. inspect_frame_init ( init) ? {
112- ItemOrResult :: Item ( _) => {
113- continue ;
114- }
115- // Do not pop the frame since no new frame was created
116- ItemOrResult :: Result ( result) => result,
117- }
118- }
119- ItemOrResult :: Result ( result) => result,
120- } ;
121-
122- if let Some ( result) = evm. frame_return_result ( result) ? {
123- return Ok ( result) ;
124- }
125- }
126- }
127-
12885 /// Run system call with inspection support.
12986 ///
13087 /// This method acts as [`Handler::run_system_call`] method for inspection.
0 commit comments