Skip to content
Draft
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions 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 @@ -81,3 +82,13 @@ def test_below_zero(alice, swap):
def test_above_n_coins(alice, swap, wrapped_coins, n_coins):
with brownie.reverts():
swap.remove_liquidity_one_coin(1, n_coins, 0, {'from': alice})

@pytest.mark.itercoins("idx")
def test_against_simulation(alice, swap, n_coins, pool_token, idx):
amount = pool_token.balanceOf(alice)

balances = [swap.balances(i) for i in range(n_coins)]
curve_model = Curve(swap.A(), balances, n_coins, tokens=pool_token.totalSupply())
expected, _ = curve_model.calc_withdraw_one_coin(amount, idx)

assert swap.swap.calc_withdraw_one_coin(amount, idx) == expected

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you