From 9ea957dc2541b6b9aaadc53aca7cc295127383f4 Mon Sep 17 00:00:00 2001 From: DoTheBestToGetTheBest <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Sat, 4 Nov 2023 10:06:34 -0700 Subject: [PATCH 1/2] Update trace.rs --- crates/rpc/rpc-testing-util/tests/it/trace.rs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/crates/rpc/rpc-testing-util/tests/it/trace.rs b/crates/rpc/rpc-testing-util/tests/it/trace.rs index eb83913f088b..d513cedf0f2e 100644 --- a/crates/rpc/rpc-testing-util/tests/it/trace.rs +++ b/crates/rpc/rpc-testing-util/tests/it/trace.rs @@ -1,7 +1,7 @@ use futures::StreamExt; use jsonrpsee::http_client::HttpClientBuilder; use reth_rpc_api_testing_util::{trace::TraceApiExt, utils::parse_env_url}; -use reth_rpc_types::trace::parity::TraceType; +use reth_rpc_types::trace::{filter::TraceFilter, parity::TraceType}; use std::{collections::HashSet, time::Instant}; /// This is intended to be run locally against a running node. /// @@ -45,3 +45,25 @@ async fn replay_transactions() { println!("Replayed transactions in {:?}", now.elapsed()); } } + +/// Tests the tracers filters on a local Ethereum node. + +#[tokio::test(flavor = "multi_thread")] +#[ignore] +async fn trace_filters() { + // Parse the node URL from environment variable and create an HTTP client. + let url = parse_env_url("RETH_RPC_TEST_NODE_URL").unwrap(); + let client = HttpClientBuilder::default().build(url).unwrap(); + + // Set up trace filters. + let filter = TraceFilter::default(); + let filters = vec![filter]; + + // Initialize a stream for the trace filters. + let mut stream = client.trace_filter_stream(filters); + let start_time = Instant::now(); + while let Some(trace) = stream.next().await { + println!("Transaction Trace: {:?}", trace); + println!("Duration since test start: {:?}", start_time.elapsed()); + } +} From 19b22c7b20f2fa1fe8423483cba5d1044d93132c Mon Sep 17 00:00:00 2001 From: DoTheBestToGetTheBest <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Sun, 5 Nov 2023 06:12:32 -0800 Subject: [PATCH 2/2] Update trace.rs --- crates/rpc/rpc-testing-util/tests/it/trace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rpc/rpc-testing-util/tests/it/trace.rs b/crates/rpc/rpc-testing-util/tests/it/trace.rs index d513cedf0f2e..f3d4ee7e7b3c 100644 --- a/crates/rpc/rpc-testing-util/tests/it/trace.rs +++ b/crates/rpc/rpc-testing-util/tests/it/trace.rs @@ -46,7 +46,7 @@ async fn replay_transactions() { } } -/// Tests the tracers filters on a local Ethereum node. +/// Tests the tracers filters on a local Ethereum node #[tokio::test(flavor = "multi_thread")] #[ignore]