From 1aeb53cab3fa7fc20be341f11a3e7fed6af4fa05 Mon Sep 17 00:00:00 2001 From: Dmitry Gusakov Date: Wed, 16 Oct 2024 18:07:20 +0200 Subject: [PATCH] chore: Extend post-vote tests --- Justfile | 4 +++- test/fork/deployment/PostDeployment.t.sol | 10 ++++++++++ test/fork/deployment/Upgradability.sol | 4 ++++ test/helpers/Fixtures.sol | 4 +++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Justfile b/Justfile index 97c01146..c57428ea 100644 --- a/Justfile +++ b/Justfile @@ -60,7 +60,9 @@ test-deployment *args: forge test --match-path 'test/fork/*' --no-match-path='test/fork/voting/*' -vvv {{args}} test-post-voting *args: - forge test --match-path 'test/fork/*' --no-match-path='test/fork/deployment/*' -vvv {{args}} + export POST_VOTE=1 + forge test --match-path 'test/fork/*' -vvv {{args}} + unset POST_VOTE test-invariant *args: forge test --match-path 'test/fork/invariant/*' -vvv {{args}} diff --git a/test/fork/deployment/PostDeployment.t.sol b/test/fork/deployment/PostDeployment.t.sol index 527b096e..f7e1d563 100644 --- a/test/fork/deployment/PostDeployment.t.sol +++ b/test/fork/deployment/PostDeployment.t.sol @@ -106,6 +106,8 @@ contract CSModuleDeploymentTest is Test, Utilities, DeploymentFixtures { } function test_initialState() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); assertTrue(csm.isPaused()); assertFalse(csm.publicRelease()); assertEq(csm.getNodeOperatorsCount(), 0); @@ -249,6 +251,8 @@ contract CSAccountingDeploymentTest is Test, Utilities, DeploymentFixtures { } function test_initialState() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); assertFalse(accounting.isPaused()); assertEq(accounting.totalBondShares(), 0); assertEq( @@ -313,6 +317,8 @@ contract CSFeeDistributorDeploymentTest is Test, Utilities, DeploymentFixtures { } function test_initialState() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); assertEq(feeDistributor.totalClaimableShares(), 0); assertEq(feeDistributor.pendingSharesToDistribute(), 0); assertEq(feeDistributor.treeRoot(), bytes32(0)); @@ -391,6 +397,8 @@ contract CSFeeOracleDeploymentTest is Test, Utilities, DeploymentFixtures { } function test_initialState() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); assertFalse(oracle.isPaused()); ( @@ -498,6 +506,8 @@ contract HashConsensusDeploymentTest is Test, Utilities, DeploymentFixtures { } function test_initialState() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); vm.skip(block.chainid != 1); assertEq(hashConsensus.getQuorum(), deployParams.hashConsensusQuorum); (address[] memory members, ) = hashConsensus.getMembers(); diff --git a/test/fork/deployment/Upgradability.sol b/test/fork/deployment/Upgradability.sol index 8d79c3d4..567f440c 100644 --- a/test/fork/deployment/Upgradability.sol +++ b/test/fork/deployment/Upgradability.sol @@ -37,6 +37,8 @@ contract UpgradabilityTest is Test, Utilities, DeploymentFixtures { } function test_CSModuleUpgradeToAndCall() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); OssifiableProxy proxy = OssifiableProxy(payable(address(csm))); CSModule newModule = new CSModule({ moduleType: "CSMv2", @@ -79,6 +81,8 @@ contract UpgradabilityTest is Test, Utilities, DeploymentFixtures { } function test_CSAccountingUpgradeToAndCall() public { + Env memory env = envVars(); + vm.skip(!_isEmpty(env.POST_VOTE)); OssifiableProxy proxy = OssifiableProxy(payable(address(accounting))); uint256 currentMaxCurveLength = accounting.MAX_CURVE_LENGTH(); CSAccounting newAccounting = new CSAccounting({ diff --git a/test/helpers/Fixtures.sol b/test/helpers/Fixtures.sol index 474c00d7..d712cacc 100644 --- a/test/helpers/Fixtures.sol +++ b/test/helpers/Fixtures.sol @@ -93,6 +93,7 @@ contract DeploymentFixtures is StdCheats, Test { struct Env { string RPC_URL; string DEPLOY_CONFIG; + string POST_VOTE; } struct DeploymentConfig { @@ -111,7 +112,8 @@ contract DeploymentFixtures is StdCheats, Test { function envVars() public returns (Env memory) { Env memory env = Env( vm.envOr("RPC_URL", string("")), - vm.envOr("DEPLOY_CONFIG", string("")) + vm.envOr("DEPLOY_CONFIG", string("")), + vm.envOr("POST_VOTE", string("")) ); vm.skip(_isEmpty(env.RPC_URL)); vm.skip(_isEmpty(env.DEPLOY_CONFIG));