Skip to content

Commit 959c713

Browse files
committed
fix: config revert diag with fn tracing()
1 parent 832c2ac commit 959c713

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

crates/evm/evm/src/inspectors/stack.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ impl InspectorStackBuilder {
205205
stack.collect_logs(logs.unwrap_or(true));
206206
stack.print(print.unwrap_or(false));
207207
stack.tracing(trace_mode);
208-
stack.revert_diagnostic(!trace_mode.is_none());
209208

210209
stack.enable_isolation(enable_isolation);
211210
stack.odyssey(odyssey);
@@ -436,8 +435,15 @@ impl InspectorStack {
436435
}
437436

438437
/// Set whether to enable the tracer.
438+
/// Revert diagnostic inspector is activated when `mode != TraceMode::None`
439439
#[inline]
440440
pub fn tracing(&mut self, mode: TraceMode) {
441+
if mode.is_none() {
442+
self.revert_diag = None;
443+
} else {
444+
self.revert_diag = Some(RevertDiagnostic::default());
445+
}
446+
441447
if let Some(config) = mode.into_config() {
442448
*self.tracer.get_or_insert_with(Default::default).config_mut() = config;
443449
} else {
@@ -452,12 +458,6 @@ impl InspectorStack {
452458
script_address;
453459
}
454460

455-
/// Set the revert diagnostic inspector.
456-
#[inline]
457-
pub fn revert_diagnostic(&mut self, yes: bool) {
458-
self.revert_diag = yes.then(RevertDiagnostic::default)
459-
}
460-
461461
/// Collects all the data gathered during inspection into a single struct.
462462
#[inline]
463463
pub fn collect(self) -> InspectorData {

crates/forge/src/multi_runner.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ impl TestRunnerConfig {
332332
inspector.collect_coverage(self.coverage);
333333
inspector.enable_isolation(self.isolation);
334334
inspector.odyssey(self.odyssey);
335-
inspector.revert_diagnostic(true);
336335
// inspector.set_create2_deployer(self.evm_opts.create2_deployer);
337336

338337
// executor.env_mut().clone_from(&self.env);

0 commit comments

Comments
 (0)