Skip to content

Commit

Permalink
fix(test): simplify emission compared to other gauge
Browse files Browse the repository at this point in the history
  • Loading branch information
skellet0r committed Jun 2, 2021
1 parent f32966a commit 476f869
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/unitary/Sidechain/test_root_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,16 @@ def test_emissions_against_other_gauge(
# sleep until the start of the next epoch week
chain.mine(timestamp=(tx.timestamp // WEEK + 1) * WEEK)

last_week_claimable = 0
# 110 weeks ensures we see 2 reductions in the rate
for i in range(1, 110):
# checkpointing the root gauge mints all the allocated emissions for the next week
tx = root_gauge.checkpoint()
emissions = root_gauge.emissions() # emissions this week are delayed by a week so
emissions = root_gauge.emissions() # emissions this week are delayed y a week so

# now we time travel one week, and get the claimable rewards from the regular gauge
chain.mine(timestamp=(tx.timestamp // WEEK + 1) * WEEK)
claimable = liquidity_gauge.claimable_tokens(alice, {"from": alice}).return_value

# root gauge emissions should be equal to regular gauge claimable amount
assert math.isclose(emissions, last_week_claimable, rel_tol=1e-6)
last_week_claimable = claimable
assert math.isclose(emissions, claimable, rel_tol=1e-6)

# now we time travel one week, and get the claimable rewards from the regular gauge
chain.mine(timestamp=(tx.timestamp // WEEK + 1) * WEEK)

0 comments on commit 476f869

Please sign in to comment.