@@ -5887,10 +5887,6 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
58875887 // multiple Withdrawal interface
58885888 cheats.expectRevert (IPausable.CurrentlyPaused.selector );
58895889 delegationManager.completeQueuedWithdrawals (withdrawals, tokensArray, receiveAsTokens);
5890-
5891- // numToComplete interface
5892- cheats.expectRevert (IPausable.CurrentlyPaused.selector );
5893- delegationManager.completeQueuedWithdrawals (tokensArray, receiveAsTokens, 1 );
58945890 }
58955891
58965892 function test_Revert_WhenInputArrayLengthMismatch () public {
@@ -5918,16 +5914,6 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
59185914 cheats.expectRevert (InputArrayLengthMismatch.selector );
59195915 delegationManager.completeQueuedWithdrawal (withdrawal, newTokens, false );
59205916
5921- IERC20 [][] memory tokensArray = new IERC20 [][](1 );
5922- tokensArray[0 ] = newTokens;
5923-
5924- bool [] memory receiveAsTokens = new bool [](1 );
5925- receiveAsTokens[0 ] = true ;
5926-
5927- cheats.prank (defaultStaker);
5928- cheats.expectRevert (InputArrayLengthMismatch.selector );
5929- delegationManager.completeQueuedWithdrawals (tokensArray, receiveAsTokens, 1 );
5930-
59315917 // check that the withdrawal completes otherwise
59325918 cheats.prank (defaultStaker);
59335919 delegationManager.completeQueuedWithdrawal (withdrawal, tokens, true );
@@ -6012,16 +5998,6 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
60125998 cheats.expectRevert (WithdrawalDelayNotElapsed.selector );
60135999 cheats.prank (defaultStaker);
60146000 delegationManager.completeQueuedWithdrawal (withdrawal, tokens, receiveAsTokens);
6015-
6016- IERC20 [][] memory tokensArray = new IERC20 [][](1 );
6017- tokensArray[0 ] = tokens;
6018-
6019- bool [] memory receiveAsTokensArray = new bool [](1 );
6020- receiveAsTokensArray[0 ] = false ;
6021-
6022- cheats.expectRevert (WithdrawalDelayNotElapsed.selector );
6023- cheats.prank (defaultStaker);
6024- delegationManager.completeQueuedWithdrawals (tokensArray, receiveAsTokensArray, 1 );
60256001 }
60266002
60276003 /**
@@ -6108,63 +6084,6 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
61086084 );
61096085 }
61106086
6111- /**
6112- * Test completing multiple queued withdrawals for a single strategy without passing in the withdrawals
6113- */
6114- function test_completeQueuedWithdrawals_NumToComplete (Randomness r ) public rand (r) {
6115- address staker = r.Address ();
6116- uint256 depositAmount = r.Uint256 (1 , MAX_STRATEGY_SHARES);
6117- uint256 numWithdrawals = r.Uint256 (2 , 20 );
6118- uint256 numToComplete = r.Uint256 (2 , numWithdrawals);
6119-
6120- (
6121- Withdrawal[] memory withdrawals ,
6122- IERC20 [][] memory tokens ,
6123- bytes32 [] memory withdrawalRoots
6124- ) = _setUpCompleteQueuedWithdrawalsSingleStrat ({
6125- staker: staker,
6126- withdrawer: staker,
6127- depositAmount: depositAmount,
6128- numWithdrawals: numWithdrawals
6129- });
6130-
6131- _registerOperatorWithBaseDetails (defaultOperator);
6132- _delegateToOperatorWhoAcceptsAllStakers (staker, defaultOperator);
6133- uint256 operatorSharesBefore = delegationManager.operatorShares (defaultOperator, withdrawals[0 ].strategies[0 ]);
6134-
6135- for (uint i = 0 ; i < withdrawalRoots.length ; i++ ) {
6136- assertTrue (delegationManager.pendingWithdrawals (withdrawalRoots[i]), "withdrawalRoots should be pending " );
6137- }
6138-
6139- bool [] memory receiveAsTokens = new bool [](withdrawals.length );
6140- for (uint i = 0 ; i < withdrawals.length ; i++ ) {
6141- receiveAsTokens[i] = true ;
6142- }
6143-
6144- // completeQueuedWithdrawal
6145- cheats.roll (withdrawals[0 ].startBlock + delegationManager.minWithdrawalDelayBlocks ());
6146- _completeQueuedWithdrawals_expectEmit (
6147- CompleteQueuedWithdrawalsEmitStruct ({
6148- withdrawals: withdrawals,
6149- tokens: tokens,
6150- receiveAsTokens: receiveAsTokens
6151- })
6152- );
6153- cheats.prank (staker);
6154- delegationManager.completeQueuedWithdrawals (tokens, receiveAsTokens, numToComplete);
6155-
6156- uint256 operatorSharesAfter = delegationManager.operatorShares (defaultOperator, withdrawals[0 ].strategies[0 ]);
6157- assertEq (operatorSharesAfter, operatorSharesBefore, "operator shares should be unchanged " );
6158-
6159- for (uint i = 0 ; i < numToComplete; i++ ) {
6160- assertFalse (delegationManager.pendingWithdrawals (withdrawalRoots[i]), "withdrawalRoot should be completed and marked false now " );
6161- }
6162-
6163- for (uint i = numToComplete; i < numWithdrawals; i++ ) {
6164- assertTrue (delegationManager.pendingWithdrawals (withdrawalRoots[i]), "withdrawalRoot should still be pending " );
6165- }
6166- }
6167-
61686087 /**
61696088 * @notice Verifies that `DelegationManager.completeQueuedWithdrawal` properly completes a queued withdrawal for the `withdrawer`
61706089 * for a single strategy.
@@ -8263,10 +8182,9 @@ contract DelegationManagerUnitTests_Lifecycle is DelegationManagerUnitTests {
82638182 assertEq (stakerWithdrawableShares[0 ], 0 , "staker withdrawable shares not calculated correctly " );
82648183 assertEq (depositShares[0 ], 0 , "staker deposit shares not reset correctly " );
82658184
8266- bool [] memory receiveAsTokens = new bool [](1 );
8267- receiveAsTokens[0 ] = false ;
8268- IERC20 [][] memory tokens = new IERC20 [][](1 );
8269- delegationManager.completeQueuedWithdrawals (tokens, receiveAsTokens, 1 );
8185+ cheats.roll (withdrawal.startBlock + delegationManager.minWithdrawalDelayBlocks () + 1 );
8186+ cheats.prank (defaultStaker);
8187+ delegationManager.completeQueuedWithdrawal (withdrawal, tokenMock.toArray (), false );
82708188
82718189 (stakerWithdrawableShares, depositShares) = delegationManager.getWithdrawableShares (defaultStaker, strategyArray);
82728190 assertEq (stakerWithdrawableShares[0 ], 0 , "staker withdrawable shares not calculated correctly " );
0 commit comments