Skip to content

Commit

Permalink
improve assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Jun 24, 2024
1 parent f95d4ac commit ef43bc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Staking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ contract Staking is ERC20VotesUpgradeable, Ownable2StepUpgradeable {

// Prevents the keyper from claiming more than they should
uint256 maxWithdrawAmount = maxWithdraw(keyper);
console.log("maxWithdrawAmount", maxWithdrawAmount);

// If the amount is greater than the max withdraw amount, the contract
// will transfer the maximum amount available not the requested amount
Expand Down
7 changes: 7 additions & 0 deletions test/Staking.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ contract ClaimRewards is StakingTest {
_amount = _boundToRealisticStake(_amount);
_jump = _boundRealisticTimeAhead(_jump);

vm.assume(_depositor1 != _depositor2);

_mintGovToken(_depositor1, _amount);
_mintGovToken(_depositor2, _amount);

Expand Down Expand Up @@ -850,6 +852,11 @@ contract ClaimRewards is StakingTest {
}

function testFuzz_RevertIf_KeyperHasNoSHares(address _depositor) public {
vm.assume(
_depositor != address(0) &&
_depositor != ProxyUtils.getAdminAddress(address(staking))
);

vm.prank(_depositor);
vm.expectRevert(Staking.KeyperHasNoShares.selector);
staking.claimRewards(0);
Expand Down

0 comments on commit ef43bc1

Please sign in to comment.