Skip to content

Commit

Permalink
chore: don't decode traces if they're not going to be included
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Feb 12, 2024
1 parent 74b12ee commit 694945a
Showing 1 changed file with 7 additions and 6 deletions.
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

0 comments on commit 694945a

Please sign in to comment.