web3 7.0.0b8__py3-none-any.whl → 7.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ens/async_ens.py +16 -7
- ens/base_ens.py +3 -1
- ens/exceptions.py +2 -7
- ens/utils.py +0 -17
- web3/_utils/abi.py +100 -257
- web3/_utils/compat/__init__.py +1 -0
- web3/_utils/contracts.py +116 -205
- web3/_utils/encoding.py +4 -5
- web3/_utils/events.py +28 -33
- web3/_utils/fee_utils.py +2 -2
- web3/_utils/filters.py +2 -5
- web3/_utils/http_session_manager.py +30 -7
- web3/_utils/method_formatters.py +3 -3
- web3/_utils/module_testing/eth_module.py +59 -37
- web3/_utils/module_testing/module_testing_utils.py +43 -1
- web3/_utils/module_testing/persistent_connection_provider.py +2 -0
- web3/_utils/module_testing/web3_module.py +8 -8
- web3/_utils/normalizers.py +10 -8
- web3/_utils/validation.py +5 -7
- web3/beacon/api_endpoints.py +3 -0
- web3/beacon/async_beacon.py +18 -2
- web3/beacon/beacon.py +18 -2
- web3/contract/async_contract.py +26 -25
- web3/contract/base_contract.py +116 -80
- web3/contract/contract.py +26 -25
- web3/contract/utils.py +86 -55
- web3/datastructures.py +21 -11
- web3/eth/async_eth.py +1 -2
- web3/eth/eth.py +1 -2
- web3/exceptions.py +22 -9
- web3/gas_strategies/time_based.py +4 -0
- web3/manager.py +34 -12
- web3/middleware/base.py +8 -0
- web3/middleware/filter.py +3 -3
- web3/middleware/signing.py +6 -1
- web3/scripts/install_pre_releases.py +33 -0
- web3/scripts/parse_pygeth_version.py +16 -0
- web3/types.py +5 -45
- web3/utils/__init__.py +48 -4
- web3/utils/abi.py +575 -10
- {web3-7.0.0b8.dist-info → web3-7.1.0.dist-info}/METADATA +10 -10
- {web3-7.0.0b8.dist-info → web3-7.1.0.dist-info}/RECORD +46 -44
- {web3-7.0.0b8.dist-info → web3-7.1.0.dist-info}/WHEEL +1 -1
- /web3/_utils/{function_identifiers.py → abi_element_identifiers.py} +0 -0
- {web3-7.0.0b8.dist-info → web3-7.1.0.dist-info}/LICENSE +0 -0
- {web3-7.0.0b8.dist-info → web3-7.1.0.dist-info}/top_level.txt +0 -0
ens/async_ens.py
CHANGED
|
@@ -4,6 +4,7 @@ from copy import (
|
|
|
4
4
|
from typing import (
|
|
5
5
|
TYPE_CHECKING,
|
|
6
6
|
Any,
|
|
7
|
+
Coroutine,
|
|
7
8
|
Optional,
|
|
8
9
|
Sequence,
|
|
9
10
|
Tuple,
|
|
@@ -469,9 +470,13 @@ class AsyncENS(BaseENS):
|
|
|
469
470
|
resolver_addr = await self.address("resolver.eth")
|
|
470
471
|
namehash = raw_name_to_hash(name)
|
|
471
472
|
if await self.ens.caller.resolver(namehash) != resolver_addr:
|
|
472
|
-
|
|
473
|
-
|
|
473
|
+
coro = cast(
|
|
474
|
+
Coroutine[Any, Any, HexBytes],
|
|
475
|
+
self.ens.functions.setResolver(namehash, resolver_addr).transact(
|
|
476
|
+
transact
|
|
477
|
+
),
|
|
474
478
|
)
|
|
479
|
+
await coro
|
|
475
480
|
return cast("AsyncContract", self._resolver_contract(address=resolver_addr))
|
|
476
481
|
|
|
477
482
|
async def _resolve(
|
|
@@ -553,11 +558,15 @@ class AsyncENS(BaseENS):
|
|
|
553
558
|
transact = deepcopy(transact)
|
|
554
559
|
transact["from"] = old_owner or owner
|
|
555
560
|
for label in reversed(unowned):
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
+
coro = cast(
|
|
562
|
+
Coroutine[Any, Any, HexBytes],
|
|
563
|
+
self.ens.functions.setSubnodeOwner(
|
|
564
|
+
raw_name_to_hash(owned),
|
|
565
|
+
label_to_hash(label),
|
|
566
|
+
owner,
|
|
567
|
+
).transact(transact),
|
|
568
|
+
)
|
|
569
|
+
await coro
|
|
561
570
|
owned = f"{label}.{owned}"
|
|
562
571
|
|
|
563
572
|
async def _setup_reverse(
|
ens/base_ens.py
CHANGED
|
@@ -11,13 +11,15 @@ from typing import (
|
|
|
11
11
|
from eth_typing import (
|
|
12
12
|
ChecksumAddress,
|
|
13
13
|
)
|
|
14
|
+
from eth_utils.abi import (
|
|
15
|
+
get_abi_output_types,
|
|
16
|
+
)
|
|
14
17
|
from hexbytes import (
|
|
15
18
|
HexBytes,
|
|
16
19
|
)
|
|
17
20
|
|
|
18
21
|
from .utils import (
|
|
19
22
|
address_to_reverse_domain,
|
|
20
|
-
get_abi_output_types,
|
|
21
23
|
is_valid_name,
|
|
22
24
|
label_to_hash,
|
|
23
25
|
normalize_name,
|
ens/exceptions.py
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
from eth_utils import (
|
|
2
|
-
ValidationError,
|
|
3
|
-
)
|
|
4
1
|
import idna
|
|
5
2
|
|
|
6
3
|
|
|
@@ -32,8 +29,7 @@ class AddressMismatch(ENSException):
|
|
|
32
29
|
"""
|
|
33
30
|
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
class InvalidName(idna.IDNAError, ENSException): # type: ignore[misc]
|
|
32
|
+
class InvalidName(idna.IDNAError, ENSException):
|
|
37
33
|
"""
|
|
38
34
|
Raised if the provided name does not meet the normalization
|
|
39
35
|
standards specified in `ENSIP-15
|
|
@@ -104,8 +100,7 @@ class UnderfundedBid(ENSException):
|
|
|
104
100
|
"""
|
|
105
101
|
|
|
106
102
|
|
|
107
|
-
|
|
108
|
-
class ENSValidationError(ENSException, ValidationError): # type: ignore[misc]
|
|
103
|
+
class ENSValidationError(ENSException):
|
|
109
104
|
"""
|
|
110
105
|
Raised if there is a validation error
|
|
111
106
|
"""
|
ens/utils.py
CHANGED
|
@@ -6,8 +6,6 @@ from typing import (
|
|
|
6
6
|
TYPE_CHECKING,
|
|
7
7
|
Any,
|
|
8
8
|
Collection,
|
|
9
|
-
Dict,
|
|
10
|
-
List,
|
|
11
9
|
Optional,
|
|
12
10
|
Sequence,
|
|
13
11
|
Tuple,
|
|
@@ -28,9 +26,6 @@ from eth_utils import (
|
|
|
28
26
|
to_bytes,
|
|
29
27
|
to_normalized_address,
|
|
30
28
|
)
|
|
31
|
-
from eth_utils.abi import (
|
|
32
|
-
collapse_if_tuple,
|
|
33
|
-
)
|
|
34
29
|
from hexbytes import (
|
|
35
30
|
HexBytes,
|
|
36
31
|
)
|
|
@@ -68,9 +63,6 @@ if TYPE_CHECKING:
|
|
|
68
63
|
AsyncBaseProvider,
|
|
69
64
|
BaseProvider,
|
|
70
65
|
)
|
|
71
|
-
from web3.types import ( # noqa: F401
|
|
72
|
-
ABIFunction,
|
|
73
|
-
)
|
|
74
66
|
|
|
75
67
|
|
|
76
68
|
def Web3() -> Type["_Web3"]:
|
|
@@ -293,15 +285,6 @@ def is_valid_ens_name(ens_name: str) -> bool:
|
|
|
293
285
|
return True
|
|
294
286
|
|
|
295
287
|
|
|
296
|
-
# borrowed from similar method at `web3._utils.abi` due to circular dependency
|
|
297
|
-
def get_abi_output_types(abi: "ABIFunction") -> List[str]:
|
|
298
|
-
return (
|
|
299
|
-
[]
|
|
300
|
-
if abi["type"] == "fallback"
|
|
301
|
-
else [collapse_if_tuple(cast(Dict[str, Any], arg)) for arg in abi["outputs"]]
|
|
302
|
-
)
|
|
303
|
-
|
|
304
|
-
|
|
305
288
|
# -- async -- #
|
|
306
289
|
|
|
307
290
|
|