web3 7.0.0b8__tar.gz → 7.1.0__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.0b8/web3.egg-info → web3-7.1.0}/PKG-INFO +10 -10
- {web3-7.0.0b8 → web3-7.1.0}/ens/async_ens.py +16 -7
- {web3-7.0.0b8 → web3-7.1.0}/ens/base_ens.py +3 -1
- {web3-7.0.0b8 → web3-7.1.0}/ens/exceptions.py +2 -7
- {web3-7.0.0b8 → web3-7.1.0}/ens/utils.py +0 -17
- {web3-7.0.0b8 → web3-7.1.0}/pyproject.toml +0 -1
- {web3-7.0.0b8 → web3-7.1.0}/setup.py +13 -10
- {web3-7.0.0b8 → web3-7.1.0}/tests/beacon/test_async_beacon.py +13 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/beacon/test_beacon.py +12 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_attributes.py +2 -2
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_build_transaction.py +29 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_call_interface.py +25 -15
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_class_construction.py +2 -2
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_constructor_encoding.py +7 -7
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_estimate_gas.py +31 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_method_abi_encoding.py +2 -2
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_method_to_argument_matching.py +18 -17
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_transact_interface.py +30 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_extracting_event_data.py +7 -7
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_extracting_event_data_old.py +2 -2
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/test_response_formatters.py +13 -1
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/method-class/test_method.py +9 -9
- web3-7.1.0/tests/core/middleware/test_middleware.py +81 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/test_library_files.py +1 -3
- web3-7.1.0/tests/core/utilities/test_abi.py +701 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_abi_named_tree.py +9 -5
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_http_session_manager.py +68 -2
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/generate_fixtures/go_ethereum.py +29 -3
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/test_ethereum_tester.py +8 -8
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/abi.py +100 -257
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/compat/__init__.py +1 -0
- web3-7.1.0/web3/_utils/contracts.py +381 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/encoding.py +4 -5
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/events.py +28 -33
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/fee_utils.py +2 -2
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/filters.py +2 -5
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/http_session_manager.py +30 -7
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/method_formatters.py +3 -3
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/eth_module.py +59 -37
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/module_testing_utils.py +43 -1
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/persistent_connection_provider.py +2 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/web3_module.py +8 -8
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/normalizers.py +10 -8
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/validation.py +5 -7
- {web3-7.0.0b8 → web3-7.1.0}/web3/beacon/api_endpoints.py +3 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/beacon/async_beacon.py +18 -2
- {web3-7.0.0b8 → web3-7.1.0}/web3/beacon/beacon.py +18 -2
- {web3-7.0.0b8 → web3-7.1.0}/web3/contract/async_contract.py +26 -25
- {web3-7.0.0b8 → web3-7.1.0}/web3/contract/base_contract.py +116 -80
- {web3-7.0.0b8 → web3-7.1.0}/web3/contract/contract.py +26 -25
- {web3-7.0.0b8 → web3-7.1.0}/web3/contract/utils.py +86 -55
- {web3-7.0.0b8 → web3-7.1.0}/web3/datastructures.py +21 -11
- {web3-7.0.0b8 → web3-7.1.0}/web3/eth/async_eth.py +1 -2
- {web3-7.0.0b8 → web3-7.1.0}/web3/eth/eth.py +1 -2
- {web3-7.0.0b8 → web3-7.1.0}/web3/exceptions.py +22 -9
- {web3-7.0.0b8 → web3-7.1.0}/web3/gas_strategies/time_based.py +4 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/manager.py +34 -12
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/base.py +8 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/filter.py +3 -3
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/signing.py +6 -1
- web3-7.1.0/web3/scripts/install_pre_releases.py +33 -0
- web3-7.1.0/web3/scripts/parse_pygeth_version.py +16 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/types.py +5 -45
- web3-7.1.0/web3/utils/__init__.py +72 -0
- web3-7.1.0/web3/utils/abi.py +586 -0
- {web3-7.0.0b8 → web3-7.1.0/web3.egg-info}/PKG-INFO +10 -10
- {web3-7.0.0b8 → web3-7.1.0}/web3.egg-info/SOURCES.txt +4 -3
- {web3-7.0.0b8 → web3-7.1.0}/web3.egg-info/requires.txt +9 -9
- web3-7.0.0b8/tests/core/contracts/test_args_and_kwargs_merger.py +0 -109
- web3-7.0.0b8/tests/core/utilities/test_abi.py +0 -383
- web3-7.0.0b8/tests/core/utilities/test_abi_filter_by_abi_name.py +0 -73
- web3-7.0.0b8/web3/_utils/contracts.py +0 -470
- web3-7.0.0b8/web3/utils/__init__.py +0 -28
- web3-7.0.0b8/web3/utils/abi.py +0 -21
- {web3-7.0.0b8 → web3-7.1.0}/LICENSE +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/MANIFEST.in +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/README.md +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/_normalization.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/abis.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/auto.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/constants.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/contract_data.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/ens.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/specs/nf.json +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/ens/specs/normalization_spec.json +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/setup.cfg +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/.DS_Store +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/admin-module/test_admin_addPeer.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/admin-module/test_admin_peers.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/caching-utils/test_request_caching.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_ambiguous_functions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_caller_interface.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_constructor.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_deployment.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_example.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_init.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_method_abi_decoding.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_panic_errors.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_contract_util_functions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/test_offchain_lookup.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/contracts/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/datastructures/test_datastructures.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_accounts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_block_api.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_default_account_api.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_eth_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_eth_fee_history.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_eth_filter.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_eth_properties.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_gas_pricing.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_poa.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-module/test_transactions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/exceptions/test_exceptions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_basic_filter_tests.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_contract_data_filters.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_contract_get_logs.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_contract_on_event_filtering.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_contract_past_event_filtering.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_contract_topic_filters.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_existing_filter_instance.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_filters_against_many_blocks.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/test_utils_functions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/filtering/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/test_default_middlewares.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/test_middleware_onion_api.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/test_provider_property.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/manager/test_provider_request_wrapping.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/method-class/test_result_formatters.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_attrdict_middleware.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_filter_middleware.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_formatting_middleware.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_gas_price_strategy.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_stalecheck.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/middleware/test_transaction_signing.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/module-class/test_module.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_async_http_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_async_ipc_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_async_tester_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_auto_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_base_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_http_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_http_request_retry.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_ipc_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_legacy_websocket_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_tester_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/providers/test_websocket_provider.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/testing-module/test_testing_mine.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_abi_is_encodable.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_address.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_async_transaction.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_attach_modules.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_attributedict.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_caching_utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_construct_event_data_set.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_construct_event_topics.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_datatypes.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_decorators.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_encoding.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_event_filter_builder.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_event_interface.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_fee_utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_formatters.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_is_probably_enum.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_is_recognized_type.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_math.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_method_formatters.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_select_filter_method.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_threads.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_valid_transaction_params.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/utilities/test_validation.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_api.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_attach_modules.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_client_version.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_conversions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_import_and_version.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_keccak.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_providers.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/core/web3-module/test_web3_inheritance.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/normalization/normalization_tests.json +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/normalization/test_normalize_name_ensip15.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_ens.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_get_registry.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_get_text.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_nameprep.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_offchain_resolution.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_setup_address.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_setup_name.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/ens/test_wildcard_resolution.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/.DS_Store +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/README.md +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/common.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/generate_fixtures/common.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/geth-1.14.5-fixture.zip +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/common.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_http.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_ipc.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/integration/go_ethereum/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/tests/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/__init__.py +0 -0
- /web3-7.0.0b8/web3/_utils/function_identifiers.py → /web3-7.1.0/web3/_utils/abi_element_identifiers.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/async_caching.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/async_transactions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/batching.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/blocks.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/caching.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/event_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/datatypes.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/decorators.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/empty.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/ens.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/error_formatters_utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/formatters.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/http.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/hypothesis.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/math.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/rpc_abi.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/threads.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/transactions.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/type_conversion.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/utility_methods.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/_utils/windows.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/auto/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/auto/gethdev.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/beacon/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/constants.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/contract/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/eth/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/eth/base_eth.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/gas_strategies/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/geth.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/logs.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/main.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/method.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/attrdict.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/formatting.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/names.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/pythonic.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/stalecheck.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/middleware/validation.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/module.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/net.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/async_base.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/auto.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/base.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/eth_tester/defaults.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/eth_tester/main.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/ipc.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/legacy_websocket.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/async_ipc.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/persistent.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/persistent_connection.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/request_processor.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/persistent/websocket.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/rpc/async_rpc.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/rpc/rpc.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/providers/rpc/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/py.typed +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/scripts/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/scripts/release/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/scripts/release/test_package.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/testing.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/tools/benchmark/__init__.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/tools/benchmark/main.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/tools/benchmark/node.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/tools/benchmark/reporting.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/tools/benchmark/utils.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/tracing.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/utils/address.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/utils/caching.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3/utils/exception_handling.py +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3.egg-info/not-zip-safe +0 -0
- {web3-7.0.0b8 → web3-7.1.0}/web3.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: web3
|
|
3
|
-
Version: 7.0
|
|
3
|
+
Version: 7.1.0
|
|
4
4
|
Summary: web3: A Python library for interacting with Ethereum
|
|
5
5
|
Home-page: https://github.com/ethereum/web3.py
|
|
6
6
|
Author: The Ethereum Foundation
|
|
@@ -20,17 +20,18 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
20
20
|
Requires-Python: >=3.8, <4
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: aiohttp>=3.7.4.post0
|
|
24
23
|
Requires-Dist: eth-abi>=5.0.1
|
|
25
|
-
Requires-Dist: eth-account>=0.
|
|
24
|
+
Requires-Dist: eth-account>=0.13.1
|
|
26
25
|
Requires-Dist: eth-hash[pycryptodome]>=0.5.1
|
|
27
|
-
Requires-Dist: eth-typing>=
|
|
28
|
-
Requires-Dist: eth-utils>=
|
|
26
|
+
Requires-Dist: eth-typing>=5.0.0
|
|
27
|
+
Requires-Dist: eth-utils>=5.0.0
|
|
29
28
|
Requires-Dist: hexbytes>=1.2.0
|
|
29
|
+
Requires-Dist: aiohttp>=3.7.4.post0
|
|
30
30
|
Requires-Dist: pydantic>=2.4.0
|
|
31
31
|
Requires-Dist: pywin32>=223; platform_system == "Windows"
|
|
32
|
-
Requires-Dist: requests>=2.
|
|
32
|
+
Requires-Dist: requests>=2.23.0
|
|
33
33
|
Requires-Dist: typing-extensions>=4.0.1
|
|
34
|
+
Requires-Dist: types-requests>=2.0.0
|
|
34
35
|
Requires-Dist: websockets>=10.0.0
|
|
35
36
|
Requires-Dist: pyunormalize>=15.0.0
|
|
36
37
|
Provides-Extra: dev
|
|
@@ -39,6 +40,7 @@ Requires-Dist: bumpversion>=0.5.3; extra == "dev"
|
|
|
39
40
|
Requires-Dist: flaky>=3.7.0; extra == "dev"
|
|
40
41
|
Requires-Dist: hypothesis>=3.31.2; extra == "dev"
|
|
41
42
|
Requires-Dist: ipython; extra == "dev"
|
|
43
|
+
Requires-Dist: mypy==1.10.0; extra == "dev"
|
|
42
44
|
Requires-Dist: pre-commit>=3.4.0; extra == "dev"
|
|
43
45
|
Requires-Dist: pytest-asyncio<0.23,>=0.21.2; extra == "dev"
|
|
44
46
|
Requires-Dist: pytest-mock>=1.10; extra == "dev"
|
|
@@ -51,9 +53,8 @@ Requires-Dist: sphinx>=6.0.0; extra == "dev"
|
|
|
51
53
|
Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "dev"
|
|
52
54
|
Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "dev"
|
|
53
55
|
Requires-Dist: towncrier<22,>=21; extra == "dev"
|
|
54
|
-
Requires-Dist: eth-account>=0.13.0; extra == "dev"
|
|
55
56
|
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.11.0b1; extra == "dev"
|
|
56
|
-
Requires-Dist: py-geth>=5.0.
|
|
57
|
+
Requires-Dist: py-geth>=5.0.0; extra == "dev"
|
|
57
58
|
Requires-Dist: pytest-asyncio<0.23,>=0.18.1; extra == "dev"
|
|
58
59
|
Requires-Dist: pytest-mock>=1.10; extra == "dev"
|
|
59
60
|
Requires-Dist: pytest-xdist>=2.4.0; extra == "dev"
|
|
@@ -63,10 +64,9 @@ Requires-Dist: sphinx>=6.0.0; extra == "docs"
|
|
|
63
64
|
Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "docs"
|
|
64
65
|
Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "docs"
|
|
65
66
|
Requires-Dist: towncrier<22,>=21; extra == "docs"
|
|
66
|
-
Requires-Dist: eth-account>=0.13.0; extra == "docs"
|
|
67
67
|
Provides-Extra: test
|
|
68
68
|
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.11.0b1; extra == "test"
|
|
69
|
-
Requires-Dist: py-geth>=5.0.
|
|
69
|
+
Requires-Dist: py-geth>=5.0.0; extra == "test"
|
|
70
70
|
Requires-Dist: pytest-asyncio<0.23,>=0.18.1; extra == "test"
|
|
71
71
|
Requires-Dist: pytest-mock>=1.10; extra == "test"
|
|
72
72
|
Requires-Dist: pytest-xdist>=2.4.0; extra == "test"
|
|
@@ -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(
|
|
@@ -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,
|
|
@@ -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
|
"""
|
|
@@ -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
|
|
|
@@ -11,6 +11,7 @@ extras_require = {
|
|
|
11
11
|
"flaky>=3.7.0",
|
|
12
12
|
"hypothesis>=3.31.2",
|
|
13
13
|
"ipython",
|
|
14
|
+
"mypy==1.10.0",
|
|
14
15
|
"pre-commit>=3.4.0",
|
|
15
16
|
"pytest-asyncio>=0.21.2,<0.23",
|
|
16
17
|
"pytest-mock>=1.10",
|
|
@@ -25,13 +26,12 @@ extras_require = {
|
|
|
25
26
|
"sphinx-autobuild>=2021.3.14",
|
|
26
27
|
"sphinx_rtd_theme>=1.0.0",
|
|
27
28
|
"towncrier>=21,<22",
|
|
28
|
-
# web3 will work but emit warnings with eth-account>=0.12.2,
|
|
29
|
-
# but doctests fail between 0.12.2 and 0.13.0
|
|
30
|
-
"eth-account>=0.13.0",
|
|
31
29
|
],
|
|
32
30
|
"test": [
|
|
31
|
+
# Note: ethereum-maintained libraries in this list should be added to the
|
|
32
|
+
# `install_pre_releases.py` script.
|
|
33
33
|
"eth-tester[py-evm]>=0.11.0b1,<0.13.0b1",
|
|
34
|
-
"py-geth>=5.0.
|
|
34
|
+
"py-geth>=5.0.0",
|
|
35
35
|
"pytest-asyncio>=0.18.1,<0.23",
|
|
36
36
|
"pytest-mock>=1.10",
|
|
37
37
|
"pytest-xdist>=2.4.0",
|
|
@@ -51,7 +51,7 @@ with open("./README.md") as readme:
|
|
|
51
51
|
setup(
|
|
52
52
|
name="web3",
|
|
53
53
|
# *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme
|
|
54
|
-
version="7.
|
|
54
|
+
version="7.1.0",
|
|
55
55
|
description="""web3: A Python library for interacting with Ethereum""",
|
|
56
56
|
long_description=long_description,
|
|
57
57
|
long_description_content_type="text/markdown",
|
|
@@ -60,17 +60,20 @@ setup(
|
|
|
60
60
|
url="https://github.com/ethereum/web3.py",
|
|
61
61
|
include_package_data=True,
|
|
62
62
|
install_requires=[
|
|
63
|
-
|
|
63
|
+
# Note: ethereum-maintained libraries in this list should be added to the
|
|
64
|
+
# `install_pre_releases.py` script.
|
|
64
65
|
"eth-abi>=5.0.1",
|
|
65
|
-
"eth-account>=0.
|
|
66
|
+
"eth-account>=0.13.1",
|
|
66
67
|
"eth-hash[pycryptodome]>=0.5.1",
|
|
67
|
-
"eth-typing>=
|
|
68
|
-
"eth-utils>=
|
|
68
|
+
"eth-typing>=5.0.0",
|
|
69
|
+
"eth-utils>=5.0.0",
|
|
69
70
|
"hexbytes>=1.2.0",
|
|
71
|
+
"aiohttp>=3.7.4.post0",
|
|
70
72
|
"pydantic>=2.4.0",
|
|
71
73
|
"pywin32>=223;platform_system=='Windows'",
|
|
72
|
-
"requests>=2.
|
|
74
|
+
"requests>=2.23.0",
|
|
73
75
|
"typing-extensions>=4.0.1",
|
|
76
|
+
"types-requests>=2.0.0",
|
|
74
77
|
"websockets>=10.0.0",
|
|
75
78
|
"pyunormalize>=15.0.0",
|
|
76
79
|
],
|
|
@@ -267,3 +267,16 @@ async def test_async_cl_node_get_version(async_beacon):
|
|
|
267
267
|
async def test_async_cl_node_get_syncing(async_beacon):
|
|
268
268
|
response = await async_beacon.get_syncing()
|
|
269
269
|
_assert_valid_response(response)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
# Blob endpoint tests
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
@pytest.mark.asyncio
|
|
276
|
+
async def test_async_cl_node_get_blob_sidecars(async_beacon):
|
|
277
|
+
response = await async_beacon.get_blob_sidecars("head")
|
|
278
|
+
_assert_valid_response(response)
|
|
279
|
+
|
|
280
|
+
# test with indices
|
|
281
|
+
with_indices = await async_beacon.get_blob_sidecars("head", [0, 1])
|
|
282
|
+
_assert_valid_response(with_indices)
|
|
@@ -223,3 +223,15 @@ def test_cl_node_get_version(beacon):
|
|
|
223
223
|
def test_cl_node_get_syncing(beacon):
|
|
224
224
|
response = beacon.get_syncing()
|
|
225
225
|
_assert_valid_response(response)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
# Blob endpoint tests
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def test_cl_node_get_blob_sidecars(beacon):
|
|
232
|
+
response = beacon.get_blob_sidecars("head")
|
|
233
|
+
_assert_valid_response(response)
|
|
234
|
+
|
|
235
|
+
# test with indices
|
|
236
|
+
with_indices = beacon.get_blob_sidecars("head", [0, 1])
|
|
237
|
+
_assert_valid_response(with_indices)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
3
|
from web3.exceptions import (
|
|
4
|
-
|
|
4
|
+
ABIEventNotFound,
|
|
5
5
|
ABIFunctionNotFound,
|
|
6
6
|
)
|
|
7
7
|
|
|
@@ -22,7 +22,7 @@ def test_getattr(w3, abi, attribute):
|
|
|
22
22
|
"attribute,error",
|
|
23
23
|
(
|
|
24
24
|
("functions", ABIFunctionNotFound),
|
|
25
|
-
("events",
|
|
25
|
+
("events", ABIEventNotFound),
|
|
26
26
|
("caller", ABIFunctionNotFound),
|
|
27
27
|
),
|
|
28
28
|
)
|
|
@@ -53,6 +53,20 @@ def test_build_transaction_with_contract_no_arguments(
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
def test_build_transaction_with_contract_no_arguments_no_parens(
|
|
57
|
+
w3, math_contract, build_transaction
|
|
58
|
+
):
|
|
59
|
+
txn = math_contract.functions.incrementCounter.build_transaction()
|
|
60
|
+
assert dissoc(txn, "gas") == {
|
|
61
|
+
"to": math_contract.address,
|
|
62
|
+
"data": "0x5b34b966",
|
|
63
|
+
"value": 0,
|
|
64
|
+
"maxFeePerGas": 2750000000,
|
|
65
|
+
"maxPriorityFeePerGas": 10**9,
|
|
66
|
+
"chainId": 131277322940537,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
56
70
|
def test_build_transaction_with_contract_fallback_function(
|
|
57
71
|
w3, fallback_function_contract
|
|
58
72
|
):
|
|
@@ -309,6 +323,21 @@ async def test_async_build_transaction_with_contract_no_arguments(
|
|
|
309
323
|
}
|
|
310
324
|
|
|
311
325
|
|
|
326
|
+
@pytest.mark.asyncio
|
|
327
|
+
async def test_async_build_transaction_with_contract_no_arguments_no_parens(
|
|
328
|
+
async_w3, async_math_contract, async_build_transaction
|
|
329
|
+
):
|
|
330
|
+
txn = await async_math_contract.functions.incrementCounter.build_transaction()
|
|
331
|
+
assert dissoc(txn, "gas") == {
|
|
332
|
+
"to": async_math_contract.address,
|
|
333
|
+
"data": "0x5b34b966",
|
|
334
|
+
"value": 0,
|
|
335
|
+
"maxFeePerGas": 2750000000,
|
|
336
|
+
"maxPriorityFeePerGas": 10**9,
|
|
337
|
+
"chainId": 131277322940537,
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
|
|
312
341
|
@pytest.mark.asyncio
|
|
313
342
|
async def test_async_build_transaction_with_contract_fallback_function(
|
|
314
343
|
async_w3, async_fallback_function_contract
|
|
@@ -37,9 +37,9 @@ from web3.contract.contract import (
|
|
|
37
37
|
ContractFunction,
|
|
38
38
|
)
|
|
39
39
|
from web3.exceptions import (
|
|
40
|
+
ABIReceiveNotFound,
|
|
40
41
|
BadFunctionCallOutput,
|
|
41
42
|
BlockNumberOutOfRange,
|
|
42
|
-
FallbackNotFound,
|
|
43
43
|
InvalidAddress,
|
|
44
44
|
MismatchedABI,
|
|
45
45
|
NameNotFound,
|
|
@@ -145,6 +145,10 @@ def test_call_with_no_arguments(math_contract, call):
|
|
|
145
145
|
assert result == 13
|
|
146
146
|
|
|
147
147
|
|
|
148
|
+
def test_call_no_arguments_no_parens(math_contract):
|
|
149
|
+
assert math_contract.functions.return13.call() == 13
|
|
150
|
+
|
|
151
|
+
|
|
148
152
|
def test_call_with_one_argument(math_contract, call):
|
|
149
153
|
result = call(contract=math_contract, contract_function="multiply7", func_args=[3])
|
|
150
154
|
assert result == 21
|
|
@@ -271,7 +275,7 @@ def test_set_byte_array_non_strict(
|
|
|
271
275
|
@pytest.mark.parametrize("args", ([""], ["s"]))
|
|
272
276
|
def test_set_byte_array_with_invalid_args(arrays_contract, transact, args):
|
|
273
277
|
with pytest.raises(
|
|
274
|
-
|
|
278
|
+
MismatchedABI,
|
|
275
279
|
match="Could not identify the intended function with name `setByteValue`",
|
|
276
280
|
):
|
|
277
281
|
transact(
|
|
@@ -532,7 +536,7 @@ def test_call_receive_fallback_function(
|
|
|
532
536
|
|
|
533
537
|
|
|
534
538
|
def test_call_nonexistent_receive_function(fallback_function_contract):
|
|
535
|
-
with pytest.raises(
|
|
539
|
+
with pytest.raises(ABIReceiveNotFound, match="No receive function was found"):
|
|
536
540
|
fallback_function_contract.receive.call()
|
|
537
541
|
|
|
538
542
|
|
|
@@ -617,13 +621,13 @@ def test_no_functions_match_identifier(arrays_contract):
|
|
|
617
621
|
|
|
618
622
|
def test_function_1_match_identifier_wrong_number_of_args(arrays_contract):
|
|
619
623
|
regex = message_regex + diagnosis_arg_regex
|
|
620
|
-
with pytest.raises(
|
|
624
|
+
with pytest.raises(MismatchedABI, match=regex):
|
|
621
625
|
arrays_contract.functions.setBytes32Value().call()
|
|
622
626
|
|
|
623
627
|
|
|
624
628
|
def test_function_1_match_identifier_wrong_args_encoding(arrays_contract):
|
|
625
629
|
regex = message_regex + diagnosis_encoding_regex
|
|
626
|
-
with pytest.raises(
|
|
630
|
+
with pytest.raises(MismatchedABI, match=regex):
|
|
627
631
|
arrays_contract.functions.setBytes32Value("dog").call()
|
|
628
632
|
|
|
629
633
|
|
|
@@ -638,7 +642,7 @@ def test_function_1_match_identifier_wrong_args_encoding(arrays_contract):
|
|
|
638
642
|
def test_function_multiple_error_diagnoses(w3, arg1, arg2, diagnosis):
|
|
639
643
|
Contract = w3.eth.contract(abi=MULTIPLE_FUNCTIONS)
|
|
640
644
|
regex = message_regex + diagnosis
|
|
641
|
-
with pytest.raises(
|
|
645
|
+
with pytest.raises(MismatchedABI, match=regex):
|
|
642
646
|
if arg2:
|
|
643
647
|
Contract.functions.a(arg1, arg2).call()
|
|
644
648
|
else:
|
|
@@ -656,7 +660,7 @@ def test_function_wrong_args_for_tuple_collapses_args_in_message(
|
|
|
656
660
|
address,
|
|
657
661
|
tuple_contract,
|
|
658
662
|
):
|
|
659
|
-
with pytest.raises(
|
|
663
|
+
with pytest.raises(MismatchedABI) as e:
|
|
660
664
|
tuple_contract.functions.method(
|
|
661
665
|
(1, [2, 3], [(4, [True, [False]], [address])])
|
|
662
666
|
).call()
|
|
@@ -684,7 +688,7 @@ def test_function_wrong_args_for_tuple_collapses_args_in_message(
|
|
|
684
688
|
def test_function_wrong_args_for_tuple_collapses_kwargs_in_message(
|
|
685
689
|
address, tuple_contract
|
|
686
690
|
):
|
|
687
|
-
with pytest.raises(
|
|
691
|
+
with pytest.raises(MismatchedABI) as e:
|
|
688
692
|
tuple_contract.functions.method(
|
|
689
693
|
a=(1, [2, 3], [(4, [True, [False]], [address])]) # noqa: E501
|
|
690
694
|
).call()
|
|
@@ -790,7 +794,7 @@ def test_invalid_fixed_value_reflections(
|
|
|
790
794
|
fixed_reflector_contract, function, value, error
|
|
791
795
|
):
|
|
792
796
|
contract_func = fixed_reflector_contract.functions[function]
|
|
793
|
-
with pytest.raises(
|
|
797
|
+
with pytest.raises(MismatchedABI, match=error):
|
|
794
798
|
contract_func(value).call({"gas": 420000})
|
|
795
799
|
|
|
796
800
|
|
|
@@ -1419,7 +1423,7 @@ async def test_async_set_byte_array_strict_by_default(
|
|
|
1419
1423
|
async def test_async_set_strict_byte_array_with_invalid_args(
|
|
1420
1424
|
async_arrays_contract, async_transact, args
|
|
1421
1425
|
):
|
|
1422
|
-
with pytest.raises(
|
|
1426
|
+
with pytest.raises(MismatchedABI):
|
|
1423
1427
|
await async_transact(
|
|
1424
1428
|
contract=async_arrays_contract,
|
|
1425
1429
|
contract_function="setByteValue",
|
|
@@ -1719,7 +1723,7 @@ async def test_async_call_receive_fallback_function(
|
|
|
1719
1723
|
async def test_async_call_nonexistent_receive_function(
|
|
1720
1724
|
async_fallback_function_contract,
|
|
1721
1725
|
):
|
|
1722
|
-
with pytest.raises(
|
|
1726
|
+
with pytest.raises(ABIReceiveNotFound, match="No receive function was found"):
|
|
1723
1727
|
await async_fallback_function_contract.receive.call()
|
|
1724
1728
|
|
|
1725
1729
|
|
|
@@ -1786,7 +1790,7 @@ async def test_async_function_1_match_identifier_wrong_number_of_args(
|
|
|
1786
1790
|
async_arrays_contract,
|
|
1787
1791
|
):
|
|
1788
1792
|
regex = message_regex + diagnosis_arg_regex
|
|
1789
|
-
with pytest.raises(
|
|
1793
|
+
with pytest.raises(MismatchedABI, match=regex):
|
|
1790
1794
|
await async_arrays_contract.functions.setBytes32Value().call()
|
|
1791
1795
|
|
|
1792
1796
|
|
|
@@ -1795,7 +1799,7 @@ async def test_async_function_1_match_identifier_wrong_args_encoding(
|
|
|
1795
1799
|
async_arrays_contract,
|
|
1796
1800
|
):
|
|
1797
1801
|
regex = message_regex + diagnosis_encoding_regex
|
|
1798
|
-
with pytest.raises(
|
|
1802
|
+
with pytest.raises(MismatchedABI, match=regex):
|
|
1799
1803
|
await async_arrays_contract.functions.setBytes32Value("dog").call()
|
|
1800
1804
|
|
|
1801
1805
|
|
|
@@ -1811,7 +1815,7 @@ async def test_async_function_1_match_identifier_wrong_args_encoding(
|
|
|
1811
1815
|
async def test_async_function_multiple_error_diagnoses(async_w3, arg1, arg2, diagnosis):
|
|
1812
1816
|
Contract = async_w3.eth.contract(abi=MULTIPLE_FUNCTIONS)
|
|
1813
1817
|
regex = message_regex + diagnosis
|
|
1814
|
-
with pytest.raises(
|
|
1818
|
+
with pytest.raises(MismatchedABI, match=regex):
|
|
1815
1819
|
if arg2:
|
|
1816
1820
|
await Contract.functions.a(arg1, arg2).call()
|
|
1817
1821
|
else:
|
|
@@ -1920,7 +1924,7 @@ async def test_async_invalid_fixed_value_reflections(
|
|
|
1920
1924
|
async_fixed_reflector_contract, function, value, error
|
|
1921
1925
|
):
|
|
1922
1926
|
contract_func = async_fixed_reflector_contract.functions[function]
|
|
1923
|
-
with pytest.raises(
|
|
1927
|
+
with pytest.raises(MismatchedABI, match=error):
|
|
1924
1928
|
await contract_func(value).call({"gas": 420000})
|
|
1925
1929
|
|
|
1926
1930
|
|
|
@@ -2287,6 +2291,12 @@ async def test_async_call_with_no_arguments(async_math_contract, call):
|
|
|
2287
2291
|
assert result == 13
|
|
2288
2292
|
|
|
2289
2293
|
|
|
2294
|
+
@pytest.mark.asyncio
|
|
2295
|
+
async def test_async_call_with_no_arguments_no_parens(async_math_contract, call):
|
|
2296
|
+
result = await async_math_contract.functions.return13.call()
|
|
2297
|
+
assert result == 13
|
|
2298
|
+
|
|
2299
|
+
|
|
2290
2300
|
@pytest.mark.asyncio
|
|
2291
2301
|
async def test_async_call_with_one_argument(async_math_contract, call):
|
|
2292
2302
|
result = await async_math_contract.functions.multiply7(3).call()
|
|
@@ -9,7 +9,7 @@ from web3.contract import (
|
|
|
9
9
|
Contract,
|
|
10
10
|
)
|
|
11
11
|
from web3.exceptions import (
|
|
12
|
-
|
|
12
|
+
ABIFallbackNotFound,
|
|
13
13
|
Web3AttributeError,
|
|
14
14
|
)
|
|
15
15
|
|
|
@@ -84,5 +84,5 @@ def test_error_to_call_non_existent_fallback(
|
|
|
84
84
|
bytecode=math_contract_bytecode,
|
|
85
85
|
bytecode_runtime=math_contract_runtime,
|
|
86
86
|
)
|
|
87
|
-
with pytest.raises(
|
|
87
|
+
with pytest.raises(ABIFallbackNotFound):
|
|
88
88
|
math_contract.fallback.estimate_gas()
|
|
@@ -27,15 +27,15 @@ def test_contract_constructor_abi_encoding_with_constructor_with_no_args(
|
|
|
27
27
|
@pytest.mark.parametrize(
|
|
28
28
|
"args,kwargs",
|
|
29
29
|
(
|
|
30
|
-
(
|
|
31
|
-
("arg-is-ignored",
|
|
30
|
+
(tuple(), {"kwarg-is-ignored": True}),
|
|
31
|
+
("arg-is-ignored", {}),
|
|
32
32
|
),
|
|
33
33
|
)
|
|
34
34
|
def test_contract_error_if_additional_args_are_supplied_with_no_constructor_fn(
|
|
35
35
|
math_contract_factory, args, kwargs
|
|
36
36
|
):
|
|
37
37
|
with pytest.raises(TypeError, match="Constructor args"):
|
|
38
|
-
math_contract_factory._encode_constructor_data(args, kwargs)
|
|
38
|
+
math_contract_factory._encode_constructor_data(*args, **kwargs)
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
@pytest.mark.parametrize(
|
|
@@ -53,7 +53,7 @@ def test_error_if_invalid_arguments_supplied(
|
|
|
53
53
|
contract_with_constructor_args_factory, arguments
|
|
54
54
|
):
|
|
55
55
|
with pytest.raises(TypeError):
|
|
56
|
-
contract_with_constructor_args_factory._encode_constructor_data(arguments)
|
|
56
|
+
contract_with_constructor_args_factory._encode_constructor_data(*arguments)
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
@pytest.mark.parametrize(
|
|
@@ -76,7 +76,7 @@ def test_contract_constructor_encoding(
|
|
|
76
76
|
bytes_arg,
|
|
77
77
|
):
|
|
78
78
|
deploy_data = contract_with_constructor_args_factory._encode_constructor_data(
|
|
79
|
-
[1234, bytes_arg]
|
|
79
|
+
*[1234, bytes_arg]
|
|
80
80
|
)
|
|
81
81
|
expected_ending = encode_hex(
|
|
82
82
|
w3.codec.encode(["uint256", "bytes32"], [1234, bytes_arg])
|
|
@@ -98,7 +98,7 @@ def test_contract_constructor_encoding_non_strict(
|
|
|
98
98
|
):
|
|
99
99
|
deploy_data = (
|
|
100
100
|
non_strict_contract_with_constructor_args_factory._encode_constructor_data(
|
|
101
|
-
[1234, bytes_arg]
|
|
101
|
+
*[1234, bytes_arg]
|
|
102
102
|
)
|
|
103
103
|
)
|
|
104
104
|
encoded_args = "0x00000000000000000000000000000000000000000000000000000000000004d26162636400000000000000000000000000000000000000000000000000000000" # noqa: E501
|
|
@@ -126,5 +126,5 @@ def test_contract_constructor_encoding_strict_errors(
|
|
|
126
126
|
match="One or more arguments could not be encoded to the necessary ABI type.",
|
|
127
127
|
):
|
|
128
128
|
contract_with_constructor_args_factory._encode_constructor_data(
|
|
129
|
-
[1234, bytes_arg]
|
|
129
|
+
*[1234, bytes_arg]
|
|
130
130
|
)
|
|
@@ -18,6 +18,19 @@ def test_contract_estimate_gas(w3, math_contract, estimate_gas, transact):
|
|
|
18
18
|
assert abs(gas_estimate - gas_used) < 21000
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
def test_estimate_gas_can_be_called_without_parens(
|
|
22
|
+
w3, math_contract, estimate_gas, transact
|
|
23
|
+
):
|
|
24
|
+
gas_estimate = math_contract.functions.incrementCounter.estimate_gas()
|
|
25
|
+
|
|
26
|
+
txn_hash = transact(contract=math_contract, contract_function="incrementCounter")
|
|
27
|
+
|
|
28
|
+
txn_receipt = w3.eth.wait_for_transaction_receipt(txn_hash)
|
|
29
|
+
gas_used = txn_receipt.get("gasUsed")
|
|
30
|
+
|
|
31
|
+
assert abs(gas_estimate - gas_used) < 21000
|
|
32
|
+
|
|
33
|
+
|
|
21
34
|
def test_contract_fallback_estimate_gas(w3, fallback_function_contract):
|
|
22
35
|
gas_estimate = fallback_function_contract.fallback.estimate_gas()
|
|
23
36
|
|
|
@@ -197,6 +210,24 @@ async def test_async_estimate_gas_accepts_latest_block(
|
|
|
197
210
|
assert abs(gas_estimate - gas_used) < 21000
|
|
198
211
|
|
|
199
212
|
|
|
213
|
+
@pytest.mark.asyncio
|
|
214
|
+
async def test_async_estimate_gas_can_be_called_without_parens(
|
|
215
|
+
async_w3, async_math_contract, async_transact
|
|
216
|
+
):
|
|
217
|
+
gas_estimate = await async_math_contract.functions.counter.estimate_gas(
|
|
218
|
+
block_identifier="latest"
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
txn_hash = await async_transact(
|
|
222
|
+
contract=async_math_contract, contract_function="incrementCounter"
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
txn_receipt = await async_w3.eth.wait_for_transaction_receipt(txn_hash)
|
|
226
|
+
gas_used = txn_receipt.get("gasUsed")
|
|
227
|
+
|
|
228
|
+
assert abs(gas_estimate - gas_used) < 21000
|
|
229
|
+
|
|
230
|
+
|
|
200
231
|
@pytest.mark.asyncio
|
|
201
232
|
async def test_async_estimate_gas_block_identifier_unique_estimates(
|
|
202
233
|
async_w3, async_math_contract, async_transact
|
|
@@ -5,7 +5,7 @@ from web3 import (
|
|
|
5
5
|
constants,
|
|
6
6
|
)
|
|
7
7
|
from web3.exceptions import (
|
|
8
|
-
|
|
8
|
+
MismatchedABI,
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
ABI_A = json.loads(
|
|
@@ -145,7 +145,7 @@ def test_contract_abi_encoding_kwargs(w3):
|
|
|
145
145
|
)
|
|
146
146
|
def test_contract_abi_encoding_strict_with_error(w3, arguments):
|
|
147
147
|
contract = w3.eth.contract(abi=ABI_C)
|
|
148
|
-
with pytest.raises(
|
|
148
|
+
with pytest.raises(MismatchedABI):
|
|
149
149
|
contract.encode_abi("a", arguments, data=None)
|
|
150
150
|
|
|
151
151
|
|