web3 6.20.3__py3-none-any.whl → 7.0.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/__init__.py +13 -2
- ens/_normalization.py +2 -17
- ens/async_ens.py +33 -21
- ens/base_ens.py +3 -1
- ens/ens.py +16 -11
- ens/exceptions.py +16 -29
- ens/specs/nf.json +1 -1
- ens/specs/normalization_spec.json +1 -1
- ens/utils.py +52 -63
- web3/__init__.py +20 -24
- web3/_utils/abi.py +115 -271
- web3/_utils/async_transactions.py +7 -4
- web3/_utils/batching.py +217 -0
- web3/_utils/blocks.py +6 -2
- web3/_utils/caching.py +128 -5
- web3/_utils/compat/__init__.py +2 -3
- web3/_utils/contract_sources/compile_contracts.py +1 -1
- web3/_utils/contract_sources/contract_data/arrays_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/bytes_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/constructor_contracts.py +7 -7
- web3/_utils/contract_sources/contract_data/contract_caller_tester.py +3 -3
- web3/_utils/contract_sources/contract_data/emitter_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/event_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/extended_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/fallback_function_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/math_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/offchain_lookup.py +3 -3
- web3/_utils/contract_sources/contract_data/offchain_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/panic_errors_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/payable_tester.py +3 -3
- web3/_utils/contract_sources/contract_data/receive_function_contracts.py +5 -5
- web3/_utils/contract_sources/contract_data/reflector_contracts.py +3 -3
- web3/_utils/contract_sources/contract_data/revert_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/simple_resolver.py +3 -3
- web3/_utils/contract_sources/contract_data/storage_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/string_contract.py +3 -3
- web3/_utils/contract_sources/contract_data/tuple_contracts.py +5 -5
- web3/_utils/contracts.py +130 -236
- web3/_utils/datatypes.py +5 -1
- web3/_utils/decorators.py +13 -23
- web3/_utils/empty.py +1 -1
- web3/_utils/encoding.py +16 -12
- web3/_utils/ens.py +2 -1
- web3/_utils/error_formatters_utils.py +5 -3
- web3/_utils/events.py +66 -69
- web3/_utils/fee_utils.py +1 -3
- web3/_utils/filters.py +24 -22
- web3/_utils/formatters.py +2 -2
- web3/_utils/http.py +5 -3
- web3/_utils/http_session_manager.py +303 -0
- web3/_utils/math.py +14 -15
- web3/_utils/method_formatters.py +34 -36
- web3/_utils/module.py +2 -1
- web3/_utils/module_testing/__init__.py +0 -3
- web3/_utils/module_testing/eth_module.py +695 -643
- web3/_utils/module_testing/module_testing_utils.py +61 -34
- web3/_utils/module_testing/persistent_connection_provider.py +56 -25
- web3/_utils/module_testing/utils.py +258 -0
- web3/_utils/module_testing/web3_module.py +438 -17
- web3/_utils/normalizers.py +13 -11
- web3/_utils/rpc_abi.py +5 -32
- web3/_utils/threads.py +8 -7
- web3/_utils/transactions.py +14 -12
- web3/_utils/type_conversion.py +5 -1
- web3/_utils/validation.py +17 -17
- web3/auto/gethdev.py +7 -2
- web3/beacon/__init__.py +6 -1
- web3/beacon/async_beacon.py +9 -5
- web3/beacon/{main.py → beacon.py} +7 -5
- web3/contract/__init__.py +7 -0
- web3/contract/async_contract.py +47 -46
- web3/contract/base_contract.py +183 -158
- web3/contract/contract.py +49 -43
- web3/contract/utils.py +203 -59
- web3/datastructures.py +79 -31
- web3/eth/__init__.py +7 -0
- web3/eth/async_eth.py +39 -51
- web3/eth/base_eth.py +17 -10
- web3/eth/eth.py +30 -68
- web3/exceptions.py +108 -82
- web3/gas_strategies/time_based.py +8 -6
- web3/geth.py +1 -254
- web3/main.py +75 -122
- web3/manager.py +316 -146
- web3/method.py +38 -31
- web3/middleware/__init__.py +67 -89
- web3/middleware/attrdict.py +36 -49
- web3/middleware/base.py +174 -0
- web3/middleware/buffered_gas_estimate.py +20 -21
- web3/middleware/filter.py +157 -117
- web3/middleware/formatting.py +124 -108
- web3/middleware/gas_price_strategy.py +20 -32
- web3/middleware/names.py +29 -26
- web3/middleware/proof_of_authority.py +68 -0
- web3/middleware/pythonic.py +2 -2
- web3/middleware/signing.py +74 -89
- web3/middleware/stalecheck.py +52 -79
- web3/middleware/validation.py +5 -13
- web3/module.py +54 -10
- web3/providers/__init__.py +10 -6
- web3/providers/async_base.py +117 -39
- web3/providers/auto.py +3 -3
- web3/providers/base.py +89 -33
- web3/providers/eth_tester/__init__.py +5 -0
- web3/providers/eth_tester/defaults.py +1 -64
- web3/providers/eth_tester/main.py +99 -31
- web3/providers/eth_tester/middleware.py +45 -73
- web3/providers/ipc.py +42 -46
- web3/providers/{websocket/websocket.py → legacy_websocket.py} +32 -7
- web3/providers/persistent/__init__.py +22 -0
- web3/providers/persistent/async_ipc.py +153 -0
- web3/providers/{persistent.py → persistent/persistent.py} +106 -25
- web3/providers/persistent/persistent_connection.py +84 -0
- web3/providers/{websocket → persistent}/request_processor.py +94 -32
- web3/providers/persistent/utils.py +43 -0
- web3/providers/{websocket/websocket_v2.py → persistent/websocket.py} +29 -28
- web3/providers/rpc/__init__.py +11 -0
- web3/providers/rpc/async_rpc.py +171 -0
- web3/providers/rpc/rpc.py +179 -0
- web3/providers/rpc/utils.py +92 -0
- web3/testing.py +4 -4
- web3/tools/benchmark/main.py +22 -22
- web3/tools/benchmark/node.py +2 -8
- web3/tools/benchmark/reporting.py +2 -2
- web3/tools/benchmark/utils.py +1 -1
- web3/tracing.py +9 -5
- web3/types.py +30 -107
- web3/utils/__init__.py +58 -5
- web3/utils/abi.py +575 -10
- web3/utils/async_exception_handling.py +19 -7
- web3/utils/caching.py +32 -13
- web3/utils/exception_handling.py +7 -5
- {web3-6.20.3.dist-info → web3-7.0.0.dist-info}/LICENSE +1 -1
- web3-7.0.0.dist-info/METADATA +112 -0
- web3-7.0.0.dist-info/RECORD +167 -0
- {web3-6.20.3.dist-info → web3-7.0.0.dist-info}/top_level.txt +0 -1
- ethpm/__init__.py +0 -20
- ethpm/_utils/__init__.py +0 -0
- ethpm/_utils/backend.py +0 -93
- ethpm/_utils/cache.py +0 -44
- ethpm/_utils/chains.py +0 -119
- ethpm/_utils/contract.py +0 -35
- ethpm/_utils/deployments.py +0 -145
- ethpm/_utils/ipfs.py +0 -116
- ethpm/_utils/protobuf/__init__.py +0 -0
- ethpm/_utils/protobuf/ipfs_file_pb2.py +0 -33
- ethpm/_utils/registry.py +0 -29
- ethpm/assets/__init__.py +0 -0
- ethpm/assets/ens/v3.json +0 -1
- ethpm/assets/escrow/with_bytecode_v3.json +0 -1
- ethpm/assets/ipfs_file.proto +0 -32
- ethpm/assets/owned/output_v3.json +0 -1
- ethpm/assets/owned/with_contract_type_v3.json +0 -1
- ethpm/assets/registry/contracts/Authority.sol +0 -156
- ethpm/assets/registry/contracts/IndexedOrderedSetLib.sol +0 -106
- ethpm/assets/registry/contracts/PackageDB.sol +0 -225
- ethpm/assets/registry/contracts/PackageRegistry.sol +0 -361
- ethpm/assets/registry/contracts/PackageRegistryInterface.sol +0 -97
- ethpm/assets/registry/contracts/ReleaseDB.sol +0 -309
- ethpm/assets/registry/contracts/ReleaseValidator.sol +0 -152
- ethpm/assets/registry/solc_input.json +0 -1
- ethpm/assets/registry/solc_output.json +0 -1
- ethpm/assets/registry/v3.json +0 -1
- ethpm/assets/safe-math-lib/v3-strict-no-deployments.json +0 -1
- ethpm/assets/simple-registry/contracts/Ownable.sol +0 -63
- ethpm/assets/simple-registry/contracts/PackageRegistry.sol +0 -373
- ethpm/assets/simple-registry/contracts/PackageRegistryInterface.sol +0 -96
- ethpm/assets/simple-registry/solc_input.json +0 -33
- ethpm/assets/simple-registry/solc_output.json +0 -1
- ethpm/assets/simple-registry/v3.json +0 -1
- ethpm/assets/standard-token/output_v3.json +0 -1
- ethpm/assets/standard-token/with_bytecode_v3.json +0 -1
- ethpm/assets/vyper_registry/0.1.0.json +0 -1
- ethpm/assets/vyper_registry/registry.vy +0 -216
- ethpm/assets/vyper_registry/registry_with_delete.vy +0 -244
- ethpm/backends/__init__.py +0 -0
- ethpm/backends/base.py +0 -43
- ethpm/backends/http.py +0 -108
- ethpm/backends/ipfs.py +0 -219
- ethpm/backends/registry.py +0 -154
- ethpm/constants.py +0 -17
- ethpm/contract.py +0 -187
- ethpm/dependencies.py +0 -58
- ethpm/deployments.py +0 -80
- ethpm/ethpm-spec/examples/escrow/1.0.0-pretty.json +0 -146
- ethpm/ethpm-spec/examples/escrow/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/escrow/contracts/Escrow.sol +0 -32
- ethpm/ethpm-spec/examples/escrow/contracts/SafeSendLib.sol +0 -20
- ethpm/ethpm-spec/examples/escrow/v3-pretty.json +0 -171
- ethpm/ethpm-spec/examples/escrow/v3.json +0 -1
- ethpm/ethpm-spec/examples/owned/1.0.0-pretty.json +0 -21
- ethpm/ethpm-spec/examples/owned/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/owned/contracts/Owned.sol +0 -12
- ethpm/ethpm-spec/examples/owned/v3-pretty.json +0 -27
- ethpm/ethpm-spec/examples/owned/v3.json +0 -1
- ethpm/ethpm-spec/examples/piper-coin/1.0.0-pretty.json +0 -31
- ethpm/ethpm-spec/examples/piper-coin/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/piper-coin/v3-pretty.json +0 -21
- ethpm/ethpm-spec/examples/piper-coin/v3.json +0 -1
- ethpm/ethpm-spec/examples/safe-math-lib/1.0.0-pretty.json +0 -85
- ethpm/ethpm-spec/examples/safe-math-lib/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/safe-math-lib/contracts/SafeMathLib.sol +0 -24
- ethpm/ethpm-spec/examples/safe-math-lib/v3-pretty.json +0 -117
- ethpm/ethpm-spec/examples/safe-math-lib/v3.json +0 -1
- ethpm/ethpm-spec/examples/standard-token/1.0.0-pretty.json +0 -55
- ethpm/ethpm-spec/examples/standard-token/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/standard-token/contracts/AbstractToken.sol +0 -20
- ethpm/ethpm-spec/examples/standard-token/contracts/StandardToken.sol +0 -84
- ethpm/ethpm-spec/examples/standard-token/v3-pretty.json +0 -460
- ethpm/ethpm-spec/examples/standard-token/v3.json +0 -1
- ethpm/ethpm-spec/examples/transferable/1.0.0-pretty.json +0 -21
- ethpm/ethpm-spec/examples/transferable/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/transferable/contracts/Transferable.sol +0 -14
- ethpm/ethpm-spec/examples/transferable/v3-pretty.json +0 -27
- ethpm/ethpm-spec/examples/transferable/v3.json +0 -1
- ethpm/ethpm-spec/examples/wallet/1.0.0-pretty.json +0 -120
- ethpm/ethpm-spec/examples/wallet/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/wallet/contracts/Wallet.sol +0 -41
- ethpm/ethpm-spec/examples/wallet/v3-pretty.json +0 -181
- ethpm/ethpm-spec/examples/wallet/v3.json +0 -1
- ethpm/ethpm-spec/examples/wallet-with-send/1.0.0-pretty.json +0 -135
- ethpm/ethpm-spec/examples/wallet-with-send/1.0.0.json +0 -1
- ethpm/ethpm-spec/examples/wallet-with-send/contracts/WalletWithSend.sol +0 -18
- ethpm/ethpm-spec/examples/wallet-with-send/v3-pretty.json +0 -207
- ethpm/ethpm-spec/examples/wallet-with-send/v3.json +0 -1
- ethpm/ethpm-spec/spec/package.spec.json +0 -379
- ethpm/ethpm-spec/spec/v3.spec.json +0 -483
- ethpm/exceptions.py +0 -68
- ethpm/package.py +0 -438
- ethpm/tools/__init__.py +0 -4
- ethpm/tools/builder.py +0 -930
- ethpm/tools/checker.py +0 -312
- ethpm/tools/get_manifest.py +0 -19
- ethpm/uri.py +0 -141
- ethpm/validation/__init__.py +0 -0
- ethpm/validation/manifest.py +0 -146
- ethpm/validation/misc.py +0 -39
- ethpm/validation/package.py +0 -80
- ethpm/validation/uri.py +0 -163
- web3/_utils/contract_sources/contract_data/address_reflector.py +0 -29
- web3/_utils/miner.py +0 -88
- web3/_utils/module_testing/go_ethereum_personal_module.py +0 -323
- web3/_utils/request.py +0 -265
- web3/middleware/abi.py +0 -11
- web3/middleware/async_cache.py +0 -99
- web3/middleware/cache.py +0 -374
- web3/middleware/exception_handling.py +0 -49
- web3/middleware/exception_retry_request.py +0 -188
- web3/middleware/fixture.py +0 -190
- web3/middleware/geth_poa.py +0 -81
- web3/middleware/normalize_request_parameters.py +0 -11
- web3/middleware/simulate_unmined_transaction.py +0 -43
- web3/pm.py +0 -602
- web3/providers/async_rpc.py +0 -99
- web3/providers/rpc.py +0 -98
- web3/providers/websocket/__init__.py +0 -11
- web3/providers/websocket/websocket_connection.py +0 -42
- web3/tools/__init__.py +0 -4
- web3/tools/pytest_ethereum/__init__.py +0 -0
- web3/tools/pytest_ethereum/_utils.py +0 -145
- web3/tools/pytest_ethereum/deployer.py +0 -48
- web3/tools/pytest_ethereum/exceptions.py +0 -22
- web3/tools/pytest_ethereum/linker.py +0 -128
- web3/tools/pytest_ethereum/plugins.py +0 -33
- web3-6.20.3.dist-info/METADATA +0 -104
- web3-6.20.3.dist-info/RECORD +0 -283
- web3-6.20.3.dist-info/entry_points.txt +0 -2
- /web3/_utils/{function_identifiers.py → abi_element_identifiers.py} +0 -0
- {web3-6.20.3.dist-info → web3-7.0.0.dist-info}/WHEEL +0 -0
web3/_utils/transactions.py
CHANGED
|
@@ -2,6 +2,7 @@ import math
|
|
|
2
2
|
from typing import (
|
|
3
3
|
TYPE_CHECKING,
|
|
4
4
|
List,
|
|
5
|
+
Literal,
|
|
5
6
|
Optional,
|
|
6
7
|
Union,
|
|
7
8
|
cast,
|
|
@@ -19,9 +20,6 @@ from hexbytes import (
|
|
|
19
20
|
HexBytes,
|
|
20
21
|
)
|
|
21
22
|
|
|
22
|
-
from web3._utils.compat import (
|
|
23
|
-
Literal,
|
|
24
|
-
)
|
|
25
23
|
from web3._utils.utility_methods import (
|
|
26
24
|
all_in_dict,
|
|
27
25
|
any_in_dict,
|
|
@@ -29,6 +27,10 @@ from web3._utils.utility_methods import (
|
|
|
29
27
|
from web3.constants import (
|
|
30
28
|
DYNAMIC_FEE_TXN_PARAMS,
|
|
31
29
|
)
|
|
30
|
+
from web3.exceptions import (
|
|
31
|
+
Web3AttributeError,
|
|
32
|
+
Web3ValueError,
|
|
33
|
+
)
|
|
32
34
|
from web3.types import (
|
|
33
35
|
BlockIdentifier,
|
|
34
36
|
TxData,
|
|
@@ -107,7 +109,7 @@ def fill_nonce(w3: "Web3", transaction: TxParams) -> TxParams:
|
|
|
107
109
|
@curry
|
|
108
110
|
def fill_transaction_defaults(w3: "Web3", transaction: TxParams) -> TxParams:
|
|
109
111
|
"""
|
|
110
|
-
|
|
112
|
+
If w3 is None, fill as much as possible while offline
|
|
111
113
|
"""
|
|
112
114
|
strategy_based_gas_price = w3.eth.generate_gas_price(transaction)
|
|
113
115
|
is_dynamic_fee_transaction = strategy_based_gas_price is None and (
|
|
@@ -130,7 +132,7 @@ def fill_transaction_defaults(w3: "Web3", transaction: TxParams) -> TxParams:
|
|
|
130
132
|
|
|
131
133
|
if callable(default_getter):
|
|
132
134
|
if w3 is None:
|
|
133
|
-
raise
|
|
135
|
+
raise Web3ValueError(
|
|
134
136
|
f"You must specify a '{key}' value in the transaction"
|
|
135
137
|
)
|
|
136
138
|
default_val = default_getter(w3, transaction)
|
|
@@ -160,7 +162,7 @@ def get_buffered_gas_estimate(
|
|
|
160
162
|
gas_limit = get_block_gas_limit(w3)
|
|
161
163
|
|
|
162
164
|
if gas_estimate > gas_limit:
|
|
163
|
-
raise
|
|
165
|
+
raise Web3ValueError(
|
|
164
166
|
"Contract does not appear to be deployable within the "
|
|
165
167
|
f"current network gas limits. Estimated: {gas_estimate}. "
|
|
166
168
|
f"Current gas limit: {gas_limit}"
|
|
@@ -172,7 +174,7 @@ def get_buffered_gas_estimate(
|
|
|
172
174
|
def get_required_transaction(w3: "Web3", transaction_hash: _Hash32) -> TxData:
|
|
173
175
|
current_transaction = w3.eth.get_transaction(transaction_hash)
|
|
174
176
|
if not current_transaction:
|
|
175
|
-
raise
|
|
177
|
+
raise Web3ValueError(
|
|
176
178
|
f"Supplied transaction with hash {transaction_hash!r} does not exist"
|
|
177
179
|
)
|
|
178
180
|
return current_transaction
|
|
@@ -204,7 +206,7 @@ def extract_valid_transaction_params(transaction_params: TxData) -> TxParams:
|
|
|
204
206
|
msg = 'failure to handle this transaction due to both "input: {}" and'
|
|
205
207
|
msg += ' "data: {}" are populated. You need to resolve this conflict.'
|
|
206
208
|
err_vals = (transaction_params["input"], extracted_params["data"])
|
|
207
|
-
raise
|
|
209
|
+
raise Web3AttributeError(msg.format(*err_vals))
|
|
208
210
|
else:
|
|
209
211
|
return extracted_params
|
|
210
212
|
else:
|
|
@@ -223,7 +225,7 @@ def extract_valid_transaction_params(transaction_params: TxData) -> TxParams:
|
|
|
223
225
|
def assert_valid_transaction_params(transaction_params: TxParams) -> None:
|
|
224
226
|
for param in transaction_params:
|
|
225
227
|
if param not in VALID_TRANSACTION_PARAMS:
|
|
226
|
-
raise
|
|
228
|
+
raise Web3ValueError(f"{param} is not a valid transaction parameter")
|
|
227
229
|
|
|
228
230
|
|
|
229
231
|
def prepare_replacement_transaction(
|
|
@@ -233,14 +235,14 @@ def prepare_replacement_transaction(
|
|
|
233
235
|
gas_multiplier: float = 1.125,
|
|
234
236
|
) -> TxParams:
|
|
235
237
|
if original_transaction["blockHash"] is not None:
|
|
236
|
-
raise
|
|
238
|
+
raise Web3ValueError(
|
|
237
239
|
f'Supplied transaction with hash {original_transaction["hash"]!r} '
|
|
238
240
|
"has already been mined"
|
|
239
241
|
)
|
|
240
242
|
if "nonce" in replacement_transaction and (
|
|
241
243
|
replacement_transaction["nonce"] != original_transaction["nonce"]
|
|
242
244
|
):
|
|
243
|
-
raise
|
|
245
|
+
raise Web3ValueError(
|
|
244
246
|
"Supplied nonce in new_transaction must match the pending transaction"
|
|
245
247
|
)
|
|
246
248
|
|
|
@@ -259,7 +261,7 @@ def prepare_replacement_transaction(
|
|
|
259
261
|
and original_transaction["gasPrice"] is not None
|
|
260
262
|
):
|
|
261
263
|
if replacement_transaction["gasPrice"] <= original_transaction["gasPrice"]:
|
|
262
|
-
raise
|
|
264
|
+
raise Web3ValueError(
|
|
263
265
|
"Supplied gas price must exceed existing transaction gas price"
|
|
264
266
|
)
|
|
265
267
|
|
web3/_utils/type_conversion.py
CHANGED
|
@@ -10,6 +10,10 @@ from eth_utils import (
|
|
|
10
10
|
to_hex,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
+
from web3.exceptions import (
|
|
14
|
+
Web3ValueError,
|
|
15
|
+
)
|
|
16
|
+
|
|
13
17
|
|
|
14
18
|
def to_hex_if_bytes(val: Union[HexStr, str, bytes, bytearray]) -> HexStr:
|
|
15
19
|
"""
|
|
@@ -17,7 +21,7 @@ def to_hex_if_bytes(val: Union[HexStr, str, bytes, bytearray]) -> HexStr:
|
|
|
17
21
|
meant to work with bytes and hex strings.
|
|
18
22
|
"""
|
|
19
23
|
if isinstance(val, str) and not val.startswith("0x"):
|
|
20
|
-
raise
|
|
24
|
+
raise Web3ValueError(f"Expected a hex string. Got: {val!r}")
|
|
21
25
|
|
|
22
26
|
return to_hex(val) if isinstance(val, (bytes, bytearray)) else to_hex(hexstr=val)
|
|
23
27
|
|
web3/_utils/validation.py
CHANGED
|
@@ -5,10 +5,14 @@ from typing import (
|
|
|
5
5
|
)
|
|
6
6
|
|
|
7
7
|
from eth_typing import (
|
|
8
|
+
ABI,
|
|
9
|
+
ABIFunction,
|
|
8
10
|
HexStr,
|
|
9
11
|
TypeStr,
|
|
10
12
|
)
|
|
11
13
|
from eth_utils import (
|
|
14
|
+
abi_to_signature,
|
|
15
|
+
filter_abi_by_type,
|
|
12
16
|
function_abi_to_4byte_selector,
|
|
13
17
|
is_0x_prefixed,
|
|
14
18
|
is_binary_address,
|
|
@@ -38,8 +42,6 @@ from ens.utils import (
|
|
|
38
42
|
is_valid_ens_name,
|
|
39
43
|
)
|
|
40
44
|
from web3._utils.abi import (
|
|
41
|
-
abi_to_signature,
|
|
42
|
-
filter_by_type,
|
|
43
45
|
is_address_type,
|
|
44
46
|
is_array_type,
|
|
45
47
|
is_bool_type,
|
|
@@ -53,10 +55,8 @@ from web3._utils.abi import (
|
|
|
53
55
|
)
|
|
54
56
|
from web3.exceptions import (
|
|
55
57
|
InvalidAddress,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ABI,
|
|
59
|
-
ABIFunction,
|
|
58
|
+
Web3TypeError,
|
|
59
|
+
Web3ValueError,
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
|
|
@@ -74,16 +74,16 @@ def validate_abi(abi: ABI) -> None:
|
|
|
74
74
|
Helper function for validating an ABI
|
|
75
75
|
"""
|
|
76
76
|
if not is_list_like(abi):
|
|
77
|
-
raise
|
|
77
|
+
raise Web3ValueError("'abi' is not a list")
|
|
78
78
|
|
|
79
79
|
if not all(is_dict(e) for e in abi):
|
|
80
|
-
raise
|
|
80
|
+
raise Web3ValueError("'abi' is not a list of dictionaries")
|
|
81
81
|
|
|
82
|
-
functions =
|
|
82
|
+
functions = filter_abi_by_type("function", abi)
|
|
83
83
|
selectors = groupby(compose(encode_hex, function_abi_to_4byte_selector), functions)
|
|
84
84
|
duplicates = valfilter(lambda funcs: len(funcs) > 1, selectors)
|
|
85
85
|
if duplicates:
|
|
86
|
-
raise
|
|
86
|
+
raise Web3ValueError(
|
|
87
87
|
"Abi contains functions with colliding selectors. "
|
|
88
88
|
f"Functions {_prepare_selector_collision_msg(duplicates)}"
|
|
89
89
|
)
|
|
@@ -94,7 +94,7 @@ def validate_abi_type(abi_type: TypeStr) -> None:
|
|
|
94
94
|
Helper function for validating an abi_type
|
|
95
95
|
"""
|
|
96
96
|
if not is_recognized_type(abi_type):
|
|
97
|
-
raise
|
|
97
|
+
raise Web3ValueError(f"Unrecognized abi_type: {abi_type}")
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
def validate_abi_value(abi_type: TypeStr, value: Any) -> None:
|
|
@@ -107,12 +107,12 @@ def validate_abi_value(abi_type: TypeStr, value: Any) -> None:
|
|
|
107
107
|
specified_length = length_of_array_type(abi_type)
|
|
108
108
|
if specified_length is not None:
|
|
109
109
|
if specified_length < 1:
|
|
110
|
-
raise
|
|
110
|
+
raise Web3TypeError(
|
|
111
111
|
f"Invalid abi-type: {abi_type}. Length of fixed sized "
|
|
112
112
|
"arrays must be greater than 0."
|
|
113
113
|
)
|
|
114
114
|
if specified_length != len(value):
|
|
115
|
-
raise
|
|
115
|
+
raise Web3TypeError(
|
|
116
116
|
"The following array length does not the length specified"
|
|
117
117
|
f"by the abi-type, {abi_type}: {value}"
|
|
118
118
|
)
|
|
@@ -138,14 +138,14 @@ def validate_abi_value(abi_type: TypeStr, value: Any) -> None:
|
|
|
138
138
|
if is_0x_prefixed(value):
|
|
139
139
|
return
|
|
140
140
|
else:
|
|
141
|
-
raise
|
|
141
|
+
raise Web3TypeError(
|
|
142
142
|
"ABI values of abi-type 'bytes' must be either"
|
|
143
143
|
"a python3 'bytes' object or an '0x' prefixed string."
|
|
144
144
|
)
|
|
145
145
|
elif is_string_type(abi_type) and is_string(value):
|
|
146
146
|
return
|
|
147
147
|
|
|
148
|
-
raise
|
|
148
|
+
raise Web3TypeError(f"The following abi value is not a '{abi_type}': {value}")
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
def is_not_address_string(value: Any) -> bool:
|
|
@@ -173,7 +173,7 @@ def validate_address(value: Any) -> None:
|
|
|
173
173
|
return
|
|
174
174
|
|
|
175
175
|
if not isinstance(value, str):
|
|
176
|
-
raise
|
|
176
|
+
raise Web3TypeError(f"Address {value} must be provided as a string")
|
|
177
177
|
if not is_hex_address(value):
|
|
178
178
|
raise InvalidAddress(
|
|
179
179
|
"Address must be 20 bytes, as a hex string with a 0x prefix", value
|
|
@@ -204,7 +204,7 @@ def has_one_val(*args: Any, **kwargs: Any) -> bool:
|
|
|
204
204
|
|
|
205
205
|
def assert_one_val(*args: Any, **kwargs: Any) -> None:
|
|
206
206
|
if not has_one_val(*args, **kwargs):
|
|
207
|
-
raise
|
|
207
|
+
raise Web3TypeError(
|
|
208
208
|
"Exactly one of the passed values can be specified. "
|
|
209
209
|
f"Instead, values were: {args!r}, {kwargs!r}"
|
|
210
210
|
)
|
web3/auto/gethdev.py
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
from web3 import (
|
|
2
|
+
AsyncIPCProvider,
|
|
3
|
+
AsyncWeb3,
|
|
2
4
|
IPCProvider,
|
|
3
5
|
Web3,
|
|
4
6
|
)
|
|
5
7
|
from web3.middleware import (
|
|
6
|
-
|
|
8
|
+
ExtraDataToPOAMiddleware,
|
|
7
9
|
)
|
|
8
10
|
from web3.providers.ipc import (
|
|
9
11
|
get_dev_ipc_path,
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
w3 = Web3(IPCProvider(get_dev_ipc_path()))
|
|
13
|
-
w3.middleware_onion.inject(
|
|
15
|
+
w3.middleware_onion.inject(ExtraDataToPOAMiddleware, layer=0)
|
|
16
|
+
|
|
17
|
+
async_w3 = AsyncWeb3(AsyncIPCProvider(get_dev_ipc_path()))
|
|
18
|
+
async_w3.middleware_onion.inject(ExtraDataToPOAMiddleware, layer=0)
|
web3/beacon/__init__.py
CHANGED
web3/beacon/async_beacon.py
CHANGED
|
@@ -8,9 +8,8 @@ from eth_typing import (
|
|
|
8
8
|
HexStr,
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
-
from web3._utils.
|
|
12
|
-
|
|
13
|
-
async_json_make_get_request,
|
|
11
|
+
from web3._utils.http_session_manager import (
|
|
12
|
+
HTTPSessionManager,
|
|
14
13
|
)
|
|
15
14
|
from web3.beacon.api_endpoints import (
|
|
16
15
|
GET_ATTESTATIONS,
|
|
@@ -63,10 +62,13 @@ class AsyncBeacon:
|
|
|
63
62
|
) -> None:
|
|
64
63
|
self.base_url = base_url
|
|
65
64
|
self.request_timeout = request_timeout
|
|
65
|
+
self._request_session_manager = HTTPSessionManager()
|
|
66
66
|
|
|
67
67
|
async def _async_make_get_request(self, endpoint_uri: str) -> Dict[str, Any]:
|
|
68
68
|
uri = URI(self.base_url + endpoint_uri)
|
|
69
|
-
return await async_json_make_get_request(
|
|
69
|
+
return await self._request_session_manager.async_json_make_get_request(
|
|
70
|
+
uri, timeout=self.request_timeout
|
|
71
|
+
)
|
|
70
72
|
|
|
71
73
|
# [ BEACON endpoints ]
|
|
72
74
|
|
|
@@ -208,7 +210,9 @@ class AsyncBeacon:
|
|
|
208
210
|
|
|
209
211
|
async def get_health(self) -> int:
|
|
210
212
|
url = URI(self.base_url + GET_HEALTH)
|
|
211
|
-
response =
|
|
213
|
+
response = (
|
|
214
|
+
await self._request_session_manager.async_get_response_from_get_request(url)
|
|
215
|
+
)
|
|
212
216
|
return response.status
|
|
213
217
|
|
|
214
218
|
async def get_version(self) -> Dict[str, Any]:
|
|
@@ -8,9 +8,8 @@ from eth_typing import (
|
|
|
8
8
|
HexStr,
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
-
from web3._utils.
|
|
12
|
-
|
|
13
|
-
json_make_get_request,
|
|
11
|
+
from web3._utils.http_session_manager import (
|
|
12
|
+
HTTPSessionManager,
|
|
14
13
|
)
|
|
15
14
|
from web3.beacon.api_endpoints import (
|
|
16
15
|
GET_ATTESTATIONS,
|
|
@@ -61,10 +60,13 @@ class Beacon:
|
|
|
61
60
|
) -> None:
|
|
62
61
|
self.base_url = base_url
|
|
63
62
|
self.request_timeout = request_timeout
|
|
63
|
+
self._request_session_manager = HTTPSessionManager()
|
|
64
64
|
|
|
65
65
|
def _make_get_request(self, endpoint_url: str) -> Dict[str, Any]:
|
|
66
66
|
uri = URI(self.base_url + endpoint_url)
|
|
67
|
-
return json_make_get_request(
|
|
67
|
+
return self._request_session_manager.json_make_get_request(
|
|
68
|
+
uri, timeout=self.request_timeout
|
|
69
|
+
)
|
|
68
70
|
|
|
69
71
|
# [ BEACON endpoints ]
|
|
70
72
|
|
|
@@ -196,7 +198,7 @@ class Beacon:
|
|
|
196
198
|
|
|
197
199
|
def get_health(self) -> int:
|
|
198
200
|
url = URI(self.base_url + GET_HEALTH)
|
|
199
|
-
response = get_response_from_get_request(url)
|
|
201
|
+
response = self._request_session_manager.get_response_from_get_request(url)
|
|
200
202
|
return response.status_code
|
|
201
203
|
|
|
202
204
|
def get_version(self) -> Dict[str, Any]:
|
web3/contract/__init__.py
CHANGED
web3/contract/async_contract.py
CHANGED
|
@@ -14,11 +14,16 @@ from typing import (
|
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
from eth_typing import (
|
|
17
|
+
ABI,
|
|
17
18
|
ChecksumAddress,
|
|
18
19
|
)
|
|
19
20
|
from eth_utils import (
|
|
20
21
|
combomethod,
|
|
21
22
|
)
|
|
23
|
+
from eth_utils.abi import (
|
|
24
|
+
get_abi_input_names,
|
|
25
|
+
get_all_function_abis,
|
|
26
|
+
)
|
|
22
27
|
from eth_utils.toolz import (
|
|
23
28
|
partial,
|
|
24
29
|
)
|
|
@@ -28,9 +33,12 @@ from hexbytes import (
|
|
|
28
33
|
|
|
29
34
|
from web3._utils.abi import (
|
|
30
35
|
fallback_func_abi_exists,
|
|
31
|
-
filter_by_type,
|
|
32
36
|
receive_func_abi_exists,
|
|
33
37
|
)
|
|
38
|
+
from web3._utils.abi_element_identifiers import (
|
|
39
|
+
FallbackFn,
|
|
40
|
+
ReceiveFn,
|
|
41
|
+
)
|
|
34
42
|
from web3._utils.async_transactions import (
|
|
35
43
|
async_fill_transaction_defaults,
|
|
36
44
|
)
|
|
@@ -39,7 +47,6 @@ from web3._utils.compat import (
|
|
|
39
47
|
)
|
|
40
48
|
from web3._utils.contracts import (
|
|
41
49
|
async_parse_block_identifier,
|
|
42
|
-
parse_block_identifier_no_extra_call,
|
|
43
50
|
)
|
|
44
51
|
from web3._utils.datatypes import (
|
|
45
52
|
PropertyCheckingFactory,
|
|
@@ -51,10 +58,6 @@ from web3._utils.events import (
|
|
|
51
58
|
from web3._utils.filters import (
|
|
52
59
|
AsyncLogFilter,
|
|
53
60
|
)
|
|
54
|
-
from web3._utils.function_identifiers import (
|
|
55
|
-
FallbackFn,
|
|
56
|
-
ReceiveFn,
|
|
57
|
-
)
|
|
58
61
|
from web3._utils.normalizers import (
|
|
59
62
|
normalize_abi,
|
|
60
63
|
normalize_address_no_ens,
|
|
@@ -83,18 +86,17 @@ from web3.exceptions import (
|
|
|
83
86
|
ABIFunctionNotFound,
|
|
84
87
|
NoABIFound,
|
|
85
88
|
NoABIFunctionsFound,
|
|
89
|
+
Web3AttributeError,
|
|
90
|
+
Web3TypeError,
|
|
86
91
|
Web3ValidationError,
|
|
92
|
+
Web3ValueError,
|
|
87
93
|
)
|
|
88
94
|
from web3.types import (
|
|
89
|
-
ABI,
|
|
90
95
|
BlockIdentifier,
|
|
91
|
-
CallOverride,
|
|
92
96
|
EventData,
|
|
97
|
+
StateOverride,
|
|
93
98
|
TxParams,
|
|
94
99
|
)
|
|
95
|
-
from web3.utils import (
|
|
96
|
-
get_abi_input_names,
|
|
97
|
-
)
|
|
98
100
|
|
|
99
101
|
if TYPE_CHECKING:
|
|
100
102
|
from ens import AsyncENS # noqa: F401
|
|
@@ -109,11 +111,12 @@ class AsyncContractEvent(BaseContractEvent):
|
|
|
109
111
|
async def get_logs(
|
|
110
112
|
self,
|
|
111
113
|
argument_filters: Optional[Dict[str, Any]] = None,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
from_block: Optional[BlockIdentifier] = None,
|
|
115
|
+
to_block: Optional[BlockIdentifier] = None,
|
|
114
116
|
block_hash: Optional[HexBytes] = None,
|
|
115
117
|
) -> Awaitable[Iterable[EventData]]:
|
|
116
|
-
"""
|
|
118
|
+
"""
|
|
119
|
+
Get events for this contract instance using eth_getLogs API.
|
|
117
120
|
|
|
118
121
|
This is a stateless method, as opposed to createFilter.
|
|
119
122
|
It can be safely called against nodes which do not provide
|
|
@@ -132,7 +135,7 @@ class AsyncContractEvent(BaseContractEvent):
|
|
|
132
135
|
from = max(mycontract.web3.eth.block_number - 10, 1)
|
|
133
136
|
to = mycontract.web3.eth.block_number
|
|
134
137
|
|
|
135
|
-
events = mycontract.events.Transfer.getLogs(
|
|
138
|
+
events = mycontract.events.Transfer.getLogs(from_block=from, to_block=to)
|
|
136
139
|
|
|
137
140
|
for e in events:
|
|
138
141
|
print(e["args"]["from"],
|
|
@@ -158,14 +161,14 @@ class AsyncContractEvent(BaseContractEvent):
|
|
|
158
161
|
...
|
|
159
162
|
)
|
|
160
163
|
|
|
161
|
-
See also: :func:`web3.middleware.filter.
|
|
164
|
+
See also: :func:`web3.middleware.filter.LocalFilterMiddleware`.
|
|
162
165
|
|
|
163
166
|
:param argument_filters: Filter by argument values. Indexed arguments are
|
|
164
167
|
filtered by the node while non-indexed arguments are filtered by the library.
|
|
165
|
-
:param
|
|
166
|
-
:param
|
|
168
|
+
:param from_block: block number or "latest", defaults to "latest"
|
|
169
|
+
:param to_block: block number or "latest". Defaults to "latest"
|
|
167
170
|
:param block_hash: block hash. Cannot be set at the
|
|
168
|
-
same time as
|
|
171
|
+
same time as ``from_block`` or ``to_block``
|
|
169
172
|
:yield: Tuple of :class:`AttributeDict` instances
|
|
170
173
|
"""
|
|
171
174
|
event_abi = self._get_event_abi()
|
|
@@ -180,7 +183,7 @@ class AsyncContractEvent(BaseContractEvent):
|
|
|
180
183
|
)
|
|
181
184
|
|
|
182
185
|
_filter_params = self._get_event_filter_params(
|
|
183
|
-
event_abi, argument_filters,
|
|
186
|
+
event_abi, argument_filters, from_block, to_block, block_hash
|
|
184
187
|
)
|
|
185
188
|
# call JSON-RPC API
|
|
186
189
|
logs = await self.w3.eth.get_logs(_filter_params)
|
|
@@ -201,8 +204,8 @@ class AsyncContractEvent(BaseContractEvent):
|
|
|
201
204
|
self,
|
|
202
205
|
*, # PEP 3102
|
|
203
206
|
argument_filters: Optional[Dict[str, Any]] = None,
|
|
204
|
-
|
|
205
|
-
|
|
207
|
+
from_block: Optional[BlockIdentifier] = None,
|
|
208
|
+
to_block: BlockIdentifier = "latest",
|
|
206
209
|
address: Optional[ChecksumAddress] = None,
|
|
207
210
|
topics: Optional[Sequence[Any]] = None,
|
|
208
211
|
) -> AsyncLogFilter:
|
|
@@ -212,8 +215,8 @@ class AsyncContractEvent(BaseContractEvent):
|
|
|
212
215
|
filter_builder = AsyncEventFilterBuilder(self._get_event_abi(), self.w3.codec)
|
|
213
216
|
self._set_up_filter_builder(
|
|
214
217
|
argument_filters,
|
|
215
|
-
|
|
216
|
-
|
|
218
|
+
from_block,
|
|
219
|
+
to_block,
|
|
217
220
|
address,
|
|
218
221
|
topics,
|
|
219
222
|
filter_builder,
|
|
@@ -270,7 +273,7 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
270
273
|
self,
|
|
271
274
|
transaction: Optional[TxParams] = None,
|
|
272
275
|
block_identifier: BlockIdentifier = None,
|
|
273
|
-
state_override: Optional[
|
|
276
|
+
state_override: Optional[StateOverride] = None,
|
|
274
277
|
ccip_read_enabled: Optional[bool] = None,
|
|
275
278
|
) -> Any:
|
|
276
279
|
"""
|
|
@@ -308,7 +311,7 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
308
311
|
self.w3,
|
|
309
312
|
self.address,
|
|
310
313
|
self._return_data_normalizers,
|
|
311
|
-
self.
|
|
314
|
+
self.abi_element_identifier,
|
|
312
315
|
call_transaction,
|
|
313
316
|
block_id,
|
|
314
317
|
self.contract_abi,
|
|
@@ -325,7 +328,7 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
325
328
|
return await async_transact_with_contract_function(
|
|
326
329
|
self.address,
|
|
327
330
|
self.w3,
|
|
328
|
-
self.
|
|
331
|
+
self.abi_element_identifier,
|
|
329
332
|
setup_transaction,
|
|
330
333
|
self.contract_abi,
|
|
331
334
|
self.abi,
|
|
@@ -337,13 +340,13 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
337
340
|
self,
|
|
338
341
|
transaction: Optional[TxParams] = None,
|
|
339
342
|
block_identifier: Optional[BlockIdentifier] = None,
|
|
340
|
-
state_override: Optional[
|
|
343
|
+
state_override: Optional[StateOverride] = None,
|
|
341
344
|
) -> int:
|
|
342
345
|
setup_transaction = self._estimate_gas(transaction)
|
|
343
346
|
return await async_estimate_gas_for_function(
|
|
344
347
|
self.address,
|
|
345
348
|
self.w3,
|
|
346
|
-
self.
|
|
349
|
+
self.abi_element_identifier,
|
|
347
350
|
setup_transaction,
|
|
348
351
|
self.contract_abi,
|
|
349
352
|
self.abi,
|
|
@@ -360,7 +363,7 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
360
363
|
return await async_build_transaction_for_function(
|
|
361
364
|
self.address,
|
|
362
365
|
self.w3,
|
|
363
|
-
self.
|
|
366
|
+
self.abi_element_identifier,
|
|
364
367
|
built_transaction,
|
|
365
368
|
self.contract_abi,
|
|
366
369
|
self.abi,
|
|
@@ -380,7 +383,7 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
380
383
|
w3=async_w3,
|
|
381
384
|
contract_abi=abi,
|
|
382
385
|
address=address,
|
|
383
|
-
|
|
386
|
+
abi_element_identifier=FallbackFn,
|
|
384
387
|
)()
|
|
385
388
|
return cast(AsyncContractFunction, NonExistentFallbackFunction())
|
|
386
389
|
|
|
@@ -396,7 +399,7 @@ class AsyncContractFunction(BaseContractFunction):
|
|
|
396
399
|
w3=async_w3,
|
|
397
400
|
contract_abi=abi,
|
|
398
401
|
address=address,
|
|
399
|
-
|
|
402
|
+
abi_element_identifier=ReceiveFn,
|
|
400
403
|
)()
|
|
401
404
|
return cast(AsyncContractFunction, NonExistentReceiveFunction())
|
|
402
405
|
|
|
@@ -441,12 +444,13 @@ class AsyncContract(BaseContract):
|
|
|
441
444
|
events: AsyncContractEvents = None
|
|
442
445
|
|
|
443
446
|
def __init__(self, address: Optional[ChecksumAddress] = None) -> None:
|
|
444
|
-
"""
|
|
445
|
-
|
|
446
|
-
:param address: Contract address as 0x hex string"""
|
|
447
|
+
"""
|
|
448
|
+
Create a new smart contract proxy object.
|
|
447
449
|
|
|
450
|
+
:param address: Contract address as 0x hex string
|
|
451
|
+
"""
|
|
448
452
|
if self.w3 is None:
|
|
449
|
-
raise
|
|
453
|
+
raise Web3AttributeError(
|
|
450
454
|
"The `Contract` class has not been initialized. Please use the "
|
|
451
455
|
"`web3.contract` interface to create your contract class."
|
|
452
456
|
)
|
|
@@ -455,7 +459,7 @@ class AsyncContract(BaseContract):
|
|
|
455
459
|
self.address = normalize_address_no_ens(address)
|
|
456
460
|
|
|
457
461
|
if not self.address:
|
|
458
|
-
raise
|
|
462
|
+
raise Web3TypeError(
|
|
459
463
|
"The address argument is required to instantiate a contract."
|
|
460
464
|
)
|
|
461
465
|
self.functions = AsyncContractFunctions(
|
|
@@ -517,14 +521,14 @@ class AsyncContract(BaseContract):
|
|
|
517
521
|
return contract
|
|
518
522
|
|
|
519
523
|
@classmethod
|
|
520
|
-
def constructor(cls, *args: Any, **kwargs: Any) ->
|
|
524
|
+
def constructor(cls, *args: Any, **kwargs: Any) -> "AsyncContractConstructor":
|
|
521
525
|
"""
|
|
522
526
|
:param args: The contract constructor arguments as positional arguments
|
|
523
527
|
:param kwargs: The contract constructor arguments as keyword arguments
|
|
524
528
|
:return: a contract constructor object
|
|
525
529
|
"""
|
|
526
530
|
if cls.bytecode is None:
|
|
527
|
-
raise
|
|
531
|
+
raise Web3ValueError(
|
|
528
532
|
"Cannot call constructor on a contract that does not have "
|
|
529
533
|
"'bytecode' associated with it"
|
|
530
534
|
)
|
|
@@ -573,26 +577,23 @@ class AsyncContractCaller(BaseContractCaller):
|
|
|
573
577
|
if transaction is None:
|
|
574
578
|
transaction = {}
|
|
575
579
|
|
|
576
|
-
self._functions =
|
|
580
|
+
self._functions = get_all_function_abis(self.abi)
|
|
581
|
+
|
|
577
582
|
for func in self._functions:
|
|
578
583
|
fn = AsyncContractFunction.factory(
|
|
579
584
|
func["name"],
|
|
580
585
|
w3=w3,
|
|
581
586
|
contract_abi=self.abi,
|
|
582
587
|
address=self.address,
|
|
583
|
-
|
|
588
|
+
abi_element_identifier=func["name"],
|
|
584
589
|
decode_tuples=decode_tuples,
|
|
585
590
|
)
|
|
586
591
|
|
|
587
|
-
# TODO: The no_extra_call method gets around the fact that we can't call
|
|
588
|
-
# the full async method from within a class's __init__ method. We need
|
|
589
|
-
# to see if there's a way to account for all desired elif cases.
|
|
590
|
-
block_id = parse_block_identifier_no_extra_call(w3, block_identifier)
|
|
591
592
|
caller_method = partial(
|
|
592
593
|
self.call_function,
|
|
593
594
|
fn,
|
|
594
595
|
transaction=transaction,
|
|
595
|
-
block_identifier=
|
|
596
|
+
block_identifier=block_identifier,
|
|
596
597
|
ccip_read_enabled=ccip_read_enabled,
|
|
597
598
|
)
|
|
598
599
|
|