-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(zk): Add setup fork failure test (#521)
add setup fork failure with testFail Co-authored-by: Jrigada <[email protected]>
- Loading branch information
Showing
3 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! Fork tests. | ||
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_setup_fork_failure() { | ||
let runner = TEST_DATA_DEFAULT.runner_zksync(); | ||
let filter = | ||
Filter::new("testFail_ZkSetupForkFailureExecutesTest", "ZkSetupForkFailureTest", ".*"); | ||
|
||
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ mod basic; | |
mod cheats; | ||
mod contracts; | ||
mod factory; | ||
mod fork; | ||
mod fuzz; | ||
mod invariant; | ||
mod logs; | ||
|
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,19 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import "ds-test/test.sol"; | ||
import "../cheats/Vm.sol"; | ||
|
||
contract ZkSetupForkFailureTest is DSTest { | ||
Vm constant vm = Vm(HEVM_ADDRESS); | ||
uint256 constant ETH_FORK_BLOCK = 18993187; | ||
|
||
function setUp() public { | ||
vm.createSelectFork("https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf", ETH_FORK_BLOCK); // trufflehog:ignore | ||
} | ||
|
||
// We test that the following function is called after EVM fork from zk context | ||
function testFail_ZkSetupForkFailureExecutesTest() public pure { | ||
assert(false); | ||
} | ||
} |