Skip to content

Commit

Permalink
chore: linting to fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed Mar 20, 2024
1 parent 9eee975 commit 24fd6f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
20 changes: 14 additions & 6 deletions tests/pools/meta/test_get_dy_underlying_fix.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# =================== Test for issue #43 fix ===================
import pytest

import boa
import pytest

from tests.utils.tokens import mint_for_testing


@pytest.fixture(params=[2, 3, 4, 5], scope="module")
def base_n_coins(request):
return request.param
Expand Down Expand Up @@ -112,7 +111,14 @@ def mint_and_approve_for_bob(meta_token, ng_base_pool_tokens, bob, empty_swap, n

@pytest.fixture()
def deposit_amounts(
meta_token, ng_base_pool, ng_base_pool_tokens, ng_base_pool_decimals, empty_swap, bob, mint_and_approve_for_bob, base_n_coins
meta_token,
ng_base_pool,
ng_base_pool_tokens,
ng_base_pool_decimals,
empty_swap,
bob,
mint_and_approve_for_bob,
base_n_coins,
):
_deposit_amounts = []
INITIAL_AMOUNT = 1_000_000 * base_n_coins
Expand Down Expand Up @@ -140,17 +146,19 @@ def swap(empty_swap, bob, deposit_amounts):
def coins_range(base_n_coins):
return range(1, base_n_coins)


def test_exchange_underlying_preview(swap, coins_range):
receiving = 0
for sending in coins_range:
# these calls used to revert before the fix
swap.get_dy_underlying(sending, receiving, 10**19)


def test_broken_pool_is_fixed(forked_chain, meta_deployer, views_deployer):
BROKEN_SWAP = '0x9e10f9Fb6F0D32B350CEe2618662243d4f24C64a'
BROKEN_VIEW ='0xe0B15824862f3222fdFeD99FeBD0f7e0EC26E1FA'
BROKEN_SWAP = "0x9e10f9Fb6F0D32B350CEe2618662243d4f24C64a"
BROKEN_VIEW = "0xe0B15824862f3222fdFeD99FeBD0f7e0EC26E1FA"

# testing fix for the first instance of the error reported
metapool = meta_deployer.at(BROKEN_SWAP)
views_deployer.at(BROKEN_VIEW)
metapool.get_dy_underlying(1, 0, 50000000)
metapool.get_dy_underlying(1, 0, 50000000)
3 changes: 2 additions & 1 deletion tests/pools/meta/test_meta_new_ng_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

BASE_N_COINS = 5


@pytest.fixture(scope="module")
def ng_base_pool_decimals():
return [18] * BASE_N_COINS
Expand Down Expand Up @@ -139,4 +140,4 @@ def test_exchange_underlying_ng_base(swap, bob, sending, receiving):
actual_out = swap.exchange_underlying(sending, receiving, amount, 0, sender=bob)

assert expected_out == actual_out
assert expected_out == actual_out
assert expected_out == actual_out

0 comments on commit 24fd6f3

Please sign in to comment.