From f23370b5d032b42ccec98d41cfef1ddf9efe6960 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 16 Jul 2025 17:26:51 +0200 Subject: [PATCH] chore: relax tracer bounds --- crates/anvil/src/eth/backend/mem/inspector.rs | 12 ++++-------- crates/evm/evm/src/inspectors/logs.rs | 15 +++++---------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/crates/anvil/src/eth/backend/mem/inspector.rs b/crates/anvil/src/eth/backend/mem/inspector.rs index 4ff97361c5e28..6e5964fc3f94a 100644 --- a/crates/anvil/src/eth/backend/mem/inspector.rs +++ b/crates/anvil/src/eth/backend/mem/inspector.rs @@ -1,10 +1,8 @@ //! Anvil specific [`revm::Inspector`] implementation use crate::eth::macros::node_info; -use alloy_evm::eth::EthEvmContext; use alloy_primitives::{Address, Log, U256}; use foundry_evm::{ - backend::DatabaseError, call_inspectors, decode::decode_console_logs, inspectors::{LogCollector, TracingInspector}, @@ -13,7 +11,7 @@ use foundry_evm::{ }, }; use revm::{ - Database, Inspector, + Inspector, context::ContextTr, inspector::JournalExt, interpreter::{ @@ -108,11 +106,9 @@ fn print_traces(tracer: TracingInspector) { node_info!("{}", render_trace_arena_inner(&traces, false, true)); } -impl Inspector for AnvilInspector +impl Inspector for AnvilInspector where - D: Database, - CTX: ContextTr, - CTX::Journal: JournalExt, + CTX: ContextTr, { fn initialize_interp(&mut self, interp: &mut Interpreter, ecx: &mut CTX) { call_inspectors!([&mut self.tracer], |inspector| { @@ -172,7 +168,7 @@ where #[inline] fn selfdestruct(&mut self, contract: Address, target: Address, value: U256) { if let Some(tracer) = &mut self.tracer { - Inspector::>::selfdestruct(tracer, contract, target, value); + >::selfdestruct(tracer, contract, target, value); } } } diff --git a/crates/evm/evm/src/inspectors/logs.rs b/crates/evm/evm/src/inspectors/logs.rs index 951dec1a1e70b..4b7bee7ce11a7 100644 --- a/crates/evm/evm/src/inspectors/logs.rs +++ b/crates/evm/evm/src/inspectors/logs.rs @@ -1,13 +1,10 @@ use alloy_primitives::Log; use alloy_sol_types::{SolEvent, SolInterface, SolValue}; use foundry_common::{ErrorExt, fmt::ConsoleFmt}; -use foundry_evm_core::{ - InspectorExt, abi::console, backend::DatabaseError, constants::HARDHAT_CONSOLE_ADDRESS, -}; +use foundry_evm_core::{InspectorExt, abi::console, constants::HARDHAT_CONSOLE_ADDRESS}; use revm::{ - Database, Inspector, + Inspector, context::ContextTr, - inspector::JournalExt, interpreter::{ CallInputs, CallOutcome, Gas, InstructionResult, Interpreter, InterpreterResult, interpreter::EthInterpreter, @@ -27,7 +24,7 @@ impl LogCollector { #[cold] fn do_hardhat_log(&mut self, context: &mut CTX, inputs: &CallInputs) -> Option where - CTX: ContextTr, Journal: JournalExt>, + CTX: ContextTr, { if let Err(err) = self.hardhat_log(&inputs.input.bytes(context)) { let result = InstructionResult::Revert; @@ -47,11 +44,9 @@ impl LogCollector { } } -impl Inspector for LogCollector +impl Inspector for LogCollector where - D: Database, - CTX: ContextTr, - CTX::Journal: JournalExt, + CTX: ContextTr, { fn log(&mut self, _interp: &mut Interpreter, _context: &mut CTX, log: Log) { self.logs.push(log);