Skip to content

Commit

Permalink
chore: Extend post-vote tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dgusakov committed Oct 16, 2024
1 parent 51e1406 commit 1aeb53c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
10 changes: 10 additions & 0 deletions test/fork/deployment/PostDeployment.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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());

(
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions test/fork/deployment/Upgradability.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 3 additions & 1 deletion test/helpers/Fixtures.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ contract DeploymentFixtures is StdCheats, Test {
struct Env {
string RPC_URL;
string DEPLOY_CONFIG;
string POST_VOTE;
}

struct DeploymentConfig {
Expand All @@ -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));
Expand Down

0 comments on commit 1aeb53c

Please sign in to comment.