web3 7.0.0b8__py3-none-any.whl → 7.0.0b9__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/contract/async_contract.py +18 -17
- web3/contract/base_contract.py +116 -80
- web3/contract/contract.py +16 -17
- web3/contract/utils.py +86 -55
- 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/filter.py +3 -3
- web3/middleware/signing.py +6 -1
- 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.0.0b9.dist-info}/METADATA +7 -5
- {web3-7.0.0b8.dist-info → web3-7.0.0b9.dist-info}/RECORD +39 -44
- {web3-7.0.0b8.dist-info → web3-7.0.0b9.dist-info}/WHEEL +1 -1
- web3/tools/benchmark/__init__.py +0 -0
- web3/tools/benchmark/main.py +0 -190
- web3/tools/benchmark/node.py +0 -120
- web3/tools/benchmark/reporting.py +0 -39
- web3/tools/benchmark/utils.py +0 -69
- /web3/_utils/{function_identifiers.py → abi_element_identifiers.py} +0 -0
- {web3-7.0.0b8.dist-info → web3-7.0.0b9.dist-info}/LICENSE +0 -0
- {web3-7.0.0b8.dist-info → web3-7.0.0b9.dist-info}/top_level.txt +0 -0
web3/types.py
CHANGED
|
@@ -27,13 +27,13 @@ from hexbytes import (
|
|
|
27
27
|
HexBytes,
|
|
28
28
|
)
|
|
29
29
|
|
|
30
|
-
from web3._utils.
|
|
31
|
-
NotRequired,
|
|
32
|
-
)
|
|
33
|
-
from web3._utils.function_identifiers import (
|
|
30
|
+
from web3._utils.abi_element_identifiers import (
|
|
34
31
|
FallbackFn,
|
|
35
32
|
ReceiveFn,
|
|
36
33
|
)
|
|
34
|
+
from web3._utils.compat import (
|
|
35
|
+
NotRequired,
|
|
36
|
+
)
|
|
37
37
|
|
|
38
38
|
if TYPE_CHECKING:
|
|
39
39
|
from web3.contract.async_contract import AsyncContractFunction # noqa: F401
|
|
@@ -53,7 +53,7 @@ BlockParams = Literal["latest", "earliest", "pending", "safe", "finalized"]
|
|
|
53
53
|
BlockIdentifier = Union[BlockParams, BlockNumber, Hash32, HexStr, HexBytes, int]
|
|
54
54
|
LatestBlockParam = Literal["latest"]
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
ABIElementIdentifier = Union[str, Type[FallbackFn], Type[ReceiveFn]]
|
|
57
57
|
|
|
58
58
|
# bytes, hexbytes, or hexstr representing a 32 byte hash
|
|
59
59
|
_Hash32 = Union[Hash32, HexBytes, HexStr]
|
|
@@ -75,46 +75,6 @@ class AccessListEntry(TypedDict):
|
|
|
75
75
|
AccessList = NewType("AccessList", Sequence[AccessListEntry])
|
|
76
76
|
|
|
77
77
|
|
|
78
|
-
# todo: move these to eth_typing once web3 is type hinted
|
|
79
|
-
class ABIEventParams(TypedDict, total=False):
|
|
80
|
-
indexed: bool
|
|
81
|
-
name: str
|
|
82
|
-
type: str
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class ABIEvent(TypedDict, total=False):
|
|
86
|
-
anonymous: bool
|
|
87
|
-
inputs: Sequence["ABIEventParams"]
|
|
88
|
-
name: str
|
|
89
|
-
type: Literal["event"]
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class ABIFunctionComponents(TypedDict, total=False):
|
|
93
|
-
components: Sequence["ABIFunctionComponents"]
|
|
94
|
-
name: str
|
|
95
|
-
type: str
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
class ABIFunctionParams(TypedDict, total=False):
|
|
99
|
-
components: Sequence["ABIFunctionComponents"]
|
|
100
|
-
name: str
|
|
101
|
-
type: str
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class ABIFunction(TypedDict, total=False):
|
|
105
|
-
constant: bool
|
|
106
|
-
inputs: Sequence["ABIFunctionParams"]
|
|
107
|
-
name: str
|
|
108
|
-
outputs: Sequence["ABIFunctionParams"]
|
|
109
|
-
payable: bool
|
|
110
|
-
stateMutability: Literal["pure", "view", "nonpayable", "payable"]
|
|
111
|
-
type: Literal["function", "constructor", "fallback", "receive"]
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
ABIElement = Union[ABIFunction, ABIEvent]
|
|
115
|
-
ABI = Sequence[Union[ABIFunction, ABIEvent]]
|
|
116
|
-
|
|
117
|
-
|
|
118
78
|
class EventData(TypedDict):
|
|
119
79
|
address: ChecksumAddress
|
|
120
80
|
args: Dict[str, Any]
|
web3/utils/__init__.py
CHANGED
|
@@ -3,11 +3,35 @@ NOTE: This is a public utility module. Any changes to these utility methods woul
|
|
|
3
3
|
classify as breaking changes.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
from .abi import (
|
|
6
|
+
from eth_utils.abi import (
|
|
7
|
+
abi_to_signature,
|
|
8
|
+
collapse_if_tuple,
|
|
9
|
+
event_abi_to_log_topic,
|
|
10
|
+
event_signature_to_log_topic,
|
|
11
|
+
filter_abi_by_name,
|
|
12
|
+
filter_abi_by_type,
|
|
13
|
+
function_abi_to_4byte_selector,
|
|
14
|
+
function_signature_to_4byte_selector,
|
|
7
15
|
get_abi_input_names,
|
|
16
|
+
get_abi_input_types,
|
|
8
17
|
get_abi_output_names,
|
|
18
|
+
get_abi_output_types,
|
|
19
|
+
get_aligned_abi_inputs,
|
|
20
|
+
get_all_event_abis,
|
|
21
|
+
get_all_function_abis,
|
|
22
|
+
get_normalized_abi_inputs,
|
|
23
|
+
)
|
|
24
|
+
from .abi import ( # NOQA
|
|
25
|
+
check_if_arguments_can_be_encoded,
|
|
26
|
+
get_abi_element_info,
|
|
27
|
+
get_abi_element,
|
|
28
|
+
get_event_abi,
|
|
29
|
+
get_event_log_topics,
|
|
30
|
+
log_topic_to_bytes,
|
|
31
|
+
)
|
|
32
|
+
from .address import (
|
|
33
|
+
get_create_address,
|
|
9
34
|
)
|
|
10
|
-
from .address import get_create_address
|
|
11
35
|
from .async_exception_handling import (
|
|
12
36
|
async_handle_offchain_lookup,
|
|
13
37
|
)
|
|
@@ -19,10 +43,30 @@ from .exception_handling import (
|
|
|
19
43
|
)
|
|
20
44
|
|
|
21
45
|
__all__ = [
|
|
22
|
-
"
|
|
23
|
-
"
|
|
46
|
+
"abi_to_signature",
|
|
47
|
+
"collapse_if_tuple",
|
|
48
|
+
"event_abi_to_log_topic",
|
|
49
|
+
"event_signature_to_log_topic",
|
|
50
|
+
"filter_abi_by_name",
|
|
51
|
+
"filter_abi_by_type",
|
|
52
|
+
"function_abi_to_4byte_selector",
|
|
53
|
+
"function_signature_to_4byte_selector",
|
|
24
54
|
"get_abi_input_names",
|
|
55
|
+
"get_abi_input_types",
|
|
25
56
|
"get_abi_output_names",
|
|
57
|
+
"get_abi_output_types",
|
|
58
|
+
"get_aligned_abi_inputs",
|
|
59
|
+
"get_all_event_abis",
|
|
60
|
+
"get_all_function_abis",
|
|
61
|
+
"get_normalized_abi_inputs",
|
|
62
|
+
"check_if_arguments_can_be_encoded",
|
|
63
|
+
"get_abi_element_info",
|
|
64
|
+
"get_abi_element",
|
|
65
|
+
"get_event_abi",
|
|
66
|
+
"get_event_log_topics",
|
|
67
|
+
"log_topic_to_bytes",
|
|
26
68
|
"get_create_address",
|
|
69
|
+
"async_handle_offchain_lookup",
|
|
70
|
+
"SimpleCache",
|
|
27
71
|
"handle_offchain_lookup",
|
|
28
72
|
]
|