Skip to content

Commit fc36aa2

Browse files
committed
feat: no taking snapshots by default
1 parent 315064a commit fc36aa2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contracts/RewardsHandler.vy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _take_snapshot():
209209

210210

211211
@external
212-
def process_rewards(take_snapshot: bool = True):
212+
def process_rewards(take_snapshot: bool = False):
213213
"""
214214
@notice Permissionless function that let anyone distribute rewards (if any) to
215215
the crvUSD vault.

tests/unitary/rewards_handler/test_process_rewards.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_snapshots_taking(rewards_handler, rate_manager, crvusd):
3333
rewards_handler.set_distribution_time(1234, sender=rate_manager) # to enable process_rewards
3434
assert rewards_handler.get_len_snapshots() == 0
3535
boa.deal(crvusd, rewards_handler, 1)
36-
rewards_handler.process_rewards()
36+
rewards_handler.process_rewards(True) # True to take snapshot
3737
assert crvusd.balanceOf(rewards_handler) == 0 # crvusd gone
3838
assert rewards_handler.get_len_snapshots() == 1 # first snapshot taken
3939

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

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

0 commit comments

Comments
 (0)