diff --git a/crates/evm/evm/src/executors/mod.rs b/crates/evm/evm/src/executors/mod.rs index ab52eac09..edba83619 100644 --- a/crates/evm/evm/src/executors/mod.rs +++ b/crates/evm/evm/src/executors/mod.rs @@ -254,6 +254,7 @@ impl Executor { #[inline] pub fn set_transaction_other_fields(&mut self, other_fields: OtherFields) { + println!("SET CONTEXT"); self.strategy .try_lock() .expect("failed acquiring strategy") @@ -450,11 +451,6 @@ impl Executor { } /// Execute the transaction configured in `env.tx`. - /// - /// Executes the configured transaction of the `env` without committing state changes - /// - /// Note: in case there are any cheatcodes executed that modify the environment, this will - /// update the given `env` with the new values. #[instrument(name = "transact", level = "debug", skip_all)] pub fn transact_with_env(&mut self, mut env: EnvWithHandlerCfg) -> eyre::Result { let mut inspector = self.inspector.clone(); diff --git a/crates/evm/evm/src/executors/strategy.rs b/crates/evm/evm/src/executors/strategy.rs index 7aaa155ba..63c5c3df4 100644 --- a/crates/evm/evm/src/executors/strategy.rs +++ b/crates/evm/evm/src/executors/strategy.rs @@ -42,7 +42,7 @@ pub trait ExecutorStrategy: Debug + Send + Sync { fn set_inspect_context(&mut self, other_fields: OtherFields); fn call_inspect( - &mut self, + &self, db: &mut dyn DatabaseExt, env: &mut EnvWithHandlerCfg, inspector: &mut dyn InspectorExt, @@ -85,7 +85,7 @@ impl ExecutorStrategy for EvmExecutorStrategy { /// Note: in case there are any cheatcodes executed that modify the environment, this will /// update the given `env` with the new values. fn call_inspect( - &mut self, + &self, db: &mut dyn DatabaseExt, env: &mut EnvWithHandlerCfg, inspector: &mut dyn InspectorExt, @@ -100,6 +100,7 @@ impl ExecutorStrategy for EvmExecutorStrategy { } /// Executes the configured test call of the `env` without committing state changes. + /// Modifications to the state are however allowed. /// /// Note: in case there are any cheatcodes executed that modify the environment, this will /// update the given `env` with the new values. diff --git a/crates/script/src/broadcast.rs b/crates/script/src/broadcast.rs index 3171baaba..8cef8bca3 100644 --- a/crates/script/src/broadcast.rs +++ b/crates/script/src/broadcast.rs @@ -77,6 +77,7 @@ pub async fn send_transaction( } else { None }; + println!("ZK_TX {zk_tx_meta:#?}"); if let SendTransactionKind::Raw(tx, _) | SendTransactionKind::Unlocked(tx) = &mut kind { if sequential_broadcast { diff --git a/crates/script/src/runner.rs b/crates/script/src/runner.rs index 2aa586bee..a0f1436ff 100644 --- a/crates/script/src/runner.rs +++ b/crates/script/src/runner.rs @@ -260,6 +260,7 @@ impl ScriptRunner { authorization_list: Option>, other_fields: Option, ) -> Result { + println!("others {:?}", other_fields); if let Some(other_fields) = other_fields { self.executor.set_transaction_other_fields(other_fields); } diff --git a/crates/strategy/zksync/src/executor.rs b/crates/strategy/zksync/src/executor.rs index 954655e15..2766fe298 100644 --- a/crates/strategy/zksync/src/executor.rs +++ b/crates/strategy/zksync/src/executor.rs @@ -87,17 +87,17 @@ impl ExecutorStrategy for ZksyncExecutorStrategy { } fn call_inspect( - &mut self, + &self, db: &mut dyn DatabaseExt, env: &mut EnvWithHandlerCfg, inspector: &mut dyn InspectorExt, ) -> eyre::Result { - match self.inspect_context.take() { + match self.inspect_context.as_ref() { None => self.evm.call_inspect(db, env, inspector), Some(zk_tx) => foundry_zksync_core::vm::transact( - Some(&mut self.persisted_factory_deps), - Some(zk_tx.factory_deps), - zk_tx.paymaster_data, + Some(&mut self.persisted_factory_deps.clone()), + Some(zk_tx.factory_deps.clone()), + zk_tx.paymaster_data.clone(), env, db, ), diff --git a/crates/test-utils/src/util.rs b/crates/test-utils/src/util.rs index 8d7f6cbb5..e7ff4293b 100644 --- a/crates/test-utils/src/util.rs +++ b/crates/test-utils/src/util.rs @@ -881,6 +881,8 @@ impl TestCommand { #[track_caller] pub fn assert(&mut self) -> OutputAssert { let assert = OutputAssert::new(self.execute()); + + std::thread::sleep(std::time::Duration::new(60, 0)); if self.redact_output { return assert.with_assert(test_assert()); };