From e1a9cc313740aea28f2ff2fe98d364249953eec4 Mon Sep 17 00:00:00 2001 From: tesseract <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:20:50 -0700 Subject: [PATCH 1/5] Update trait.rs --- crates/provider/src/provider/trait.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/provider/src/provider/trait.rs b/crates/provider/src/provider/trait.rs index d7f641b5b46..60b4765aa17 100644 --- a/crates/provider/src/provider/trait.rs +++ b/crates/provider/src/provider/trait.rs @@ -464,6 +464,14 @@ pub trait Provider: self.client().request("eth_getFilterChanges", (id,)).await } + /// Traces matching given filter. + async fn trace_filter( + &self, + tracer: TraceFilter, + ) -> TransportResult> { + self.client().request("trace_filter", (tracer,)).await + } + /// Get a list of values that have been added since the last poll. /// /// This returns an enum over all possible return values. You probably want to use From 82b07824b9653201f7ca8fc85ca0aebb8e874ed4 Mon Sep 17 00:00:00 2001 From: tesseract <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:12:49 -0700 Subject: [PATCH 2/5] Update trait.rs --- crates/provider/src/provider/trait.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crates/provider/src/provider/trait.rs b/crates/provider/src/provider/trait.rs index 60b4765aa17..d7f641b5b46 100644 --- a/crates/provider/src/provider/trait.rs +++ b/crates/provider/src/provider/trait.rs @@ -464,14 +464,6 @@ pub trait Provider: self.client().request("eth_getFilterChanges", (id,)).await } - /// Traces matching given filter. - async fn trace_filter( - &self, - tracer: TraceFilter, - ) -> TransportResult> { - self.client().request("trace_filter", (tracer,)).await - } - /// Get a list of values that have been added since the last poll. /// /// This returns an enum over all possible return values. You probably want to use From b45195875efc0f84685916f20f96a2e6c393ba86 Mon Sep 17 00:00:00 2001 From: tesseract <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:13:09 -0700 Subject: [PATCH 3/5] Update trace.rs --- crates/provider/src/ext/trace.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/provider/src/ext/trace.rs b/crates/provider/src/ext/trace.rs index 4f9f11e1b5c..cf5e12cd174 100644 --- a/crates/provider/src/ext/trace.rs +++ b/crates/provider/src/ext/trace.rs @@ -56,6 +56,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 @@ -112,6 +118,13 @@ where self.client().request("trace_transaction", (hash,)).await } + async fn trace_filter( + &self, + tracer: TraceFilter, + ) -> TransportResult> { + self.client().request("trace_filter", (tracer,)).await + } + async fn trace_raw_transaction( &self, data: &[u8], From 9d2e31ac9070777c6f0f4ca6c9a4bf739ff95ab2 Mon Sep 17 00:00:00 2001 From: tesseract <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:19:53 -0700 Subject: [PATCH 4/5] Update trace.rs --- crates/provider/src/ext/trace.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/provider/src/ext/trace.rs b/crates/provider/src/ext/trace.rs index cf5e12cd174..106c5e5e331 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}; From cbe13a45e83f5be71b4eea93d50ce78b41ae589c Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 20 Jun 2024 00:45:10 +0200 Subject: [PATCH 5/5] use ref --- crates/provider/src/ext/trace.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/provider/src/ext/trace.rs b/crates/provider/src/ext/trace.rs index 106c5e5e331..90b7598457a 100644 --- a/crates/provider/src/ext/trace.rs +++ b/crates/provider/src/ext/trace.rs @@ -60,7 +60,7 @@ where /// Traces matching given filter. async fn trace_filter( &self, - tracer: TraceFilter, + tracer: &TraceFilter, ) -> TransportResult>; /// Trace all transactions in the given block. @@ -119,13 +119,6 @@ where self.client().request("trace_transaction", (hash,)).await } - async fn trace_filter( - &self, - tracer: TraceFilter, - ) -> TransportResult> { - self.client().request("trace_filter", (tracer,)).await - } - async fn trace_raw_transaction( &self, data: &[u8], @@ -134,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,