Skip to content

Commit

Permalink
remove test that is no longer necessary'
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Sep 13, 2023
1 parent de7d4cd commit b30f59f
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions tests/boa/unitary/pool/test_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,56 +111,6 @@ def test_exchange_received_success(
assert -d_balance_j == measured_j


@given(
amount=strategy(
"uint256", min_value=10**10, max_value=2 * 10**6 * 10**18
), # Can be more than we have
i=strategy("uint", min_value=0, max_value=3),
j=strategy("uint", min_value=0, max_value=3),
)
@settings(**SETTINGS)
def test_exchange_received_send_extra(
swap_with_deposit,
views_contract,
coins,
user,
amount,
i,
j,
):

if i == j or i > 2 or j > 2:

return

amount = amount * 10**18 // INITIAL_PRICES[i]
mint_for_testing(coins[i], user, amount + 1) # <--- mint 1 wei extra

calculated = views_contract.get_dy(i, j, amount, swap_with_deposit)

measured_i = coins[i].balanceOf(user)
measured_j = coins[j].balanceOf(user)
d_balance_i = swap_with_deposit.balances(i)
d_balance_j = swap_with_deposit.balances(j)

with boa.env.prank(user):
coins[i].transfer(swap_with_deposit, amount + 1) # <--- send extra
swap_with_deposit.exchange_received(
i, j, amount, int(0.999 * calculated), user
)

measured_i -= coins[i].balanceOf(user)
measured_j = coins[j].balanceOf(user) - measured_j
d_balance_i = swap_with_deposit.balances(i) - d_balance_i
d_balance_j = swap_with_deposit.balances(j) - d_balance_j

assert amount == measured_i - 1 # <--- we sent 1 wei extra
assert calculated == measured_j

assert d_balance_i == amount + 1 # <--- we sent 1 wei extra
assert -d_balance_j == measured_j


@given(
amount=strategy(
"uint256", min_value=10**10, max_value=2 * 10**6 * 10**18
Expand Down

0 comments on commit b30f59f

Please sign in to comment.