Skip to content

Commit

Permalink
Fix assumptions on invariant tests to avoid invalid fuzz runs
Browse files Browse the repository at this point in the history
  • Loading branch information
wildmolasses authored and apbendi committed May 24, 2024
1 parent a42414d commit e022138
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/helpers/UniStaker.handler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ contract UniStakerHandler is CommonBase, StdCheats, StdUtils {
countCall("enableRewardNotifier")
doCheckpoints
{
vm.assume(_notifier != address(0));
vm.assume(_notifier != address(0) && _notifier != address(uniStaker));
_rewardNotifiers.add(_notifier);
vm.prank(admin);
uniStaker.setRewardNotifier(_notifier, true);
Expand Down Expand Up @@ -157,9 +157,7 @@ contract UniStakerHandler is CommonBase, StdCheats, StdUtils {
function claimReward(uint256 _actorSeed) public countCall("claimReward") doCheckpoints {
_useActor(_beneficiaries, _actorSeed);
vm.startPrank(_currentActor);
uint256 rewardsClaimed =
uniStaker.scaledUnclaimedRewardCheckpoint(_currentActor) / uniStaker.SCALE_FACTOR();
uniStaker.claimReward();
uint256 rewardsClaimed = uniStaker.claimReward();
vm.stopPrank();
ghost_rewardsClaimed += rewardsClaimed;
}
Expand Down

0 comments on commit e022138

Please sign in to comment.