From d090803eb808ccd285ac0f034a641519a4245f5a Mon Sep 17 00:00:00 2001 From: DoTheBestToGetTheBest <146037313+DoTheBestToGetTheBest@users.noreply.github.com> Date: Mon, 6 Nov 2023 04:45:45 -0800 Subject: [PATCH] feat(rpc-testing-utils) : trace_filter test (#5293) --- crates/rpc/rpc-testing-util/src/trace.rs | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/crates/rpc/rpc-testing-util/src/trace.rs b/crates/rpc/rpc-testing-util/src/trace.rs index 575383b66f4b..9b6133e6e4b2 100644 --- a/crates/rpc/rpc-testing-util/src/trace.rs +++ b/crates/rpc/rpc-testing-util/src/trace.rs @@ -361,6 +361,7 @@ mod tests { use super::*; use jsonrpsee::http_client::HttpClientBuilder; use reth_primitives::BlockNumberOrTag; + use reth_rpc_types::trace::filter::TraceFilterMode; use std::collections::HashSet; fn assert_is_stream(_: &St) {} @@ -459,4 +460,34 @@ mod tests { } } } + + #[tokio::test] + #[ignore] + async fn can_create_trace_filter() { + let client = HttpClientBuilder::default().build("http://localhost:8545").unwrap(); + + let filter = TraceFilter { + from_block: None, + to_block: None, + from_address: Vec::new(), + to_address: Vec::new(), + mode: TraceFilterMode::Union, + after: None, + count: None, + }; + + let filters = vec![filter]; + let mut stream = client.trace_filter_stream(filters); + + while let Some(result) = stream.next().await { + match result { + Ok(trace) => { + println!("Received trace: {:?}", trace); + } + Err(e) => { + println!("Error fetching trace: {:?}", e); + } + } + } + } }