From 6af63eb6b653eeaf35da174823c11e8553f762a1 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Mon, 11 Mar 2024 18:53:40 +0400 Subject: [PATCH 1/2] fix: ci --- crates/forge/bin/cmd/test/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/forge/bin/cmd/test/mod.rs b/crates/forge/bin/cmd/test/mod.rs index 1cea3b818fe0..8e1d958866ee 100644 --- a/crates/forge/bin/cmd/test/mod.rs +++ b/crates/forge/bin/cmd/test/mod.rs @@ -300,8 +300,12 @@ impl TestArgs { 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)?; + .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 +428,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; } } From 661c0a050f4f604840be6dfd0db08aa36b2b0856 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Mon, 11 Mar 2024 18:54:34 +0400 Subject: [PATCH 2/2] fmt --- crates/forge/bin/cmd/test/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/forge/bin/cmd/test/mod.rs b/crates/forge/bin/cmd/test/mod.rs index 8e1d958866ee..11ae1aee77e3 100644 --- a/crates/forge/bin/cmd/test/mod.rs +++ b/crates/forge/bin/cmd/test/mod.rs @@ -299,8 +299,7 @@ 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); + 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 {