Skip to content

Commit

Permalink
Merge pull request #284 from curveresearch/test-fix
Browse files Browse the repository at this point in the history
Fix tricrypto one-coin withdrawal tests
  • Loading branch information
chanhosuh authored Nov 10, 2023
2 parents 107b9f0 + c1a7a58 commit d794f51
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/unit/test_tricrypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def test_remove_liquidity(vyper_tricrypto, amount):
)
def test_remove_liquidity_one_coin(vyper_tricrypto, amount, i):
"""Test `remove_liquidity_one_coin` against vyper implementation."""
assume(amount <= vyper_tricrypto.totalSupply())
assume(amount <= vyper_tricrypto.totalSupply() // 3)

pool = initialize_pool(vyper_tricrypto)

Expand Down Expand Up @@ -628,9 +628,7 @@ def test_remove_liquidity_one_coin(vyper_tricrypto, amount, i):
)
def test_calc_withdraw_one_coin(vyper_tricrypto, amount, i):
"""Test `calc_withdraw_one_coin` against vyper implementation."""
assume(amount <= vyper_tricrypto.totalSupply())

n_coins = 3
assume(amount <= vyper_tricrypto.totalSupply() // 3)

pool = initialize_pool(vyper_tricrypto)

Expand All @@ -641,7 +639,7 @@ def test_calc_withdraw_one_coin(vyper_tricrypto, amount, i):
dy = pool.calc_withdraw_one_coin(amount, i)
assert dy == expected_dy

expected_balances = [vyper_tricrypto.balances(i) for i in range(n_coins)]
expected_balances = [vyper_tricrypto.balances(i) for i in range(3)]
assert pool.balances == expected_balances


Expand Down

0 comments on commit d794f51

Please sign in to comment.