-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Extend post-vote tests (#356)
- Loading branch information
Showing
4 changed files
with
87 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.8.24; | ||
|
||
import "forge-std/Test.sol"; | ||
|
||
import { Utilities } from "../../helpers/Utilities.sol"; | ||
import { DeploymentFixtures } from "../../helpers/Fixtures.sol"; | ||
import { DeployParams } from "../../../script/DeployBase.s.sol"; | ||
import { HashConsensus } from "../../../src/lib/base-oracle/HashConsensus.sol"; | ||
import { BaseOracle } from "../../../src/lib/base-oracle/BaseOracle.sol"; | ||
import { Slot } from "../../../src/lib/Types.sol"; | ||
|
||
contract ContractsInitialStateTest is Test, Utilities, DeploymentFixtures { | ||
DeployParams private deployParams; | ||
|
||
function setUp() public { | ||
Env memory env = envVars(); | ||
vm.createSelectFork(env.RPC_URL); | ||
initializeFromDeployment(env.DEPLOY_CONFIG); | ||
deployParams = parseDeployParams(env.DEPLOY_CONFIG); | ||
} | ||
|
||
function test_module_initialState() public { | ||
assertTrue(csm.isPaused()); | ||
assertFalse(csm.publicRelease()); | ||
assertEq(csm.getNodeOperatorsCount(), 0); | ||
} | ||
|
||
function test_acounting_initialState() public { | ||
assertFalse(accounting.isPaused()); | ||
assertEq(accounting.totalBondShares(), 0); | ||
assertEq( | ||
accounting.getCurveInfo(earlyAdoption.CURVE_ID()).points, | ||
deployParams.earlyAdoptionBondCurve | ||
); | ||
} | ||
|
||
function test_feedistirbutor_initialState() public { | ||
assertEq(feeDistributor.totalClaimableShares(), 0); | ||
assertEq(feeDistributor.pendingSharesToDistribute(), 0); | ||
assertEq(feeDistributor.treeRoot(), bytes32(0)); | ||
assertEq( | ||
keccak256(abi.encodePacked(feeDistributor.treeCid())), | ||
keccak256("") | ||
); | ||
} | ||
|
||
function test_feeoracle_initialState() public { | ||
assertFalse(oracle.isPaused()); | ||
( | ||
bytes32 hash, | ||
uint256 refSlot, | ||
uint256 processingDeadlineTime, | ||
bool processingStarted | ||
) = oracle.getConsensusReport(); | ||
assertEq(hash, bytes32(0)); | ||
assertEq(refSlot, 0); | ||
assertEq(processingDeadlineTime, 0); | ||
assertFalse(processingStarted); | ||
} | ||
|
||
function test_hashconsensus_initialState() public { | ||
vm.skip(block.chainid != 1); | ||
assertEq(hashConsensus.getQuorum(), deployParams.hashConsensusQuorum); | ||
(address[] memory members, ) = hashConsensus.getMembers(); | ||
assertEq( | ||
keccak256(abi.encode(members)), | ||
keccak256(abi.encode(deployParams.oracleMembers)) | ||
); | ||
|
||
(members, ) = HashConsensus( | ||
BaseOracle(locator.accountingOracle()).getConsensusContract() | ||
).getMembers(); | ||
assertEq( | ||
keccak256(abi.encode(members)), | ||
keccak256(abi.encode(deployParams.oracleMembers)) | ||
); | ||
} | ||
} |
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