From e74d6324f74ba7dcdca61364d56bc3241dcd514c Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Mon, 11 Mar 2024 19:09:40 +0400 Subject: [PATCH] fix: ci (#7363) * fix: ci * fmt --- crates/forge/bin/cmd/test/mod.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/forge/bin/cmd/test/mod.rs b/crates/forge/bin/cmd/test/mod.rs index 1cea3b818fe0..11ae1aee77e3 100644 --- a/crates/forge/bin/cmd/test/mod.rs +++ b/crates/forge/bin/cmd/test/mod.rs @@ -299,9 +299,12 @@ impl TestArgs { // Set up trace identifiers. let known_contracts = runner.known_contracts.clone(); let remote_chain_id = runner.evm_opts.get_remote_chain_id(); - let mut identifier = TraceIdentifiers::new() - .with_local(&known_contracts) - .with_etherscan(&config, remote_chain_id)?; + let mut identifier = TraceIdentifiers::new().with_local(&known_contracts); + + // Avoid using etherscan for gas report as we decode more traces and this will be expensive. + if !self.gas_report { + identifier = identifier.with_etherscan(&config, remote_chain_id)?; + } // Run tests. let (tx, rx) = channel::<(String, SuiteResult)>(); @@ -424,12 +427,12 @@ impl TestArgs { // setUp and constructor. for (kind, arena) in &result.traces { if !matches!(kind, TraceKind::Execution) { - decoder.identify(arena, &mut local_identifier); + decoder.identify(arena, &mut identifier); } } for arena in trace { - decoder.identify(arena, &mut local_identifier); + decoder.identify(arena, &mut identifier); gas_report.analyze([arena], &decoder).await; } }