Skip to content

Commit

Permalink
feat: pass interpreter into Inspector::log
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Jul 14, 2024
1 parent c2e356d commit f4cc892
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion crates/revm/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ pub trait Inspector<DB: Database> {

/// Called when a log is emitted.
#[inline]
fn log(&mut self, context: &mut EvmContext<DB>, log: &Log) {
fn log(&mut self, interp: &mut Interpreter, context: &mut EvmContext<DB>, log: &Log) {
let _ = interp;
let _ = context;
let _ = log;
}
Expand Down
4 changes: 2 additions & 2 deletions crates/revm/src/inspector/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ mod tests {
self.gas_inspector.step(interp, context);
}

fn log(&mut self, context: &mut EvmContext<DB>, log: &Log) {
self.gas_inspector.log(context, log);
fn log(&mut self, interp: &mut Interpreter, context: &mut EvmContext<DB>, log: &Log) {
self.gas_inspector.log(interp, context, log);
}

fn step_end(&mut self, interp: &mut Interpreter, context: &mut EvmContext<DB>) {
Expand Down
4 changes: 3 additions & 1 deletion crates/revm/src/inspector/handler_register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ pub fn inspector_handle_register<DB: Database, EXT: GetInspector<DB>>(
// that log can be found as journaled_state.
let last_log = host.evm.journaled_state.logs.last().unwrap().clone();
// call Inspector
host.external.get_inspector().log(&mut host.evm, &last_log);
host.external
.get_inspector()
.log(interpreter, &mut host.evm, &last_log);
}
});
}
Expand Down

0 comments on commit f4cc892

Please sign in to comment.