From 3225ad693f052a4dce5045850453669c1d0ae5f9 Mon Sep 17 00:00:00 2001 From: iain nash Date: Fri, 22 Sep 2023 13:06:58 -0400 Subject: [PATCH] update and split up fork tests --- .github/workflows/test_fork.yml | 2 +- test/ZoraNFTCreatorV1_Fork.t.sol | 31 ++++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_fork.yml b/.github/workflows/test_fork.yml index 6aae877..c6f58a0 100644 --- a/.github/workflows/test_fork.yml +++ b/.github/workflows/test_fork.yml @@ -33,7 +33,7 @@ jobs: - name: Run fork tests run: | - forge test -vvv --match-test fork + forge test -vvv --match-test Fork env: FORK_TEST_CHAINS: mainnet,goerli,optimism,optimism_goerli,zora,zora_goerli,base_goerli,base # ,pgn_sepolia,pgn ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }} diff --git a/test/ZoraNFTCreatorV1_Fork.t.sol b/test/ZoraNFTCreatorV1_Fork.t.sol index a2aa1f2..8124c0e 100644 --- a/test/ZoraNFTCreatorV1_Fork.t.sol +++ b/test/ZoraNFTCreatorV1_Fork.t.sol @@ -25,7 +25,8 @@ contract ZoraNFTCreatorV1Test is Test, ForkHelper { DropMetadataRenderer public dropMetadataRenderer; function makeDefaultSalesConfiguration(uint104 price) internal returns (IERC721Drop.SalesConfiguration memory) { - return IERC721Drop.SalesConfiguration({ + return + IERC721Drop.SalesConfiguration({ publicSaleStart: 0, publicSaleEnd: type(uint64).max, presaleStart: 0, @@ -36,7 +37,7 @@ contract ZoraNFTCreatorV1Test is Test, ForkHelper { }); } - function test_create_fork() external { + function testForkEdition() external { string[] memory forkTestChains = getForkTestChains(); for (uint256 i = 0; i < forkTestChains.length; i++) { @@ -46,7 +47,31 @@ contract ZoraNFTCreatorV1Test is Test, ForkHelper { creator = ZoraNFTCreatorV1(getDeployment().factory); verifyAddressesFork(chainName); forkEdition(); + } + } + + function testForkDrop() external { + string[] memory forkTestChains = getForkTestChains(); + + for (uint256 i = 0; i < forkTestChains.length; i++) { + string memory chainName = forkTestChains[i]; + + vm.createSelectFork(vm.rpcUrl(chainName)); + creator = ZoraNFTCreatorV1(getDeployment().factory); + verifyAddressesFork(chainName); forkDrop(); + } + } + + function testForkDropGeneric() external { + string[] memory forkTestChains = getForkTestChains(); + + for (uint256 i = 0; i < forkTestChains.length; i++) { + string memory chainName = forkTestChains[i]; + + vm.createSelectFork(vm.rpcUrl(chainName)); + creator = ZoraNFTCreatorV1(getDeployment().factory); + verifyAddressesFork(chainName); forkDropGeneric(); } } @@ -96,7 +121,7 @@ contract ZoraNFTCreatorV1Test is Test, ForkHelper { 500, DEFAULT_FUNDS_RECIPIENT_ADDRESS, DEFAULT_FUNDS_RECIPIENT_ADDRESS, - makeDefaultSalesConfiguration(0.1 ether), + makeDefaultSalesConfiguration(0.1 ether), "desc", "animation", "image"