@@ -1421,6 +1421,7 @@ contract StrategyManagerUnitTests_withdrawSharesAsTokens is StrategyManagerUnitT
14211421    ) external  filterFuzzedAddressInputs (staker) {
14221422        cheats.assume (staker !=  address (this ));
14231423        cheats.assume (staker !=  address (0 ));
1424+         cheats.assume (staker !=  address (dummyStrat));
14241425        cheats.assume (depositAmount >  0  &&  depositAmount <  dummyToken.totalSupply () &&  depositAmount <  sharesAmount);
14251426        IStrategy strategy =  dummyStrat;
14261427        IERC20  token =  dummyToken;
@@ -1457,10 +1458,10 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests {
14571458    }
14581459
14591460    /** 
1460-      * @notice deposits a single strategy and withdrawSharesAsTokens() function reverts when sharesAmount is  
1461-      * higher  than depositAmount  
1461+      * @notice deposits a single strategy and withdrawSharesAsTokens(). Tests that we revert when we  
1462+      * burn more  than expected  
14621463     */ 
1463-     function testFuzz_ShareAmountTooHigh   (
1464+     function testFuzz_RevertShareAmountTooHigh   (
14641465        address  staker ,
14651466        uint256  depositAmount ,
14661467        uint256  sharesToBurn 
@@ -1471,15 +1472,9 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests {
14711472        IERC20  token =  dummyToken;
14721473        _depositIntoStrategySuccessfully (strategy, staker, depositAmount);
14731474
1474-         uint256  strategyBalanceBefore =  token.balanceOf (address (strategy));
1475-         uint256  burnAddressBalanceBefore =  token.balanceOf (strategyManager.DEFAULT_BURN_ADDRESS ());
14761475        cheats.prank (address (delegationManagerMock));
1476+         cheats.expectRevert (IStrategyErrors.WithdrawalAmountExceedsTotalDeposits.selector );
14771477        strategyManager.burnShares (strategy, sharesToBurn);
1478-         uint256  strategyBalanceAfter =  token.balanceOf (address (strategy));
1479-         uint256  burnAddressBalanceAfter =  token.balanceOf (strategyManager.DEFAULT_BURN_ADDRESS ());
1480- 
1481-         assertEq (burnAddressBalanceBefore, burnAddressBalanceAfter, "burnAddressBalanceBefore != burnAddressBalanceAfter " );
1482-         assertEq (strategyBalanceBefore, strategyBalanceAfter, "strategyBalanceBefore != strategyBalanceAfter " );
14831478    }
14841479
14851480    function testFuzz_SingleStrategyDeposited  (
@@ -1518,7 +1513,7 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests {
15181513    }
15191514
15201515    /// @notice check that balances are unchanged with a reverting token but burnShares doesn't revert 
1521-     function testFuzz_tryCatchWithRevertToken   (
1516+     function testFuzz_revertTryCatchWithRevertToken   (
15221517        address  staker ,
15231518        uint256  depositAmount ,
15241519        uint256  sharesToBurn 
@@ -1533,15 +1528,9 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests {
15331528        cheats.etch (address (token), address (revertToken).code);
15341529        ERC20_SetTransferReverting_Mock (address (token)).setTransfersRevert (true );
15351530
1536-         uint256  strategyBalanceBefore =  token.balanceOf (address (strategy));
1537-         uint256  burnAddressBalanceBefore =  token.balanceOf (strategyManager.DEFAULT_BURN_ADDRESS ());
1531+         cheats.expectRevert ("SafeERC20: low-level call failed " );
15381532        cheats.prank (address (delegationManagerMock));
15391533        strategyManager.burnShares (strategy, sharesToBurn);
1540-         uint256  strategyBalanceAfter =  token.balanceOf (address (strategy));
1541-         uint256  burnAddressBalanceAfter =  token.balanceOf (strategyManager.DEFAULT_BURN_ADDRESS ());
1542- 
1543-         assertEq (burnAddressBalanceBefore, burnAddressBalanceAfter, "burnAddressBalanceBefore != burnAddressBalanceAfter " );
1544-         assertEq (strategyBalanceBefore, strategyBalanceAfter, "strategyBalanceBefore != strategyBalanceAfter " );
15451534    }
15461535}
15471536
0 commit comments