Skip to content

Commit 78989e0

Browse files
authored
chore: relax tracer bounds (#11024)
1 parent 2f7e57a commit 78989e0

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

crates/anvil/src/eth/backend/mem/inspector.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
//! Anvil specific [`revm::Inspector`] implementation
22
33
use crate::eth::macros::node_info;
4-
use alloy_evm::eth::EthEvmContext;
54
use alloy_primitives::{Address, Log, U256};
65
use foundry_evm::{
7-
backend::DatabaseError,
86
call_inspectors,
97
decode::decode_console_logs,
108
inspectors::{LogCollector, TracingInspector},
@@ -13,7 +11,7 @@ use foundry_evm::{
1311
},
1412
};
1513
use revm::{
16-
Database, Inspector,
14+
Inspector,
1715
context::ContextTr,
1816
inspector::JournalExt,
1917
interpreter::{
@@ -108,11 +106,9 @@ fn print_traces(tracer: TracingInspector) {
108106
node_info!("{}", render_trace_arena_inner(&traces, false, true));
109107
}
110108

111-
impl<CTX, D> Inspector<CTX, EthInterpreter> for AnvilInspector
109+
impl<CTX> Inspector<CTX, EthInterpreter> for AnvilInspector
112110
where
113-
D: Database<Error = DatabaseError>,
114-
CTX: ContextTr<Db = D>,
115-
CTX::Journal: JournalExt,
111+
CTX: ContextTr<Journal: JournalExt>,
116112
{
117113
fn initialize_interp(&mut self, interp: &mut Interpreter, ecx: &mut CTX) {
118114
call_inspectors!([&mut self.tracer], |inspector| {
@@ -172,7 +168,7 @@ where
172168
#[inline]
173169
fn selfdestruct(&mut self, contract: Address, target: Address, value: U256) {
174170
if let Some(tracer) = &mut self.tracer {
175-
Inspector::<EthEvmContext<D>>::selfdestruct(tracer, contract, target, value);
171+
<TracingInspector as Inspector<CTX>>::selfdestruct(tracer, contract, target, value);
176172
}
177173
}
178174
}

crates/evm/evm/src/inspectors/logs.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
use alloy_primitives::Log;
22
use alloy_sol_types::{SolEvent, SolInterface, SolValue};
33
use foundry_common::{ErrorExt, fmt::ConsoleFmt};
4-
use foundry_evm_core::{
5-
InspectorExt, abi::console, backend::DatabaseError, constants::HARDHAT_CONSOLE_ADDRESS,
6-
};
4+
use foundry_evm_core::{InspectorExt, abi::console, constants::HARDHAT_CONSOLE_ADDRESS};
75
use revm::{
8-
Database, Inspector,
6+
Inspector,
97
context::ContextTr,
10-
inspector::JournalExt,
118
interpreter::{
129
CallInputs, CallOutcome, Gas, InstructionResult, Interpreter, InterpreterResult,
1310
interpreter::EthInterpreter,
@@ -27,7 +24,7 @@ impl LogCollector {
2724
#[cold]
2825
fn do_hardhat_log<CTX>(&mut self, context: &mut CTX, inputs: &CallInputs) -> Option<CallOutcome>
2926
where
30-
CTX: ContextTr<Db: Database<Error = DatabaseError>, Journal: JournalExt>,
27+
CTX: ContextTr,
3128
{
3229
if let Err(err) = self.hardhat_log(&inputs.input.bytes(context)) {
3330
let result = InstructionResult::Revert;
@@ -47,11 +44,9 @@ impl LogCollector {
4744
}
4845
}
4946

50-
impl<CTX, D> Inspector<CTX, EthInterpreter> for LogCollector
47+
impl<CTX> Inspector<CTX, EthInterpreter> for LogCollector
5148
where
52-
D: Database<Error = DatabaseError>,
53-
CTX: ContextTr<Db = D>,
54-
CTX::Journal: JournalExt,
49+
CTX: ContextTr,
5550
{
5651
fn log(&mut self, _interp: &mut Interpreter, _context: &mut CTX, log: Log) {
5752
self.logs.push(log);

0 commit comments

Comments
 (0)