@@ -5946,8 +5946,8 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
59465946 delegationManager.completeQueuedWithdrawal (withdrawal, tokens, receiveAsTokens);
59475947 }
59485948
5949- /// @notice Verifies that when we complete a withdrawal as shares after a full slash, we revert
5950- function test_revert_fullySlashed () public {
5949+ /// @notice Verifies that when we complete a withdrawal as shares after a full slash, we clear the withdrawal
5950+ function test_clearWithdrawal_fullySlashed () public {
59515951 // Register operator
59525952 _registerOperatorWithBaseDetails (defaultOperator);
59535953 _setOperatorMagnitude (defaultOperator, strategyMock, WAD);
@@ -5978,12 +5978,22 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage
59785978 cheats.prank (address (allocationManagerMock));
59795979 delegationManager.slashOperatorShares (defaultOperator, strategyMock, WAD, 0 );
59805980
5981- // Complete withdrawal as shares and assert that operator has no shares increased
5981+ // Complete withdrawal as shares and check that withdrawal was cleared
59825982 cheats.roll (block .number + 1 );
59835983 IERC20 [] memory tokens = strategyMock.underlyingToken ().toArray ();
5984- cheats.expectRevert (FullySlashed.selector );
5984+
5985+ bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot (withdrawal);
5986+ assertTrue (delegationManager.pendingWithdrawals (withdrawalRoot), "withdrawal should be pending before completion " );
5987+
59855988 cheats.prank (defaultStaker);
59865989 delegationManager.completeQueuedWithdrawal (withdrawal, tokens, false );
5990+
5991+ assertFalse (delegationManager.pendingWithdrawals (withdrawalRoot), "withdrawal should be cleared after completion " );
5992+
5993+ // Assert that no shares were added back
5994+ assertEq (delegationManager.operatorShares (defaultOperator, strategyMock), 0 , "operator shares should remain 0 " );
5995+ (uint256 [] memory withdrawableShares , ) = delegationManager.getWithdrawableShares (defaultStaker, strategyMock.toArray ());
5996+ assertEq (withdrawableShares[0 ], 0 , "withdrawable shares should be 0 " );
59875997 }
59885998
59895999 /**
@@ -6631,22 +6641,18 @@ contract DelegationManagerUnitTests_slashingShares is DelegationManagerUnitTests
66316641
66326642 uint256 slashableSharesInQueueAfter = delegationManager.getSlashableSharesInQueue (defaultOperator, strategyMock);
66336643
6634- // Complete withdrawal as tokens and assert that nothing is returned
6644+ // Complete withdrawal as tokens and assert that nothing is returned and withdrawal is cleared
66356645 cheats.roll (block .number + 1 );
66366646 IERC20 [] memory tokens = strategyMock.underlyingToken ().toArray ();
6637- cheats.expectCall (
6638- address (strategyManagerMock),
6639- abi.encodeWithSelector (
6640- IShareManager.withdrawSharesAsTokens.selector ,
6641- defaultStaker,
6642- strategyMock,
6643- strategyMock.underlyingToken (),
6644- 0
6645- )
6646- );
6647+
6648+ bytes32 withdrawalRoot = delegationManager.calculateWithdrawalRoot (withdrawal);
6649+ assertTrue (delegationManager.pendingWithdrawals (withdrawalRoot), "withdrawal should be pending before completion " );
6650+
66476651 cheats.prank (defaultStaker);
66486652 delegationManager.completeQueuedWithdrawal (withdrawal, tokens, true );
66496653
6654+ assertFalse (delegationManager.pendingWithdrawals (withdrawalRoot), "withdrawal should be cleared after completion " );
6655+
66506656 assertEq (
66516657 slashableSharesInQueue,
66526658 depositAmount,
0 commit comments