Skip to content

Commit

Permalink
feat: no taking snapshots by default
Browse files Browse the repository at this point in the history
  • Loading branch information
heswithme committed Oct 21, 2024
1 parent 315064a commit fc36aa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/RewardsHandler.vy
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def _take_snapshot():


@external
def process_rewards(take_snapshot: bool = True):
def process_rewards(take_snapshot: bool = False):
"""
@notice Permissionless function that let anyone distribute rewards (if any) to
the crvUSD vault.
Expand Down
6 changes: 3 additions & 3 deletions tests/unitary/rewards_handler/test_process_rewards.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_snapshots_taking(rewards_handler, rate_manager, crvusd):
rewards_handler.set_distribution_time(1234, sender=rate_manager) # to enable process_rewards
assert rewards_handler.get_len_snapshots() == 0
boa.deal(crvusd, rewards_handler, 1)
rewards_handler.process_rewards()
rewards_handler.process_rewards(True) # True to take snapshot
assert crvusd.balanceOf(rewards_handler) == 0 # crvusd gone
assert rewards_handler.get_len_snapshots() == 1 # first snapshot taken

Expand All @@ -44,6 +44,6 @@ def test_snapshots_taking(rewards_handler, rate_manager, crvusd):

boa.env.time_travel(seconds=rewards_handler.min_snapshot_dt_seconds())
boa.deal(crvusd, rewards_handler, 1)
rewards_handler.process_rewards()
rewards_handler.process_rewards(False) # False to not take snapshot
assert crvusd.balanceOf(rewards_handler) == 0 # crvusd gone (they always go)
assert rewards_handler.get_len_snapshots() == 2 # changed since dt has passed
assert rewards_handler.get_len_snapshots() == 1 # not changed since dt has passed but False

0 comments on commit fc36aa2

Please sign in to comment.