diff --git a/docs/web3.pm.rst b/docs/web3.pm.rst index 31163c7cf3..7cf836313c 100644 --- a/docs/web3.pm.rst +++ b/docs/web3.pm.rst @@ -5,6 +5,7 @@ Package Manager API The ``web3.pm`` object exposes methods to interact with Packages as defined by `ERC 1123 `_. To learn more about the EthPM spec, visit the `documentation `__. +To learn more about the Py-EthPM library used in this module, visit the `documentation `__. Attaching diff --git a/tests/core/pm-module/conftest.py b/tests/core/pm-module/conftest.py index d6da874b89..b803da801f 100644 --- a/tests/core/pm-module/conftest.py +++ b/tests/core/pm-module/conftest.py @@ -54,7 +54,7 @@ logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s") -def w3(): +def setup_w3(): genesis_overrides = {"gas_limit": 5500000} custom_genesis_params = PyEVMBackend._generate_genesis_params( overrides=genesis_overrides @@ -219,7 +219,7 @@ def release_packages(registry): return registry -W3 = w3() +W3 = setup_w3() FRESH_VY_REGISTRY = vy_registry(W3) FRESH_SOL_REGISTRY = sol_registry(W3) LOADED_VY_REGISTRY = release_packages(vy_registry(W3)) diff --git a/tests/core/pm-module/test_ens_integration.py b/tests/core/pm-module/test_ens_integration.py index 8bf07b0be0..5dce1c638e 100644 --- a/tests/core/pm-module/test_ens_integration.py +++ b/tests/core/pm-module/test_ens_integration.py @@ -1,6 +1,7 @@ import pytest from eth_utils import ( + to_bytes, to_canonical_address, ) from ethpm import ( @@ -8,7 +9,6 @@ ) from ens import ENS -from web3 import Web3 from web3.exceptions import ( InvalidAddress, ) @@ -20,13 +20,10 @@ def bytes32(val): if isinstance(val, int): - result = Web3.toBytes(val) + result = to_bytes(val) else: raise TypeError('val %r could not be converted to bytes') - if len(result) < 32: - return result.rjust(32, b'\0') - else: - return result + return result.rjust(32, b'\0') pytest_plugins = ["pytest_ethereum.plugins"] @@ -46,6 +43,8 @@ def ens_setup(solc_deployer): ens_key = accounts.pop() # create ENS contract + # values borrowed from: + # https://github.com/ethereum/web3.py/blob/master/tests/ens/conftest.py#L109 eth_labelhash = w3.keccak(text='eth') eth_namehash = bytes32(0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae) resolver_namehash = bytes32(0xfdd5d5de6dd63db72bbc2d487944ba13bf775b50a80805fe6fcaba9b0fba88f5)