From 02cb1c038a4a75e10f846fdd0d8412e02039c4ec Mon Sep 17 00:00:00 2001 From: joshieDo <93316087+joshieDo@users.noreply.github.com> Date: Mon, 26 Dec 2022 18:48:58 +0800 Subject: [PATCH] remove fs_commit_changed logic from script (#3960) --- cli/src/cmd/forge/script/runner.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cli/src/cmd/forge/script/runner.rs b/cli/src/cmd/forge/script/runner.rs index b7619e04d66b..024871f57422 100644 --- a/cli/src/cmd/forge/script/runner.rs +++ b/cli/src/cmd/forge/script/runner.rs @@ -267,15 +267,6 @@ impl ScriptRunner { value: U256, commit: bool, ) -> eyre::Result { - let fs_commit_changed = - if let Some(ref mut cheatcodes) = self.executor.inspector_config_mut().cheatcodes { - let original_fs_commit = cheatcodes.fs_commit; - cheatcodes.fs_commit = false; - original_fs_commit != cheatcodes.fs_commit - } else { - false - }; - let mut res = self.executor.call_raw(from, to, calldata.0.clone(), value)?; let mut gas_used = res.gas_used; @@ -286,15 +277,6 @@ impl ScriptRunner { // Otherwise don't re-execute, or some usecases might be broken: https://github.com/foundry-rs/foundry/issues/3921 if commit { gas_used = self.search_optimal_gas_usage(&res, from, to, &calldata, value)?; - - // if we changed `fs_commit` during gas limit search, re-execute the call with original - // value - if fs_commit_changed { - if let Some(ref mut cheatcodes) = self.executor.inspector_config_mut().cheatcodes { - cheatcodes.fs_commit = !cheatcodes.fs_commit; - } - } - res = self.executor.call_raw_committing(from, to, calldata.0, value)?; }