Skip to content

Commit 376bae5

Browse files
authored
feat(forge): add --disable-labels for forge script and test (#11412)
add --disable-labels for forge script and test
1 parent ce40d54 commit 376bae5

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ pub struct TestArgs {
186186
#[arg(long, help_heading = "Display options", requires = "summary")]
187187
pub detailed: bool,
188188

189+
/// Disables the labels in the traces.
190+
#[arg(long, help_heading = "Display options")]
191+
pub disable_labels: bool,
192+
189193
#[command(flatten)]
190194
filter: FilterArgs,
191195

@@ -527,6 +531,7 @@ impl TestArgs {
527531
// Build the trace decoder.
528532
let mut builder = CallTraceDecoderBuilder::new()
529533
.with_known_contracts(&known_contracts)
534+
.with_label_disabled(self.disable_labels)
530535
.with_verbosity(verbosity);
531536
// Signatures are of no value for gas reports.
532537
if !self.gas_report {

crates/script/src/execute.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ impl ExecutedState {
332332
.with_signature_identifier(SignaturesIdentifier::from_config(
333333
&self.script_config.config,
334334
)?)
335+
.with_label_disabled(self.args.disable_labels)
335336
.build();
336337

337338
let mut identifier = TraceIdentifiers::new().with_local(known_contracts).with_etherscan(

crates/script/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ pub struct ScriptArgs {
182182
#[arg(long)]
183183
pub disable_code_size_limit: bool,
184184

185+
/// Disables the labels in the traces.
186+
#[arg(long)]
187+
pub disable_labels: bool,
188+
185189
/// The Etherscan (or equivalent) API key
186190
#[arg(long, env = "ETHERSCAN_API_KEY", value_name = "KEY")]
187191
pub etherscan_api_key: Option<String>,

0 commit comments

Comments
 (0)