Skip to content

Commit 9a2e9ae

Browse files
committed
fix: only identify traces if they should be included
1 parent b2f957a commit 9a2e9ae

File tree

1 file changed

+4
-5
lines changed
  • crates/forge/bin/cmd/test

1 file changed

+4
-5
lines changed

crates/forge/bin/cmd/test/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,6 @@ async fn test(
615615
// Decode the traces
616616
let mut decoded_traces = Vec::with_capacity(result.traces.len());
617617
for (kind, trace) in &mut result.traces {
618-
decoder.identify(trace, &mut local_identifier);
619-
decoder.identify(trace, &mut etherscan_identifier);
620-
621618
// Verbosity levels
622619
// - 3: only display traces for failed tests
623620
// - 4: also display the setup trace for failed tests
@@ -632,9 +629,11 @@ async fn test(
632629
TraceKind::Deployment => false,
633630
};
634631

635-
// We decode the trace if we either need to build a gas report or we need
636-
// to print it
632+
// We decode the trace if we either need to build a gas report or we need to print
633+
// it
637634
if should_include || gas_reporting {
635+
decoder.identify(trace, &mut local_identifier);
636+
decoder.identify(trace, &mut etherscan_identifier);
638637
decoder.decode(trace).await;
639638
}
640639

0 commit comments

Comments
 (0)