Skip to content

Commit

Permalink
use eth.constants for ZERO_ADDRESS
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Feb 19, 2024
1 parent 7e563c4 commit cde0bad
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions scripts/utils/constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from os.path import abspath, dirname, join

BASE_DIR = join(dirname(abspath(__file__)), "..")
from eth.constants import ZERO_ADDRESS

ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
BASE_DIR = join(dirname(abspath(__file__)), "..")

ADDRESS_PROVIDER = "0x0000000022D53366457F9d5E68Ec105046FC4383"
STABLE_REGISTRY_ADDRESS = "0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5"
Expand Down
3 changes: 1 addition & 2 deletions tests/mainnet/metaregistry/api/test_find_pool_for_coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from os import environ

import pytest

from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS

# NOTE: This is the most important method in the metaregistry contract since it will be used
# by integrators to find pools for coin pairs. It finds pools even if the coin pair is not
Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/metaregistry/api/test_get_base_pool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def test_all(populated_metaregistry, populated_base_pool_registry, pool):
Expand Down
3 changes: 1 addition & 2 deletions tests/mainnet/metaregistry/api/test_get_coin_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import warnings

import pytest

from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def _reject_pools_with_one_coin(metaregistry, pool):
Expand Down
3 changes: 1 addition & 2 deletions tests/mainnet/metaregistry/api/test_get_gauge.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from boa import BoaError

from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def _is_dao_onboarded_gauge(_gauge, gauge_controller, liquidity_gauge):
Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/metaregistry/api/test_get_n_coins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def _get_n_coins_for_pool(registry, pool):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def _get_num_coins(registry, pool, base_pool_registry):
Expand Down
3 changes: 2 additions & 1 deletion tests/mainnet/metaregistry/api/test_get_pool_name.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from eth.constants import ZERO_ADDRESS

from scripts.deployment_utils import get_deployed_contract
from scripts.utils.constants import ZERO_ADDRESS


def test_stable_registry_pools(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import pytest
from boa import BoaError
from eth.constants import ZERO_ADDRESS

from scripts.utils import get_deployed_contract
from scripts.utils.constants import ZERO_ADDRESS
from tests.utils import assert_negative_coin_balance

EXCEPTION_POOLS = ["0x79a8C46DeA5aDa233ABaFFD40F3A0A2B1e5A4F27"]
Expand Down
3 changes: 1 addition & 2 deletions tests/mainnet/metaregistry/api/test_get_underlying_coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import boa
from boa import BoaError

from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def _get_underlying_coins(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest
from boa import BoaError
from eth.constants import ZERO_ADDRESS

from scripts.utils import get_deployed_contract
from scripts.utils.constants import ZERO_ADDRESS

EXCEPTIONS = {
# eth: ankreth pool returns [18, 0] when it should return:
Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/metaregistry/api/test_get_virtual_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import pytest
from boa import BoaError
from eth.codecs.abi.exceptions import DecodeError as ABIDecodeError
from eth.constants import ZERO_ADDRESS

from scripts.utils import get_deployed_contract
from scripts.utils.constants import ZERO_ADDRESS
from tests.utils import assert_decode_error, assert_negative_coin_balance

# ---- sanity checks since vprice getters can revert for specific pools states ----
Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/metaregistry/api/test_pool_is_metapool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def test_stable_registry_pools(
Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/metaregistry/test_base_registry_tracking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from scripts.utils.constants import ZERO_ADDRESS
from eth.constants import ZERO_ADDRESS


def test_new_crypto_factory_pool(
Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/registries/test_add_remove_basepool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import boa
from eth.constants import ZERO_ADDRESS

from scripts.utils.constants import ZERO_ADDRESS
from tests.utils import deploy_contract


Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/registries/test_add_remove_metapool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import boa
from eth.constants import ZERO_ADDRESS

from scripts.utils.constants import ZERO_ADDRESS
from tests.utils import deploy_contract


Expand Down
2 changes: 1 addition & 1 deletion tests/mainnet/registries/test_add_remove_pool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import boa
from eth.constants import ZERO_ADDRESS

from scripts.utils.constants import ZERO_ADDRESS
from tests.utils import deploy_contract


Expand Down

0 comments on commit cde0bad

Please sign in to comment.