Skip to content

Commit

Permalink
Merge pull request #25 from curvefi/fix/fix_deployment_tests
Browse files Browse the repository at this point in the history
fix deploy contracts
  • Loading branch information
amfet42 authored Sep 19, 2023
2 parents ffe7304 + 09d661b commit c9f1700
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"views": "0x06452f9c013fc37169B57Eab8F50A7A48c9198A3",
"amm_impl": "0xd7E72f3615aa65b92A4DBdC211E296a35512988B",
},
"ethereum:mainnet-fork": {
"mainnet-fork": {
"factory": "0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963",
"math": "0xcBFf3004a20dBfE2731543AA38599A526e0fD6eE",
"views": "0x064253915b8449fdEFac2c4A74aA9fdF56691a31",
Expand Down
16 changes: 6 additions & 10 deletions test_deployment/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_add_liquidity(
self, admin, deploy, admin_mint_tokens, approve_admin, tokens_to_add
):
pool = deploy[0]
tx = pool.add_liquidity(tokens_to_add, 0, False, sender=admin)
tx = pool.add_liquidity(tokens_to_add, 0, sender=admin)
d_tokens = tx.return_value
assert pool.balanceOf(admin) == pool.totalSupply() == d_tokens

Expand All @@ -35,31 +35,28 @@ def test_exchange(
j,
):
pool = deploy[0]
pool.add_liquidity(tokens_to_add, 0, False, sender=admin)
pool.add_liquidity(tokens_to_add, 0, sender=admin)

if i == 0:
amount = 100 * 10 * 6
else:
amount = 1 * 10**6

tx = pool.exchange_underlying(
tx = pool.exchange_received(
i,
j,
amount,
0,
sender=admin,
)
dy_eth = tx.events.filter(pool.TokenExchange)[
0
].tokens_bought # return_value is broken in ape somehow
assert dy_eth > 0
assert tx

@pytest.mark.parametrize("i", (0, 1, 2))
def test_remove_liquidity_one(
self, admin, deploy, admin_mint_tokens, approve_admin, tokens_to_add, i
):
pool = deploy[0]
pool.add_liquidity(tokens_to_add, 0, False, sender=admin)
pool.add_liquidity(tokens_to_add, 0, sender=admin)

bal = pool.balanceOf(admin)
coin_contract = deploy[1][i]
Expand All @@ -69,9 +66,8 @@ def test_remove_liquidity_one(
bal // 2,
i,
0,
False,
sender=admin,
) # noqa: E501
)

dy_coin = tx.events.filter(pool.RemoveLiquidityOne)[0].coin_amount
assert dy_coin > 0
Expand Down

0 comments on commit c9f1700

Please sign in to comment.