Skip to content

Commit

Permalink
test: added check that minslashablestake decreases on queued withdrawal
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael authored and Michael committed Feb 20, 2025
1 parent fa17c92 commit 889996e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/integration/IntegrationChecks.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ contract IntegrationCheckUtils is IntegrationBase {
"check_QueuedWithdrawal_State: failed to remove staker shares");
assert_Snap_Removed_Staker_WithdrawableShares(staker, strategies, shares,
"check_QueuedWithdrawal_State: failed to remove staker withdrawable shares");
check_Decreased_SlashableStake(operator, strategies);
// Check that the dsf is either reset to wad or unchanged
for (uint i = 0; i < strategies.length; i++) {
// For a full withdrawal, the dsf should be reset to wad
Expand All @@ -253,6 +254,20 @@ contract IntegrationCheckUtils is IntegrationBase {
}
}

function check_Decreased_SlashableStake(
User operator,
IStrategy[] memory strategies
) internal {
for (uint i = 0; i < strategies.length; i++) {
(OperatorSet[] memory operatorSets, Allocation[] memory allocations) = _getStrategyAllocations(operator, strategies[i]);
for (uint j = 0; j < operatorSets.length; j++) {
if (allocations[j].currentMagnitude > 0) {
assert_Snap_StakeBecomeUnslashable(operator, operatorSets[j], strategies[i].toArray(), "allocated strategies should have minSlashableStake increased");
}
}
}
}

function check_Undelegate_State(
User staker,
User operator,
Expand Down

0 comments on commit 889996e

Please sign in to comment.