@@ -9,6 +9,7 @@ import "src/test/integration/users/User_M2.t.sol";
99/// @notice Contract that provides utility functions to reuse common test blocks & checks
1010contract IntegrationCheckUtils is IntegrationBase {
1111 using ArrayLib for IStrategy[];
12+ using ArrayLib for IStrategy;
1213 using SlashingLib for * ;
1314 using StdStyle for * ;
1415
@@ -178,7 +179,7 @@ contract IntegrationCheckUtils is IntegrationBase {
178179
179180 function check_Delegation_State (
180181 User staker ,
181- User operator ,
182+ User operator ,
182183 IStrategy[] memory strategies ,
183184 uint [] memory shares
184185 ) internal {
@@ -193,6 +194,7 @@ contract IntegrationCheckUtils is IntegrationBase {
193194 assert_Snap_Expected_Staker_WithdrawableShares_Delegation (staker, operator, strategies, shares, "withdrawable shares should be unchanged within rounding error after delegating " );
194195 uint256 [] memory delegatableShares = _getPrevStakerWithdrawableShares (staker, strategies);
195196 assert_Snap_Added_OperatorShares (operator, strategies, delegatableShares, "operator should have received shares " );
197+ //assert_Snap_Added_SlashableStake(operator, operatorSet, strategies, delegatableShares, "operator slashable stake should increase");
196198 }
197199
198200 function check_QueuedWithdrawal_State (
@@ -221,6 +223,19 @@ contract IntegrationCheckUtils is IntegrationBase {
221223 "check_QueuedWithdrawal_State: failed to remove staker shares " );
222224 assert_Snap_Removed_Staker_WithdrawableShares (staker, strategies, shares,
223225 "check_QueuedWithdrawal_State: failed to remove staker withdrawable shares " );
226+ // Check that the dsf is either reset to wad or unchanged
227+ for (uint i = 0 ; i < strategies.length ; i++ ) {
228+ // For a full withdrawal, the dsf should be reset to wad
229+ if (_getStakerDepositShares (staker, strategies[i].toArray ())[0 ] == 0 ) {
230+ assert_DSF_Reset (staker, strategies[i].toArray (),
231+ "check_QueuedWithdrawal_State: dsf should be reset to wad " );
232+ }
233+ // For a partial withdrawal, the dsf should not be changed
234+ else {
235+ assert_Snap_Unchanged_DSF (staker, strategies[i].toArray (),
236+ "check_QueuedWithdrawal_State: dsf should not be changed " );
237+ }
238+ }
224239 }
225240
226241 function check_Undelegate_State (
@@ -257,7 +272,8 @@ contract IntegrationCheckUtils is IntegrationBase {
257272
258273 function check_Redelegate_State (
259274 User staker ,
260- User operator ,
275+ User oldOperator ,
276+ User newOperator ,
261277 IDelegationManagerTypes.Withdrawal[] memory withdrawals ,
262278 bytes32 [] memory withdrawalRoots ,
263279 IStrategy[] memory strategies ,
@@ -277,12 +293,14 @@ contract IntegrationCheckUtils is IntegrationBase {
277293 "check_Redelegate_State: stakers withdrawal should now be pending " );
278294 assert_Snap_Added_QueuedWithdrawals (staker, withdrawals,
279295 "check_Redelegate_State: staker should have increased nonce by withdrawals.length " );
280- assert_Snap_Removed_OperatorShares (operator , strategies, stakerDelegatedShares,
296+ assert_Snap_Removed_OperatorShares (oldOperator , strategies, stakerDelegatedShares,
281297 "check_Redelegate_State: failed to remove operator shares " );
282298 assert_Snap_Removed_Staker_DepositShares (staker, strategies, stakerDepositShares,
283299 "check_Redelegate_State: failed to remove staker shares " );
284300 assert_Snap_RemovedAll_Staker_WithdrawableShares (staker, strategies,
285301 "check_QueuedWithdrawal_State: failed to remove staker withdrawable shares " );
302+ assert_Snap_Unchanged_OperatorShares (newOperator,
303+ "check_Redelegate_State: new operator shares should not have changed " );
286304 }
287305
288306 /**
@@ -309,6 +327,7 @@ contract IntegrationCheckUtils is IntegrationBase {
309327
310328 assert_Snap_Added_TokenBalances (staker, tokens, expectedTokens, "staker should have received expected tokens " );
311329 assert_Snap_Unchanged_Staker_DepositShares (staker, "staker shares should not have changed " );
330+ assert_Snap_Unchanged_DSF (staker, strategies, "dsf should not be changed " );
312331 assert_Snap_Removed_StrategyShares (strategies, shares, "strategies should have total shares decremented " );
313332
314333 // Checks specific to an operator that the Staker has delegated to
@@ -331,6 +350,7 @@ contract IntegrationCheckUtils is IntegrationBase {
331350 assert_WithdrawalNotPending (delegationManager.calculateWithdrawalRoot (withdrawal), "staker withdrawal should no longer be pending " );
332351 assert_Snap_Unchanged_TokenBalances (staker, "staker should not have any change in underlying token balances " );
333352 assert_Snap_Added_Staker_DepositShares (staker, strategies, shares, "staker should have received expected shares " );
353+ assert_Snap_Added_Staker_WithdrawableShares (staker, strategies, shares, "staker should have received expected withdrawable shares " );
334354 assert_Snap_Unchanged_StrategyShares (strategies, "strategies should have total shares unchanged " );
335355
336356 // Additional checks or handling for the non-user operator scenario
0 commit comments