From c1a7a58349fb14e8207c15eb9bb7b21addc205db Mon Sep 17 00:00:00 2001 From: Phil Lu Date: Fri, 10 Nov 2023 15:00:32 -0500 Subject: [PATCH] Fix tricrypto one-coin withdrawal tests --- test/unit/test_tricrypto.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/unit/test_tricrypto.py b/test/unit/test_tricrypto.py index de32a0829..f9499c882 100644 --- a/test/unit/test_tricrypto.py +++ b/test/unit/test_tricrypto.py @@ -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) @@ -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) @@ -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