From 98601d0ffc4fffba2d321efb64bd5a222aa56237 Mon Sep 17 00:00:00 2001 From: Yash Patil Date: Wed, 18 Dec 2024 20:09:09 -0500 Subject: [PATCH] fix: additional reversion test --- src/test/unit/StrategyManagerUnit.t.sol | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/test/unit/StrategyManagerUnit.t.sol b/src/test/unit/StrategyManagerUnit.t.sol index 81fcd1971..57e97ba24 100644 --- a/src/test/unit/StrategyManagerUnit.t.sol +++ b/src/test/unit/StrategyManagerUnit.t.sol @@ -1458,10 +1458,10 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests { } /** - * @notice deposits a single strategy and withdrawSharesAsTokens() function reverts when sharesAmount is - * higher than depositAmount + * @notice deposits a single strategy and withdrawSharesAsTokens(). Tests that we revert when we + * burn more than expected */ - function testFuzz_ShareAmountTooHigh( + function testFuzz_RevertShareAmountTooHigh( address staker, uint256 depositAmount, uint256 sharesToBurn @@ -1472,15 +1472,9 @@ contract StrategyManagerUnitTests_burnShares is StrategyManagerUnitTests { IERC20 token = dummyToken; _depositIntoStrategySuccessfully(strategy, staker, depositAmount); - uint256 strategyBalanceBefore = token.balanceOf(address(strategy)); - uint256 burnAddressBalanceBefore = token.balanceOf(strategyManager.DEFAULT_BURN_ADDRESS()); cheats.prank(address(delegationManagerMock)); + cheats.expectRevert(IStrategyErrors.WithdrawalAmountExceedsTotalDeposits.selector); strategyManager.burnShares(strategy, sharesToBurn); - uint256 strategyBalanceAfter = token.balanceOf(address(strategy)); - uint256 burnAddressBalanceAfter = token.balanceOf(strategyManager.DEFAULT_BURN_ADDRESS()); - - assertEq(burnAddressBalanceBefore, burnAddressBalanceAfter, "burnAddressBalanceBefore != burnAddressBalanceAfter"); - assertEq(strategyBalanceBefore, strategyBalanceAfter, "strategyBalanceBefore != strategyBalanceAfter"); } function testFuzz_SingleStrategyDeposited(