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): support test block for trace_call_many #5258

Merged
merged 3 commits into from
Oct 31, 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
27 changes: 27 additions & 0 deletions crates/rpc/rpc-testing-util/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ mod tests {
use super::*;
use jsonrpsee::http_client::HttpClientBuilder;
use reth_primitives::BlockNumberOrTag;
use std::collections::HashSet;

fn assert_is_stream<St: Stream>(_: &St) {}

Expand Down Expand Up @@ -319,4 +320,30 @@ mod tests {
println!("Total successes: {}", successes);
println!("Total failures: {}", failures);
}

#[tokio::test]
DoTheBestToGetTheBest marked this conversation as resolved.
Show resolved Hide resolved
#[ignore]
async fn can_create_trace_call_many_stream() {
let client = HttpClientBuilder::default().build("http://localhost:8545").unwrap();

let call_request_1 = CallRequest::default();
let call_request_2 = CallRequest::default();
let trace_types = HashSet::from([TraceType::StateDiff, TraceType::VmTrace]);
let calls = vec![(call_request_1, trace_types.clone()), (call_request_2, trace_types)];

let mut stream = client.trace_call_many_stream(calls, None);

assert_is_stream(&stream);

while let Some(result) = stream.next().await {
match result {
Ok(trace_result) => {
println!("Success: {:?}", trace_result);
}
Err(error) => {
println!("Error: {:?}", error);
}
}
}
}
}
Loading