Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (rpc-testing-utils) : enhenced trace filter streaming for local node #5295

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion crates/rpc/rpc-testing-util/tests/it/trace.rs
Original file line number Diff line number Diff line change
@@ -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.
///
Expand Down Expand Up @@ -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());
}
}
Loading