-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #727 from matter-labs/elfedy-fix-wallet-script
fix: compute stored test address after setting the tx nonce on scripts
- Loading branch information
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"baf20aa15d09d4ba2fea20a4f45f3b74"},"ciphertext":"19cbaecaf374fcab41fa5899990b904441e0762899ef3727a5a667398db8b7d8","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"625b00531450f22ae8f74c9df7582150158fe6a88d9a214d61ec80a328e0601a"},"mac":"1c6f106535db170ab8c838abc6c33f019e35663808812f2c793bb00fd23e4baa"},"id":"f651e741-d76b-4583-b5f2-3ca0b4a697a2","version":3} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ mod ownership; | |
mod paymaster; | ||
mod proxy; | ||
mod repros; | ||
mod script; | ||
mod traces; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
use foundry_test_utils::{ | ||
forgetest_async, | ||
util::{self, OutputExt}, | ||
ZkSyncNode, | ||
}; | ||
use std::path::Path; | ||
|
||
forgetest_async!(test_zk_can_broadcast_with_keystore_account, |prj, cmd| { | ||
util::initialize(prj.root()); | ||
prj.add_script("Deploy.s.sol", include_str!("../../fixtures/zk/Deploy.s.sol")).unwrap(); | ||
prj.add_source("Greeter.sol", include_str!("../../../../../testdata/zk/Greeter.sol")).unwrap(); | ||
|
||
let node = ZkSyncNode::start(); | ||
let url = node.url(); | ||
|
||
cmd.forge_fuse(); | ||
|
||
let script_path_contract = "./script/Deploy.s.sol:DeployScript"; | ||
let keystore_path = | ||
Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/zk/test_zksync_keystore"); | ||
|
||
let script_args = vec![ | ||
"--zk-startup", | ||
&script_path_contract, | ||
"--broadcast", | ||
"--keystores", | ||
keystore_path.to_str().unwrap(), | ||
"--password", | ||
"password", | ||
"--chain", | ||
"260", | ||
"--gas-estimate-multiplier", | ||
"310", | ||
"--rpc-url", | ||
url.as_str(), | ||
"--slow", | ||
]; | ||
|
||
cmd.arg("script").args(&script_args); | ||
|
||
cmd.assert_success() | ||
.get_output() | ||
.stdout_lossy() | ||
.contains("ONCHAIN EXECUTION COMPLETE & SUCCESSFUL"); | ||
|
||
let run_latest = foundry_common::fs::json_files(prj.root().join("broadcast").as_path()) | ||
.find(|file| file.ends_with("run-latest.json")) | ||
.expect("No broadcast artifacts"); | ||
|
||
let content = foundry_common::fs::read_to_string(run_latest).unwrap(); | ||
|
||
let json: serde_json::Value = serde_json::from_str(&content).unwrap(); | ||
assert_eq!(json["transactions"].as_array().expect("broadcastable txs").len(), 3); | ||
cmd.forge_fuse(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters