Skip to content

Commit

Permalink
Use in test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhly committed Nov 21, 2020
1 parent d110681 commit d64a10d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/pools/common/unitary/test_remove_liquidity_one_coin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import brownie
import pytest
from simulation import Curve

pytestmark = [
pytest.mark.skip_pool("busd", "compound", "pax", "susd", "usdt", "y"),
Expand Down Expand Up @@ -42,7 +43,7 @@ def test_lp_token_balance(alice, swap, pool_token, idx, divisor, n_coins, base_a

@pytest.mark.itercoins("idx")
@pytest.mark.parametrize("rate_mod", [0.9, 1.1])
def test_expected_vs_actual(chain, alice, swap, wrapped_coins, pool_token, idx, rate_mod):
def test_expected_vs_actual(chain, alice, swap, wrapped_coins, pool_token, idx, n_coins, rate_mod):
amount = pool_token.balanceOf(alice) // 10
wrapped = wrapped_coins[idx]

Expand All @@ -57,6 +58,10 @@ def test_expected_vs_actual(chain, alice, swap, wrapped_coins, pool_token, idx,

assert wrapped_coins[idx].balanceOf(alice) == expected

balances = [swap.balances(i) for i in range(n_coins)]
curve_model = Curve(swap.A(), balances, n_coins, tokens=pool_token.totalSupply())
assert wrapped_coins[idx].balanceOf(alice) == curve_model.calc_withdraw_one_coin(amount, idx)[0]


@pytest.mark.itercoins("idx")
def test_below_min_amount(alice, swap, wrapped_coins, pool_token, idx):
Expand Down

0 comments on commit d64a10d

Please sign in to comment.