Skip to content

Commit

Permalink
chore(Inspector): add inspector depth test (bluealloy#1028)
Browse files Browse the repository at this point in the history
* chore(clippy): nightly clippy

* refactor(op): Move op l1 block load to op handler

* add inspector test and optimism test
  • Loading branch information
rakita authored Jan 30, 2024
1 parent 5b22e9d commit 2a294fc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions crates/revm/src/inspector/handler_register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,44 +308,48 @@ mod tests {

fn call(
&mut self,
_context: &mut EvmContext<DB>,
context: &mut EvmContext<DB>,
_call: &mut CallInputs,
_return_memory_offset: Range<usize>,
) -> Option<CallOutcome> {
if self.call {
unreachable!("call should not be called twice")
}
self.call = true;
assert_eq!(context.journaled_state.depth(), 0);
None
}

fn call_end(
&mut self,
_context: &mut EvmContext<DB>,
context: &mut EvmContext<DB>,
_inputs: &CallInputs,
outcome: CallOutcome,
) -> CallOutcome {
if self.call_end {
unreachable!("call_end should not be called twice")
}
assert_eq!(context.journaled_state.depth(), 0);
self.call_end = true;
outcome
}

fn create(
&mut self,
_context: &mut EvmContext<DB>,
context: &mut EvmContext<DB>,
_call: &mut CreateInputs,
) -> Option<CreateOutcome> {
assert_eq!(context.journaled_state.depth(), 0);
None
}

fn create_end(
&mut self,
_context: &mut EvmContext<DB>,
context: &mut EvmContext<DB>,
_inputs: &CreateInputs,
outcome: CreateOutcome,
) -> CreateOutcome {
assert_eq!(context.journaled_state.depth(), 0);
outcome
}
}
Expand Down

0 comments on commit 2a294fc

Please sign in to comment.