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) : trace_filter test #5293

Merged
merged 1 commit into from
Nov 6, 2023
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
31 changes: 31 additions & 0 deletions crates/rpc/rpc-testing-util/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: Stream>(_: &St) {}
Expand Down Expand Up @@ -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);
}
}
}
}
}
Loading