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

chore: don't decode traces if they're not going to be included #7093

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 7 additions & 6 deletions crates/forge/bin/cmd/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,6 @@ impl TestArgs {
// Decode the traces
let mut decoded_traces = Vec::with_capacity(result.traces.len());
for (kind, arena) in &mut result.traces {
decoder.identify(arena, &mut local_identifier);
decoder.identify(arena, &mut etherscan_identifier);

// verbosity:
// - 0..3: nothing
// - 3: only display traces for failed tests
Expand All @@ -433,10 +430,14 @@ impl TestArgs {
}
TraceKind::Deployment => false,
};

if should_include {
decoded_traces.push(render_trace_arena(arena, &decoder).await?);
if !should_include {
continue;
}

decoder.identify(arena, &mut local_identifier);
decoder.identify(arena, &mut etherscan_identifier);

decoded_traces.push(render_trace_arena(arena, &decoder).await?);
}

if !decoded_traces.is_empty() {
Expand Down
Loading