Skip to content

Commit

Permalink
test: fix additional slash tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Oct 28, 2024
1 parent 25cbf26 commit d6c5281
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/test/integration/IntegrationChecks.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ contract IntegrationCheckUtils is IntegrationBase {
assert_Snap_Removed_ActiveValidators(staker, slashedValidators, "exited validators should each be WITHDRAWN");
}

function check_CompleteCheckpoint_WithCLSlashing_HandleRoundDown_State(
User staker,
uint64 slashedAmountGwei
) internal {
check_CompleteCheckpoint_State(staker);

assert_Snap_Unchanged_StakerDepositShares(staker, "staker shares should not have decreased");
assert_Snap_Removed_Staker_WithdrawableShares_AtLeast(staker, BEACONCHAIN_ETH_STRAT, slashedAmountGwei * GWEI_TO_WEI, "should have decreased withdrawable shares by at least slashed amount");
assert_Snap_Unchanged_ActiveValidatorCount(staker, "should not have changed active validator count");
}

function check_CompleteCheckpoint_WithCLSlashing_State(
User staker,
uint64 slashedAmountGwei
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ contract Integration_VerifyWC_StartCP_CompleteCP is IntegrationCheckUtils {
check_StartCheckpoint_WithPodBalance_State(staker, 0);

staker.completeCheckpoint();
check_CompleteCheckpoint_WithCLSlashing_State(staker, slashedBalanceGwei + secondSlashedBalanceGwei);
check_CompleteCheckpoint_WithCLSlashing_HandleRoundDown_State(staker, secondSlashedBalanceGwei);
}

/// 1. Verify validators' withdrawal credentials
Expand Down

0 comments on commit d6c5281

Please sign in to comment.