-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into elfedy-bh-default
- Loading branch information
Showing
21 changed files
with
668 additions
and
138 deletions.
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
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
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
//! Forge tests for basic zkysnc functionality. | ||
use crate::{config::*, test_helpers::TEST_DATA_DEFAULT}; | ||
use forge::revm::primitives::SpecId; | ||
use foundry_test_utils::Filter; | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_block_information_is_consistent() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = | ||
Filter::new("testZkBasicBlockNumber|testZkBasicBlockTimestamp", "ZkBasicTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_address_balance_is_consistent() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkBasicAddressBalance", "ZkBasicTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_propagated_block_env_is_consistent() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new( | ||
"testZkPropagatedBlockEnv|testZkBasicBlockBaseFee|testZkBlockHashWithNewerBlocks", | ||
"ZkBasicTest", | ||
".*", | ||
); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} |
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,92 @@ | ||
//! Forge tests for cheatcodes. | ||
use crate::{config::*, test_helpers::TEST_DATA_DEFAULT}; | ||
use forge::revm::primitives::SpecId; | ||
use foundry_config::fs_permissions::PathPermission; | ||
use foundry_test_utils::Filter; | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_roll_works() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkCheatcodesRoll", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_warp_works() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkCheatcodesWarp", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_deal_works() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkCheatcodesDeal", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_set_nonce_works() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkCheatcodesSetNonce", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_etch_works() { | ||
let mut zk_config = TEST_DATA_DEFAULT.zk_test_data.zk_config.clone(); | ||
zk_config.fs_permissions.add(PathPermission::read_write("./zk/zkout/ConstantNumber.sol")); | ||
let runner = TEST_DATA_DEFAULT.runner_with_zksync_config(zk_config); | ||
let filter = Filter::new("testZkCheatcodesEtch", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_record_works() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testRecord", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_expect_emit_works() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testExpectEmit|testExpectEmitOnCreate", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_mock_with_value_function() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkCheatcodesValueFunctionMockReturn", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_mock_calls() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new( | ||
"testZkCheatcodesCanMockCallTestContract|testZkCheatcodesCanMockCall", | ||
"ZkCheatcodesTest", | ||
".*", | ||
); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test_zk_cheat_works_after_fork() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = Filter::new("testZkCheatcodesCanBeUsedAfterFork", "ZkCheatcodesTest", ".*"); | ||
|
||
TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await; | ||
} |
Oops, something went wrong.