web3 7.0.0b1__tar.gz → 7.0.0b2__tar.gz
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.
- {web3-7.0.0b1 → web3-7.0.0b2}/MANIFEST.in +0 -4
- {web3-7.0.0b1 → web3-7.0.0b2}/PKG-INFO +1 -9
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/async_ens.py +4 -6
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/ens.py +4 -4
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/utils.py +10 -10
- {web3-7.0.0b1 → web3-7.0.0b2}/setup.py +2 -11
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/abi.py +9 -15
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/module_testing_utils.py +2 -2
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/request.py +1 -1
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/datastructures.py +7 -7
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/main.py +4 -30
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/manager.py +6 -6
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/__init__.py +9 -8
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/module.py +1 -1
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/async_base.py +6 -6
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/base.py +8 -8
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/eth_tester/main.py +16 -20
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/ipc.py +1 -1
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/legacy_websocket.py +1 -1
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/persistent.py +1 -1
- {web3-7.0.0b1 → web3-7.0.0b2}/web3.egg-info/PKG-INFO +1 -9
- {web3-7.0.0b1 → web3-7.0.0b2}/web3.egg-info/SOURCES.txt +0 -117
- {web3-7.0.0b1 → web3-7.0.0b2}/web3.egg-info/requires.txt +0 -9
- {web3-7.0.0b1 → web3-7.0.0b2}/web3.egg-info/top_level.txt +0 -1
- web3-7.0.0b1/ethpm/__init__.py +0 -20
- web3-7.0.0b1/ethpm/_utils/backend.py +0 -93
- web3-7.0.0b1/ethpm/_utils/cache.py +0 -44
- web3-7.0.0b1/ethpm/_utils/chains.py +0 -119
- web3-7.0.0b1/ethpm/_utils/contract.py +0 -35
- web3-7.0.0b1/ethpm/_utils/deployments.py +0 -145
- web3-7.0.0b1/ethpm/_utils/ipfs.py +0 -116
- web3-7.0.0b1/ethpm/_utils/protobuf/ipfs_file_pb2.py +0 -33
- web3-7.0.0b1/ethpm/_utils/registry.py +0 -29
- web3-7.0.0b1/ethpm/assets/ens/v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/escrow/with_bytecode_v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/ipfs_file.proto +0 -32
- web3-7.0.0b1/ethpm/assets/owned/output_v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/owned/with_contract_type_v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/registry/contracts/Authority.sol +0 -156
- web3-7.0.0b1/ethpm/assets/registry/contracts/IndexedOrderedSetLib.sol +0 -106
- web3-7.0.0b1/ethpm/assets/registry/contracts/PackageDB.sol +0 -225
- web3-7.0.0b1/ethpm/assets/registry/contracts/PackageRegistry.sol +0 -361
- web3-7.0.0b1/ethpm/assets/registry/contracts/PackageRegistryInterface.sol +0 -97
- web3-7.0.0b1/ethpm/assets/registry/contracts/ReleaseDB.sol +0 -309
- web3-7.0.0b1/ethpm/assets/registry/contracts/ReleaseValidator.sol +0 -152
- web3-7.0.0b1/ethpm/assets/registry/solc_input.json +0 -1
- web3-7.0.0b1/ethpm/assets/registry/solc_output.json +0 -1
- web3-7.0.0b1/ethpm/assets/registry/v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/safe-math-lib/v3-strict-no-deployments.json +0 -1
- web3-7.0.0b1/ethpm/assets/simple-registry/contracts/Ownable.sol +0 -63
- web3-7.0.0b1/ethpm/assets/simple-registry/contracts/PackageRegistry.sol +0 -373
- web3-7.0.0b1/ethpm/assets/simple-registry/contracts/PackageRegistryInterface.sol +0 -96
- web3-7.0.0b1/ethpm/assets/simple-registry/solc_input.json +0 -33
- web3-7.0.0b1/ethpm/assets/simple-registry/solc_output.json +0 -1
- web3-7.0.0b1/ethpm/assets/simple-registry/v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/standard-token/output_v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/standard-token/with_bytecode_v3.json +0 -1
- web3-7.0.0b1/ethpm/assets/vyper_registry/0.1.0.json +0 -1
- web3-7.0.0b1/ethpm/assets/vyper_registry/registry.vy +0 -216
- web3-7.0.0b1/ethpm/assets/vyper_registry/registry_with_delete.vy +0 -244
- web3-7.0.0b1/ethpm/backends/base.py +0 -43
- web3-7.0.0b1/ethpm/backends/http.py +0 -108
- web3-7.0.0b1/ethpm/backends/ipfs.py +0 -219
- web3-7.0.0b1/ethpm/backends/registry.py +0 -154
- web3-7.0.0b1/ethpm/constants.py +0 -17
- web3-7.0.0b1/ethpm/contract.py +0 -187
- web3-7.0.0b1/ethpm/dependencies.py +0 -58
- web3-7.0.0b1/ethpm/deployments.py +0 -80
- web3-7.0.0b1/ethpm/ethpm-spec/examples/escrow/1.0.0-pretty.json +0 -146
- web3-7.0.0b1/ethpm/ethpm-spec/examples/escrow/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/escrow/contracts/Escrow.sol +0 -32
- web3-7.0.0b1/ethpm/ethpm-spec/examples/escrow/contracts/SafeSendLib.sol +0 -20
- web3-7.0.0b1/ethpm/ethpm-spec/examples/escrow/v3-pretty.json +0 -171
- web3-7.0.0b1/ethpm/ethpm-spec/examples/escrow/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/owned/1.0.0-pretty.json +0 -21
- web3-7.0.0b1/ethpm/ethpm-spec/examples/owned/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/owned/contracts/Owned.sol +0 -12
- web3-7.0.0b1/ethpm/ethpm-spec/examples/owned/v3-pretty.json +0 -27
- web3-7.0.0b1/ethpm/ethpm-spec/examples/owned/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/piper-coin/1.0.0-pretty.json +0 -31
- web3-7.0.0b1/ethpm/ethpm-spec/examples/piper-coin/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/piper-coin/v3-pretty.json +0 -21
- web3-7.0.0b1/ethpm/ethpm-spec/examples/piper-coin/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/safe-math-lib/1.0.0-pretty.json +0 -85
- web3-7.0.0b1/ethpm/ethpm-spec/examples/safe-math-lib/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/safe-math-lib/contracts/SafeMathLib.sol +0 -24
- web3-7.0.0b1/ethpm/ethpm-spec/examples/safe-math-lib/v3-pretty.json +0 -117
- web3-7.0.0b1/ethpm/ethpm-spec/examples/safe-math-lib/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/standard-token/1.0.0-pretty.json +0 -55
- web3-7.0.0b1/ethpm/ethpm-spec/examples/standard-token/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/standard-token/contracts/AbstractToken.sol +0 -20
- web3-7.0.0b1/ethpm/ethpm-spec/examples/standard-token/contracts/StandardToken.sol +0 -84
- web3-7.0.0b1/ethpm/ethpm-spec/examples/standard-token/v3-pretty.json +0 -460
- web3-7.0.0b1/ethpm/ethpm-spec/examples/standard-token/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/transferable/1.0.0-pretty.json +0 -21
- web3-7.0.0b1/ethpm/ethpm-spec/examples/transferable/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/transferable/contracts/Transferable.sol +0 -14
- web3-7.0.0b1/ethpm/ethpm-spec/examples/transferable/v3-pretty.json +0 -27
- web3-7.0.0b1/ethpm/ethpm-spec/examples/transferable/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet/1.0.0-pretty.json +0 -120
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet/contracts/Wallet.sol +0 -41
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet/v3-pretty.json +0 -181
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet-with-send/1.0.0-pretty.json +0 -135
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet-with-send/1.0.0.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet-with-send/contracts/WalletWithSend.sol +0 -18
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet-with-send/v3-pretty.json +0 -207
- web3-7.0.0b1/ethpm/ethpm-spec/examples/wallet-with-send/v3.json +0 -1
- web3-7.0.0b1/ethpm/ethpm-spec/spec/package.spec.json +0 -379
- web3-7.0.0b1/ethpm/ethpm-spec/spec/v3.spec.json +0 -483
- web3-7.0.0b1/ethpm/exceptions.py +0 -68
- web3-7.0.0b1/ethpm/package.py +0 -438
- web3-7.0.0b1/ethpm/tools/__init__.py +0 -4
- web3-7.0.0b1/ethpm/tools/builder.py +0 -930
- web3-7.0.0b1/ethpm/tools/checker.py +0 -312
- web3-7.0.0b1/ethpm/tools/get_manifest.py +0 -19
- web3-7.0.0b1/ethpm/uri.py +0 -141
- web3-7.0.0b1/ethpm/validation/manifest.py +0 -146
- web3-7.0.0b1/ethpm/validation/misc.py +0 -39
- web3-7.0.0b1/ethpm/validation/package.py +0 -80
- web3-7.0.0b1/ethpm/validation/uri.py +0 -163
- web3-7.0.0b1/web3/_utils/contract_sources/__init__.py +0 -0
- web3-7.0.0b1/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- web3-7.0.0b1/web3/gas_strategies/__init__.py +0 -0
- web3-7.0.0b1/web3/pm.py +0 -602
- web3-7.0.0b1/web3/scripts/__init__.py +0 -0
- web3-7.0.0b1/web3/scripts/release/__init__.py +0 -0
- web3-7.0.0b1/web3/tools/__init__.py +0 -4
- web3-7.0.0b1/web3/tools/benchmark/__init__.py +0 -0
- web3-7.0.0b1/web3/tools/benchmark/main.py +0 -185
- web3-7.0.0b1/web3/tools/benchmark/node.py +0 -126
- web3-7.0.0b1/web3/tools/benchmark/reporting.py +0 -39
- web3-7.0.0b1/web3/tools/benchmark/utils.py +0 -69
- web3-7.0.0b1/web3/tools/pytest_ethereum/__init__.py +0 -0
- web3-7.0.0b1/web3/tools/pytest_ethereum/_utils.py +0 -145
- web3-7.0.0b1/web3/tools/pytest_ethereum/deployer.py +0 -48
- web3-7.0.0b1/web3/tools/pytest_ethereum/exceptions.py +0 -22
- web3-7.0.0b1/web3/tools/pytest_ethereum/linker.py +0 -128
- web3-7.0.0b1/web3/tools/pytest_ethereum/plugins.py +0 -33
- web3-7.0.0b1/web3.egg-info/entry_points.txt +0 -2
- {web3-7.0.0b1 → web3-7.0.0b2}/LICENSE +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/README.md +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/_normalization.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/abis.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/auto.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/base_ens.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/constants.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/contract_data.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/exceptions.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/specs/nf.json +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/ens/specs/normalization_spec.json +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/pyproject.toml +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/setup.cfg +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/__init__.py +0 -0
- {web3-7.0.0b1/ethpm → web3-7.0.0b2/web3}/_utils/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/async_caching.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/async_transactions.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/blocks.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/caching.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/compat/__init__.py +0 -0
- {web3-7.0.0b1/ethpm/_utils/protobuf → web3-7.0.0b2/web3/_utils/contract_sources}/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.0.0b1/ethpm/assets → web3-7.0.0b2/web3/_utils/contract_sources/contract_data}/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/address_reflector.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/event_contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/contracts.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/datatypes.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/decorators.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/empty.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/encoding.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/ens.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/error_formatters_utils.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/events.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/fee_utils.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/filters.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/formatters.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/function_identifiers.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/http.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/hypothesis.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/math.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/method_formatters.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/eth_module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/go_ethereum_personal_module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/persistent_connection_provider.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/module_testing/web3_module.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/normalizers.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/rpc_abi.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/threads.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/transactions.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/type_conversion.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/utility_methods.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/validation.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/_utils/windows.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/auto/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/auto/gethdev.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/beacon/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/beacon/api_endpoints.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/beacon/async_beacon.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/beacon/beacon.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/constants.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/contract/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/contract/async_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/contract/base_contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/contract/contract.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/contract/utils.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/eth/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/eth/async_eth.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/eth/base_eth.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/eth/eth.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/exceptions.py +0 -0
- {web3-7.0.0b1/ethpm/backends → web3-7.0.0b2/web3/gas_strategies}/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/gas_strategies/time_based.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/geth.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/logs.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/method.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/attrdict.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/base.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/filter.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/formatting.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/names.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/pythonic.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/signing.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/stalecheck.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/middleware/validation.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/net.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/auto.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/eth_tester/defaults.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/async_ipc.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/persistent_connection.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/request_processor.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/utils.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/persistent/websocket.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/rpc/async_rpc.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/rpc/rpc.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/providers/rpc/utils.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/py.typed +0 -0
- {web3-7.0.0b1/ethpm/validation → web3-7.0.0b2/web3/scripts}/__init__.py +0 -0
- {web3-7.0.0b1/web3/_utils → web3-7.0.0b2/web3/scripts/release}/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/scripts/release/test_package.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/testing.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/tracing.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/types.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/utils/__init__.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/utils/abi.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/utils/address.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/utils/caching.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3/utils/exception_handling.py +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.0.0b1 → web3-7.0.0b2}/web3.egg-info/not-zip-safe +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: web3
|
|
3
|
-
Version: 7.0.
|
|
3
|
+
Version: 7.0.0b2
|
|
4
4
|
Summary: web3.py
|
|
5
5
|
Home-page: https://github.com/ethereum/web3.py
|
|
6
6
|
Author: The Ethereum Foundation
|
|
@@ -26,8 +26,6 @@ Requires-Dist: eth-hash[pycryptodome]>=0.5.1
|
|
|
26
26
|
Requires-Dist: eth-typing>=3.0.0
|
|
27
27
|
Requires-Dist: eth-utils>=4.0.0
|
|
28
28
|
Requires-Dist: hexbytes<0.4.0,>=0.1.0
|
|
29
|
-
Requires-Dist: jsonschema>=4.0.0
|
|
30
|
-
Requires-Dist: protobuf>=4.21.6
|
|
31
29
|
Requires-Dist: pydantic>=2.4.0
|
|
32
30
|
Requires-Dist: pywin32>=223; platform_system == "Windows"
|
|
33
31
|
Requires-Dist: requests>=2.16.0
|
|
@@ -44,7 +42,6 @@ Requires-Dist: isort>=5.11.0; extra == "linter"
|
|
|
44
42
|
Requires-Dist: mypy==1.4.1; extra == "linter"
|
|
45
43
|
Requires-Dist: types-setuptools>=57.4.4; extra == "linter"
|
|
46
44
|
Requires-Dist: types-requests>=2.26.1; extra == "linter"
|
|
47
|
-
Requires-Dist: types-protobuf==3.19.13; extra == "linter"
|
|
48
45
|
Provides-Extra: docs
|
|
49
46
|
Requires-Dist: sphinx>=5.3.0; extra == "docs"
|
|
50
47
|
Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "docs"
|
|
@@ -58,11 +55,9 @@ Requires-Dist: isort>=5.11.0; extra == "dev"
|
|
|
58
55
|
Requires-Dist: mypy==1.4.1; extra == "dev"
|
|
59
56
|
Requires-Dist: types-setuptools>=57.4.4; extra == "dev"
|
|
60
57
|
Requires-Dist: types-requests>=2.26.1; extra == "dev"
|
|
61
|
-
Requires-Dist: types-protobuf==3.19.13; extra == "dev"
|
|
62
58
|
Requires-Dist: sphinx>=5.3.0; extra == "dev"
|
|
63
59
|
Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "dev"
|
|
64
60
|
Requires-Dist: towncrier<22,>=21; extra == "dev"
|
|
65
|
-
Requires-Dist: ipfshttpclient==0.8.0a2; extra == "dev"
|
|
66
61
|
Requires-Dist: bumpversion; extra == "dev"
|
|
67
62
|
Requires-Dist: flaky>=3.7.0; extra == "dev"
|
|
68
63
|
Requires-Dist: hypothesis>=3.31.2; extra == "dev"
|
|
@@ -76,10 +71,7 @@ Requires-Dist: setuptools>=38.6.0; extra == "dev"
|
|
|
76
71
|
Requires-Dist: tox>=3.18.0; extra == "dev"
|
|
77
72
|
Requires-Dist: tqdm>4.32; extra == "dev"
|
|
78
73
|
Requires-Dist: twine>=1.13; extra == "dev"
|
|
79
|
-
Requires-Dist: when-changed>=0.3.0; extra == "dev"
|
|
80
74
|
Requires-Dist: build>=0.9.0; extra == "dev"
|
|
81
|
-
Provides-Extra: ipfs
|
|
82
|
-
Requires-Dist: ipfshttpclient==0.8.0a2; extra == "ipfs"
|
|
83
75
|
|
|
84
76
|
# web3.py
|
|
85
77
|
|
|
@@ -100,7 +100,7 @@ class AsyncENS(BaseENS):
|
|
|
100
100
|
self,
|
|
101
101
|
provider: "AsyncBaseProvider" = cast("AsyncBaseProvider", default),
|
|
102
102
|
addr: ChecksumAddress = None,
|
|
103
|
-
|
|
103
|
+
middleware: Optional[Sequence[Tuple["Middleware", str]]] = None,
|
|
104
104
|
) -> None:
|
|
105
105
|
"""
|
|
106
106
|
:param provider: a single provider used to connect to Ethereum
|
|
@@ -108,7 +108,7 @@ class AsyncENS(BaseENS):
|
|
|
108
108
|
:param hex-string addr: the address of the ENS registry on-chain.
|
|
109
109
|
If not provided, ENS.py will default to the mainnet ENS registry address.
|
|
110
110
|
"""
|
|
111
|
-
self.w3 = init_async_web3(provider,
|
|
111
|
+
self.w3 = init_async_web3(provider, middleware)
|
|
112
112
|
|
|
113
113
|
ens_addr = addr if addr else ENS_MAINNET_ADDR
|
|
114
114
|
self.ens = self.w3.eth.contract(abi=abis.ENS, address=ens_addr)
|
|
@@ -129,10 +129,8 @@ class AsyncENS(BaseENS):
|
|
|
129
129
|
provided, defaults to the mainnet ENS registry address.
|
|
130
130
|
"""
|
|
131
131
|
provider = w3.manager.provider
|
|
132
|
-
|
|
133
|
-
ns = cls(
|
|
134
|
-
cast("AsyncBaseProvider", provider), addr=addr, middlewares=middlewares
|
|
135
|
-
)
|
|
132
|
+
middleware = w3.middleware_onion.middleware
|
|
133
|
+
ns = cls(cast("AsyncBaseProvider", provider), addr=addr, middleware=middleware)
|
|
136
134
|
|
|
137
135
|
# inherit strict bytes checking from w3 instance
|
|
138
136
|
ns.strict_bytes_type_checking = w3.strict_bytes_type_checking
|
|
@@ -99,7 +99,7 @@ class ENS(BaseENS):
|
|
|
99
99
|
self,
|
|
100
100
|
provider: "BaseProvider" = cast("BaseProvider", default),
|
|
101
101
|
addr: ChecksumAddress = None,
|
|
102
|
-
|
|
102
|
+
middleware: Optional[Sequence[Tuple["Middleware", str]]] = None,
|
|
103
103
|
) -> None:
|
|
104
104
|
"""
|
|
105
105
|
:param provider: a single provider used to connect to Ethereum
|
|
@@ -108,7 +108,7 @@ class ENS(BaseENS):
|
|
|
108
108
|
If not provided, ENS.py will default to the mainnet ENS
|
|
109
109
|
registry address.
|
|
110
110
|
"""
|
|
111
|
-
self.w3 = init_web3(provider,
|
|
111
|
+
self.w3 = init_web3(provider, middleware)
|
|
112
112
|
|
|
113
113
|
ens_addr = addr if addr else ENS_MAINNET_ADDR
|
|
114
114
|
self.ens = self.w3.eth.contract(abi=abis.ENS, address=ens_addr)
|
|
@@ -129,8 +129,8 @@ class ENS(BaseENS):
|
|
|
129
129
|
provided, defaults to the mainnet ENS registry address.
|
|
130
130
|
"""
|
|
131
131
|
provider = w3.manager.provider
|
|
132
|
-
|
|
133
|
-
ns = cls(cast("BaseProvider", provider), addr=addr,
|
|
132
|
+
middleware = w3.middleware_onion.middleware
|
|
133
|
+
ns = cls(cast("BaseProvider", provider), addr=addr, middleware=middleware)
|
|
134
134
|
|
|
135
135
|
# inherit strict bytes checking from w3 instance
|
|
136
136
|
ns.strict_bytes_type_checking = w3.strict_bytes_type_checking
|
|
@@ -81,7 +81,7 @@ def Web3() -> Type["_Web3"]:
|
|
|
81
81
|
|
|
82
82
|
def init_web3(
|
|
83
83
|
provider: "BaseProvider" = cast("BaseProvider", default),
|
|
84
|
-
|
|
84
|
+
middleware: Optional[Sequence[Tuple["Middleware", str]]] = None,
|
|
85
85
|
) -> "_Web3":
|
|
86
86
|
from web3 import (
|
|
87
87
|
Web3 as Web3Main,
|
|
@@ -93,7 +93,7 @@ def init_web3(
|
|
|
93
93
|
if provider is default:
|
|
94
94
|
w3 = Web3Main(ens=None, modules={"eth": (EthMain)})
|
|
95
95
|
else:
|
|
96
|
-
w3 = Web3Main(provider,
|
|
96
|
+
w3 = Web3Main(provider, middleware, ens=None, modules={"eth": (EthMain)})
|
|
97
97
|
|
|
98
98
|
return customize_web3(w3)
|
|
99
99
|
|
|
@@ -299,7 +299,7 @@ def get_abi_output_types(abi: "ABIFunction") -> List[str]:
|
|
|
299
299
|
|
|
300
300
|
def init_async_web3(
|
|
301
301
|
provider: "AsyncBaseProvider" = cast("AsyncBaseProvider", default),
|
|
302
|
-
|
|
302
|
+
middleware: Optional[Sequence[Tuple["Middleware", str]]] = (),
|
|
303
303
|
) -> "AsyncWeb3":
|
|
304
304
|
from web3 import (
|
|
305
305
|
AsyncWeb3 as AsyncWeb3Main,
|
|
@@ -311,13 +311,13 @@ def init_async_web3(
|
|
|
311
311
|
StalecheckMiddlewareBuilder,
|
|
312
312
|
)
|
|
313
313
|
|
|
314
|
-
|
|
315
|
-
for i, (
|
|
314
|
+
middleware = list(middleware)
|
|
315
|
+
for i, (mw, name) in enumerate(middleware):
|
|
316
316
|
if name == "ens_name_to_address":
|
|
317
|
-
|
|
317
|
+
middleware.pop(i)
|
|
318
318
|
|
|
319
|
-
if "stalecheck" not in (name for mw, name in
|
|
320
|
-
|
|
319
|
+
if "stalecheck" not in (name for mw, name in middleware):
|
|
320
|
+
middleware.append(
|
|
321
321
|
(
|
|
322
322
|
StalecheckMiddlewareBuilder.build(ACCEPTABLE_STALE_HOURS * 3600),
|
|
323
323
|
"stalecheck",
|
|
@@ -326,12 +326,12 @@ def init_async_web3(
|
|
|
326
326
|
|
|
327
327
|
if provider is default:
|
|
328
328
|
async_w3 = AsyncWeb3Main(
|
|
329
|
-
|
|
329
|
+
middleware=middleware, ens=None, modules={"eth": (AsyncEthMain)}
|
|
330
330
|
)
|
|
331
331
|
else:
|
|
332
332
|
async_w3 = AsyncWeb3Main(
|
|
333
333
|
provider,
|
|
334
|
-
|
|
334
|
+
middleware=middleware,
|
|
335
335
|
ens=None,
|
|
336
336
|
modules={"eth": (AsyncEthMain)},
|
|
337
337
|
)
|
|
@@ -16,7 +16,6 @@ extras_require = {
|
|
|
16
16
|
"mypy==1.4.1",
|
|
17
17
|
"types-setuptools>=57.4.4",
|
|
18
18
|
"types-requests>=2.26.1",
|
|
19
|
-
"types-protobuf==3.19.13",
|
|
20
19
|
],
|
|
21
20
|
"docs": [
|
|
22
21
|
"sphinx>=5.3.0",
|
|
@@ -37,19 +36,14 @@ extras_require = {
|
|
|
37
36
|
"tox>=3.18.0",
|
|
38
37
|
"tqdm>4.32",
|
|
39
38
|
"twine>=1.13",
|
|
40
|
-
"when-changed>=0.3.0",
|
|
41
39
|
"build>=0.9.0",
|
|
42
40
|
],
|
|
43
|
-
"ipfs": [
|
|
44
|
-
"ipfshttpclient==0.8.0a2",
|
|
45
|
-
],
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
extras_require["dev"] = (
|
|
49
44
|
extras_require["tester"]
|
|
50
45
|
+ extras_require["linter"]
|
|
51
46
|
+ extras_require["docs"]
|
|
52
|
-
+ extras_require["ipfs"]
|
|
53
47
|
+ extras_require["dev"]
|
|
54
48
|
)
|
|
55
49
|
|
|
@@ -59,7 +53,7 @@ with open("./README.md") as readme:
|
|
|
59
53
|
setup(
|
|
60
54
|
name="web3",
|
|
61
55
|
# *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility.
|
|
62
|
-
version="7.0.0-beta.
|
|
56
|
+
version="7.0.0-beta.2",
|
|
63
57
|
description="""web3.py""",
|
|
64
58
|
long_description_content_type="text/markdown",
|
|
65
59
|
long_description=long_description,
|
|
@@ -75,8 +69,6 @@ setup(
|
|
|
75
69
|
"eth-typing>=3.0.0",
|
|
76
70
|
"eth-utils>=4.0.0",
|
|
77
71
|
"hexbytes>=0.1.0,<0.4.0",
|
|
78
|
-
"jsonschema>=4.0.0",
|
|
79
|
-
"protobuf>=4.21.6",
|
|
80
72
|
"pydantic>=2.4.0",
|
|
81
73
|
"pywin32>=223;platform_system=='Windows'",
|
|
82
74
|
"requests>=2.16.0",
|
|
@@ -86,8 +78,7 @@ setup(
|
|
|
86
78
|
],
|
|
87
79
|
python_requires=">=3.8",
|
|
88
80
|
extras_require=extras_require,
|
|
89
|
-
py_modules=["web3", "ens"
|
|
90
|
-
entry_points={"pytest11": ["pytest_ethereum = web3.tools.pytest_ethereum.plugins"]},
|
|
81
|
+
py_modules=["web3", "ens"],
|
|
91
82
|
license="MIT",
|
|
92
83
|
zip_safe=False,
|
|
93
84
|
keywords="ethereum",
|
|
@@ -51,7 +51,6 @@ from eth_typing import (
|
|
|
51
51
|
TypeStr,
|
|
52
52
|
)
|
|
53
53
|
from eth_utils import (
|
|
54
|
-
combomethod,
|
|
55
54
|
decode_hex,
|
|
56
55
|
is_bytes,
|
|
57
56
|
is_list_like,
|
|
@@ -211,10 +210,7 @@ class AcceptsHexStrEncoder(encoding.BaseEncoder):
|
|
|
211
210
|
) -> None:
|
|
212
211
|
super().__init__(**kwargs)
|
|
213
212
|
self.subencoder = subencoder
|
|
214
|
-
|
|
215
|
-
@property
|
|
216
|
-
def is_dynamic(self) -> bool:
|
|
217
|
-
return self.subencoder.is_dynamic
|
|
213
|
+
self.is_dynamic = subencoder.is_dynamic
|
|
218
214
|
|
|
219
215
|
@classmethod
|
|
220
216
|
def from_type_str(
|
|
@@ -234,10 +230,9 @@ class AcceptsHexStrEncoder(encoding.BaseEncoder):
|
|
|
234
230
|
raise AttributeError(f"No subencoder class is set. {cls.__name__}")
|
|
235
231
|
return cls.subencoder_cls
|
|
236
232
|
|
|
237
|
-
@combomethod
|
|
238
233
|
def validate_value(self, value: Any) -> None:
|
|
239
234
|
normalized_value = self.validate_and_normalize(value)
|
|
240
|
-
|
|
235
|
+
self.subencoder.validate_value(normalized_value)
|
|
241
236
|
|
|
242
237
|
def encode(self, value: Any) -> bytes:
|
|
243
238
|
normalized_value = self.validate_and_normalize(value)
|
|
@@ -308,15 +303,14 @@ class ExactLengthBytesEncoder(BytesEncoder):
|
|
|
308
303
|
raise ValueError("Value byte size exceeds data size")
|
|
309
304
|
|
|
310
305
|
@parse_type_str("bytes")
|
|
311
|
-
def from_type_str(
|
|
306
|
+
def from_type_str(
|
|
307
|
+
cls, abi_type: BasicType, registry: ABIRegistry
|
|
308
|
+
) -> "ExactLengthBytesEncoder":
|
|
312
309
|
subencoder_cls = cls.get_subencoder_class()
|
|
313
|
-
|
|
314
|
-
#
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
subencoder_cls.from_type_str(abi_type.to_type_str(), registry),
|
|
318
|
-
)
|
|
319
|
-
return cls(
|
|
310
|
+
subencoder = subencoder_cls.from_type_str(abi_type.to_type_str(), registry)
|
|
311
|
+
# type ignored b/c @parse_type_str decorator turns it into a classmethod,
|
|
312
|
+
# so mypy thinks cls(...) is a call to __call__, but actually calls __init__
|
|
313
|
+
return cls( # type: ignore
|
|
320
314
|
subencoder,
|
|
321
315
|
value_bit_size=abi_type.sub * 8,
|
|
322
316
|
data_byte_size=abi_type.sub,
|
|
@@ -104,7 +104,7 @@ def mock_offchain_lookup_request_response(
|
|
|
104
104
|
|
|
105
105
|
# mock response only to specified url while validating appropriate fields
|
|
106
106
|
if url_from_args == mocked_request_url:
|
|
107
|
-
assert kwargs["timeout"] ==
|
|
107
|
+
assert kwargs["timeout"] == 30
|
|
108
108
|
if http_method.upper() == "POST":
|
|
109
109
|
assert kwargs["data"] == {"data": calldata, "sender": sender}
|
|
110
110
|
return MockedResponse()
|
|
@@ -154,7 +154,7 @@ def async_mock_offchain_lookup_request_response(
|
|
|
154
154
|
|
|
155
155
|
# mock response only to specified url while validating appropriate fields
|
|
156
156
|
if url_from_args == mocked_request_url:
|
|
157
|
-
assert kwargs["timeout"] == ClientTimeout(
|
|
157
|
+
assert kwargs["timeout"] == ClientTimeout(30)
|
|
158
158
|
if http_method.upper() == "post":
|
|
159
159
|
assert kwargs["data"] == {"data": calldata, "sender": sender}
|
|
160
160
|
return AsyncMockedResponse()
|
|
@@ -252,9 +252,9 @@ class NamedElementOnion(Mapping[TKey, TValue]):
|
|
|
252
252
|
del self._queue[old_name]
|
|
253
253
|
|
|
254
254
|
@property
|
|
255
|
-
def
|
|
255
|
+
def middleware(self) -> Sequence[Any]:
|
|
256
256
|
"""
|
|
257
|
-
Returns
|
|
257
|
+
Returns middleware in the appropriate order to be imported into a new Web3
|
|
258
258
|
instance (reversed _queue order) as a list of (middleware, name) tuples.
|
|
259
259
|
"""
|
|
260
260
|
return [(val, key) for key, val in reversed(self._queue.items())]
|
|
@@ -301,24 +301,24 @@ class NamedElementOnion(Mapping[TKey, TValue]):
|
|
|
301
301
|
|
|
302
302
|
# --- iter and tupleize methods --- #
|
|
303
303
|
|
|
304
|
-
def
|
|
304
|
+
def _reversed_middleware(self) -> Iterator[TValue]:
|
|
305
305
|
elements = self._queue.values()
|
|
306
306
|
if not isinstance(elements, Sequence):
|
|
307
307
|
# type ignored b/c elements is set as _OrderedDictValuesView[Any] on 210
|
|
308
308
|
elements = list(elements) # type: ignore
|
|
309
309
|
return reversed(elements)
|
|
310
310
|
|
|
311
|
-
def
|
|
311
|
+
def as_tuple_of_middleware(self) -> Tuple[TValue, ...]:
|
|
312
312
|
"""
|
|
313
313
|
This helps with type hinting since we return `Iterator[TKey]` type, though it's
|
|
314
314
|
actually a `Iterator[TValue]` type, for the `__iter__()` method. This is in
|
|
315
315
|
order to satisfy the `Mapping` interface.
|
|
316
316
|
"""
|
|
317
|
-
return tuple(self.
|
|
317
|
+
return tuple(self._reversed_middleware())
|
|
318
318
|
|
|
319
319
|
def __iter__(self) -> Iterator[TKey]:
|
|
320
320
|
# ``__iter__()`` for a ``Mapping`` returns ``Iterator[TKey]`` but this
|
|
321
321
|
# implementation returns ``Iterator[TValue]`` on reversed values (not keys).
|
|
322
322
|
# This leads to typing issues, so it's better to use
|
|
323
|
-
# ``
|
|
324
|
-
return iter(self.
|
|
323
|
+
# ``as_tuple_of_middleware()`` to achieve the same result.
|
|
324
|
+
return iter(self._reversed_middleware()) # type: ignore
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import decimal
|
|
2
|
-
import warnings
|
|
3
2
|
from types import (
|
|
4
3
|
TracebackType,
|
|
5
4
|
)
|
|
@@ -142,7 +141,6 @@ from web3.types import (
|
|
|
142
141
|
)
|
|
143
142
|
|
|
144
143
|
if TYPE_CHECKING:
|
|
145
|
-
from web3.pm import PM # noqa: F401
|
|
146
144
|
from web3._utils.empty import Empty # noqa: F401
|
|
147
145
|
|
|
148
146
|
|
|
@@ -338,30 +336,6 @@ class BaseWeb3:
|
|
|
338
336
|
def is_encodable(self, _type: TypeStr, value: Any) -> bool:
|
|
339
337
|
return self.codec.is_encodable(_type, value)
|
|
340
338
|
|
|
341
|
-
@property
|
|
342
|
-
def pm(self) -> "PM":
|
|
343
|
-
if hasattr(self, "_pm"):
|
|
344
|
-
# ignored b/c property is dynamically set
|
|
345
|
-
# via enable_unstable_package_management_api
|
|
346
|
-
return self._pm
|
|
347
|
-
else:
|
|
348
|
-
raise AttributeError(
|
|
349
|
-
"The Package Management feature is disabled by default until "
|
|
350
|
-
"its API stabilizes. To use these features, please enable them by "
|
|
351
|
-
"running `w3.enable_unstable_package_management_api()` and try again."
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
def enable_unstable_package_management_api(self) -> None:
|
|
355
|
-
if not hasattr(self, "_pm"):
|
|
356
|
-
warnings.warn(
|
|
357
|
-
"The ``ethPM`` module is no longer being maintained and will be "
|
|
358
|
-
"deprecated with ``web3.py`` version 7",
|
|
359
|
-
UserWarning,
|
|
360
|
-
)
|
|
361
|
-
from web3.pm import PM # noqa: F811
|
|
362
|
-
|
|
363
|
-
self.attach_modules({"_pm": PM})
|
|
364
|
-
|
|
365
339
|
|
|
366
340
|
class Web3(BaseWeb3):
|
|
367
341
|
# mypy types
|
|
@@ -378,14 +352,14 @@ class Web3(BaseWeb3):
|
|
|
378
352
|
def __init__(
|
|
379
353
|
self,
|
|
380
354
|
provider: Optional[BaseProvider] = None,
|
|
381
|
-
|
|
355
|
+
middleware: Optional[Sequence[Any]] = None,
|
|
382
356
|
modules: Optional[Dict[str, Union[Type[Module], Sequence[Any]]]] = None,
|
|
383
357
|
external_modules: Optional[
|
|
384
358
|
Dict[str, Union[Type[Module], Sequence[Any]]]
|
|
385
359
|
] = None,
|
|
386
360
|
ens: Union[ENS, "Empty"] = empty,
|
|
387
361
|
) -> None:
|
|
388
|
-
self.manager = self.RequestManager(self, provider,
|
|
362
|
+
self.manager = self.RequestManager(self, provider, middleware)
|
|
389
363
|
self.codec = ABICodec(build_strict_registry())
|
|
390
364
|
|
|
391
365
|
if modules is None:
|
|
@@ -446,14 +420,14 @@ class AsyncWeb3(BaseWeb3):
|
|
|
446
420
|
def __init__(
|
|
447
421
|
self,
|
|
448
422
|
provider: Optional[AsyncBaseProvider] = None,
|
|
449
|
-
|
|
423
|
+
middleware: Optional[Sequence[Any]] = None,
|
|
450
424
|
modules: Optional[Dict[str, Union[Type[Module], Sequence[Any]]]] = None,
|
|
451
425
|
external_modules: Optional[
|
|
452
426
|
Dict[str, Union[Type[Module], Sequence[Any]]]
|
|
453
427
|
] = None,
|
|
454
428
|
ens: Union[AsyncENS, "Empty"] = empty,
|
|
455
429
|
) -> None:
|
|
456
|
-
self.manager = self.RequestManager(self, provider,
|
|
430
|
+
self.manager = self.RequestManager(self, provider, middleware)
|
|
457
431
|
self.codec = ABICodec(build_strict_registry())
|
|
458
432
|
|
|
459
433
|
self._modules = get_async_default_modules() if modules is None else modules
|
|
@@ -125,7 +125,7 @@ class RequestManager:
|
|
|
125
125
|
self,
|
|
126
126
|
w3: Union["AsyncWeb3", "Web3"],
|
|
127
127
|
provider: Optional[Union["BaseProvider", "AsyncBaseProvider"]] = None,
|
|
128
|
-
|
|
128
|
+
middleware: Optional[Sequence[Tuple[Middleware, str]]] = None,
|
|
129
129
|
) -> None:
|
|
130
130
|
self.w3 = w3
|
|
131
131
|
|
|
@@ -134,10 +134,10 @@ class RequestManager:
|
|
|
134
134
|
else:
|
|
135
135
|
self.provider = provider
|
|
136
136
|
|
|
137
|
-
if
|
|
138
|
-
|
|
137
|
+
if middleware is None:
|
|
138
|
+
middleware = self.get_default_middleware()
|
|
139
139
|
|
|
140
|
-
self.middleware_onion = NamedElementOnion(
|
|
140
|
+
self.middleware_onion = NamedElementOnion(middleware)
|
|
141
141
|
|
|
142
142
|
if isinstance(provider, PersistentConnectionProvider):
|
|
143
143
|
# set up the request processor to be able to properly process ordered
|
|
@@ -157,9 +157,9 @@ class RequestManager:
|
|
|
157
157
|
self._provider = provider
|
|
158
158
|
|
|
159
159
|
@staticmethod
|
|
160
|
-
def
|
|
160
|
+
def get_default_middleware() -> List[Tuple[Middleware, str]]:
|
|
161
161
|
"""
|
|
162
|
-
List the default
|
|
162
|
+
List the default middleware for the request manager.
|
|
163
163
|
Documentation should remain in sync with these defaults.
|
|
164
164
|
"""
|
|
165
165
|
return [
|
|
@@ -11,6 +11,7 @@ from .attrdict import (
|
|
|
11
11
|
)
|
|
12
12
|
from .base import (
|
|
13
13
|
Middleware,
|
|
14
|
+
Web3Middleware,
|
|
14
15
|
)
|
|
15
16
|
from .buffered_gas_estimate import (
|
|
16
17
|
BufferedGasEstimateMiddleware,
|
|
@@ -58,8 +59,8 @@ if TYPE_CHECKING:
|
|
|
58
59
|
)
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
def
|
|
62
|
-
|
|
62
|
+
def combine_middleware(
|
|
63
|
+
middleware: Sequence[Middleware],
|
|
63
64
|
w3: "Web3",
|
|
64
65
|
provider_request_fn: MakeRequestFn,
|
|
65
66
|
) -> Callable[..., "RPCResponse"]:
|
|
@@ -69,14 +70,14 @@ def combine_middlewares(
|
|
|
69
70
|
the response through the response processors.
|
|
70
71
|
"""
|
|
71
72
|
accumulator_fn = provider_request_fn
|
|
72
|
-
for
|
|
73
|
+
for mw in reversed(middleware):
|
|
73
74
|
# initialize the middleware and wrap the accumulator function down the stack
|
|
74
|
-
accumulator_fn =
|
|
75
|
+
accumulator_fn = mw(w3).wrap_make_request(accumulator_fn)
|
|
75
76
|
return accumulator_fn
|
|
76
77
|
|
|
77
78
|
|
|
78
|
-
async def
|
|
79
|
-
|
|
79
|
+
async def async_combine_middleware(
|
|
80
|
+
middleware: Sequence[Middleware],
|
|
80
81
|
async_w3: "AsyncWeb3",
|
|
81
82
|
provider_request_fn: AsyncMakeRequestFn,
|
|
82
83
|
) -> Callable[..., Coroutine[Any, Any, "RPCResponse"]]:
|
|
@@ -86,8 +87,8 @@ async def async_combine_middlewares(
|
|
|
86
87
|
the response through the response processors.
|
|
87
88
|
"""
|
|
88
89
|
accumulator_fn = provider_request_fn
|
|
89
|
-
for
|
|
90
|
+
for mw in reversed(middleware):
|
|
90
91
|
# initialize the middleware and wrap the accumulator function down the stack
|
|
91
|
-
initialized =
|
|
92
|
+
initialized = mw(async_w3)
|
|
92
93
|
accumulator_fn = await initialized.async_wrap_make_request(accumulator_fn)
|
|
93
94
|
return accumulator_fn
|
|
@@ -129,7 +129,7 @@ def retrieve_async_method_call_fn(
|
|
|
129
129
|
|
|
130
130
|
# Module should no longer have access to the full web3 api.
|
|
131
131
|
# Only the calling functions need access to the request methods.
|
|
132
|
-
# Any "re-entrant" shenanigans can go in the
|
|
132
|
+
# Any "re-entrant" shenanigans can go in the middleware, which do
|
|
133
133
|
# have web3 access.
|
|
134
134
|
class Module:
|
|
135
135
|
is_async = False
|
|
@@ -28,7 +28,7 @@ from web3.exceptions import (
|
|
|
28
28
|
ProviderConnectionError,
|
|
29
29
|
)
|
|
30
30
|
from web3.middleware import (
|
|
31
|
-
|
|
31
|
+
async_combine_middleware,
|
|
32
32
|
)
|
|
33
33
|
from web3.middleware.base import (
|
|
34
34
|
Middleware,
|
|
@@ -95,14 +95,14 @@ class AsyncBaseProvider:
|
|
|
95
95
|
async def request_func(
|
|
96
96
|
self, async_w3: "AsyncWeb3", middleware_onion: MiddlewareOnion
|
|
97
97
|
) -> Callable[..., Coroutine[Any, Any, RPCResponse]]:
|
|
98
|
-
|
|
98
|
+
middleware: Tuple[Middleware, ...] = middleware_onion.as_tuple_of_middleware()
|
|
99
99
|
|
|
100
100
|
cache_key = self._request_func_cache[0]
|
|
101
|
-
if cache_key !=
|
|
101
|
+
if cache_key != middleware:
|
|
102
102
|
self._request_func_cache = (
|
|
103
|
-
|
|
104
|
-
await
|
|
105
|
-
|
|
103
|
+
middleware,
|
|
104
|
+
await async_combine_middleware(
|
|
105
|
+
middleware=middleware,
|
|
106
106
|
async_w3=async_w3,
|
|
107
107
|
provider_request_fn=self.make_request,
|
|
108
108
|
),
|
|
@@ -25,7 +25,7 @@ from web3.exceptions import (
|
|
|
25
25
|
ProviderConnectionError,
|
|
26
26
|
)
|
|
27
27
|
from web3.middleware import (
|
|
28
|
-
|
|
28
|
+
combine_middleware,
|
|
29
29
|
)
|
|
30
30
|
from web3.middleware.base import (
|
|
31
31
|
Middleware,
|
|
@@ -61,7 +61,7 @@ CACHEABLE_REQUESTS = cast(
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
class BaseProvider:
|
|
64
|
-
# a tuple of (
|
|
64
|
+
# a tuple of (middleware, request_func)
|
|
65
65
|
_request_func_cache: Tuple[Tuple[Middleware, ...], Callable[..., RPCResponse]] = (
|
|
66
66
|
None,
|
|
67
67
|
None,
|
|
@@ -86,19 +86,19 @@ class BaseProvider:
|
|
|
86
86
|
) -> Callable[..., RPCResponse]:
|
|
87
87
|
"""
|
|
88
88
|
@param w3 is the web3 instance
|
|
89
|
-
@param middleware_onion is an iterable of
|
|
89
|
+
@param middleware_onion is an iterable of middleware,
|
|
90
90
|
ordered by first to execute
|
|
91
91
|
@returns a function that calls all the middleware and
|
|
92
92
|
eventually self.make_request()
|
|
93
93
|
"""
|
|
94
|
-
|
|
94
|
+
middleware: Tuple[Middleware, ...] = middleware_onion.as_tuple_of_middleware()
|
|
95
95
|
|
|
96
96
|
cache_key = self._request_func_cache[0]
|
|
97
|
-
if cache_key !=
|
|
97
|
+
if cache_key != middleware:
|
|
98
98
|
self._request_func_cache = (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
middleware,
|
|
100
|
+
combine_middleware(
|
|
101
|
+
middleware=middleware,
|
|
102
102
|
w3=w3,
|
|
103
103
|
provider_request_fn=self.make_request,
|
|
104
104
|
),
|