diff --git a/crates/provider/src/ext/trace.rs b/crates/provider/src/ext/trace.rs index 4f9f11e1b5c..90b7598457a 100644 --- a/crates/provider/src/ext/trace.rs +++ b/crates/provider/src/ext/trace.rs @@ -3,8 +3,9 @@ use crate::{Provider, RpcWithBlock}; use alloy_eips::BlockNumberOrTag; use alloy_network::Network; use alloy_primitives::TxHash; -use alloy_rpc_types_trace::parity::{ - LocalizedTransactionTrace, TraceResults, TraceResultsWithTransactionHash, TraceType, +use alloy_rpc_types_trace::{ + filter::TraceFilter, + parity::{LocalizedTransactionTrace, TraceResults, TraceResultsWithTransactionHash, TraceType}, }; use alloy_transport::{Transport, TransportResult}; @@ -56,6 +57,12 @@ where trace_type: &[TraceType], ) -> TransportResult; + /// Traces matching given filter. + async fn trace_filter( + &self, + tracer: &TraceFilter, + ) -> TransportResult>; + /// Trace all transactions in the given block. /// /// # Note @@ -120,6 +127,13 @@ where self.client().request("trace_rawTransaction", (data, trace_type)).await } + async fn trace_filter( + &self, + tracer: &TraceFilter, + ) -> TransportResult> { + self.client().request("trace_filter", (tracer,)).await + } + async fn trace_block( &self, block: BlockNumberOrTag,