chore(StakeManager.t): add test for unstake more than balance

This commit is contained in:
Ricardo Guilherme Schmidt 2024-03-04 12:11:23 -03:00 committed by r4bbit
parent 6c4f5d16f2
commit cd3f238a08
1 changed files with 8 additions and 0 deletions

View File

@ -317,6 +317,14 @@ contract UnstakeTest is StakeManagerTest {
assertEq(totalSupplyMPAfter, totalSupplyMPBefore - (currentMPBefore * percentToBurn / 100));
assertEq(ERC20(stakeToken).balanceOf(testUser), unstakeAmount);
}
function test_RevertWhen_AmountMoreThanBalance() public {
uint256 stakeAmount = 100;
StakeVault userVault = _createStakingAccount(testUser, stakeAmount);
vm.startPrank(testUser);
vm.expectRevert(StakeManager.StakeManager__InsufficientFunds.selector);
userVault.unstake(stakeAmount + 1);
}
}
contract LockTest is StakeManagerTest {