Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tricrypto one-coin withdrawal tests #284

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading