Skip to content

Commit c9196ed

Browse files
committed
test: delegated stake quorum and assertions
1 parent 56c6d2f commit c9196ed

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/unit/StakeRegistryUnit.t.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,29 @@ contract StakeRegistryUnitTests_Config is StakeRegistryUnitTests {
619619
}
620620
event StakeTypeSet(StakeType newStakeType);
621621

622+
function test_initializeDelegatedStakeQuorum() public {
623+
uint8 quorumNumber = nextQuorum;
624+
uint96 minimumStake = 0;
625+
IStakeRegistry.StrategyParams[] memory strategyParams =
626+
new IStakeRegistry.StrategyParams[](1);
627+
strategyParams[0] = IStakeRegistry.StrategyParams(
628+
IStrategy(address(uint160(uint256(keccak256(abi.encodePacked(quorumNumber)))))),
629+
uint96(WEIGHTING_DIVISOR)
630+
);
631+
632+
cheats.prank(address(registryCoordinator));
633+
cheats.expectEmit(true, true, true, true);
634+
emit StakeTypeSet(StakeType.TOTAL_DELEGATED);
635+
stakeRegistry.initializeDelegatedStakeQuorum(
636+
quorumNumber,
637+
minimumStake,
638+
strategyParams
639+
);
640+
641+
StakeType stakeType = stakeRegistry.stakeTypePerQuorum(quorumNumber);
642+
assertEq(uint8(stakeType), uint8(StakeType.TOTAL_DELEGATED), "invalid stake type");
643+
}
644+
622645
function test_initializeSlashableStakeQuorum() public {
623646
uint8 quorumNumber = nextQuorum;
624647
uint96 minimumStake = 0;

0 commit comments

Comments
 (0)