web3 7.5.0__tar.gz → 7.6.1__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.5.0/web3.egg-info → web3-7.6.1}/PKG-INFO +8 -8
- {web3-7.5.0 → web3-7.6.1}/setup.py +4 -4
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/conftest.py +92 -2
- web3-7.6.1/tests/core/contracts/test_contract_ambiguous_events.py +401 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_ambiguous_functions.py +205 -34
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_attributes.py +5 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_call_interface.py +224 -81
- web3-7.6.1/tests/core/contracts/test_contract_class_construction.py +238 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_init.py +24 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_method_abi_decoding.py +4 -4
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_method_to_argument_matching.py +57 -3
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_async_ipc_provider.py +24 -3
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_ipc_provider.py +12 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_abi.py +202 -14
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_address.py +16 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_event_interface.py +2 -1
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_http_session_manager.py +1 -1
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_validation.py +1 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/generate_fixtures/go_ethereum.py +74 -16
- web3-7.6.1/tests/integration/geth-1.14.12-fixture.zip +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/conftest.py +1 -1
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/abi.py +59 -1
- web3-7.6.1/web3/_utils/contract_sources/contract_data/ambiguous_function_contract.py +42 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/event_contracts.py +49 -4
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contracts.py +49 -8
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/method_formatters.py +1 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/eth_module.py +11 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/rpc_abi.py +1 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/validation.py +3 -0
- {web3-7.5.0 → web3-7.6.1}/web3/contract/async_contract.py +216 -62
- {web3-7.5.0 → web3-7.6.1}/web3/contract/base_contract.py +176 -110
- {web3-7.5.0 → web3-7.6.1}/web3/contract/contract.py +227 -64
- {web3-7.5.0 → web3-7.6.1}/web3/contract/utils.py +7 -3
- {web3-7.5.0 → web3-7.6.1}/web3/eth/async_eth.py +11 -0
- {web3-7.5.0 → web3-7.6.1}/web3/eth/eth.py +11 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/eth_tester/defaults.py +1 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/ipc.py +1 -1
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/async_ipc.py +1 -1
- {web3-7.5.0 → web3-7.6.1}/web3/utils/abi.py +300 -85
- {web3-7.5.0 → web3-7.6.1}/web3/utils/address.py +8 -0
- {web3-7.5.0 → web3-7.6.1/web3.egg-info}/PKG-INFO +8 -8
- {web3-7.5.0 → web3-7.6.1}/web3.egg-info/SOURCES.txt +3 -1
- {web3-7.5.0 → web3-7.6.1}/web3.egg-info/requires.txt +7 -7
- web3-7.5.0/tests/core/contracts/test_contract_class_construction.py +0 -88
- web3-7.5.0/tests/integration/geth-1.14.5-fixture.zip +0 -0
- {web3-7.5.0 → web3-7.6.1}/LICENSE +0 -0
- {web3-7.5.0 → web3-7.6.1}/MANIFEST.in +0 -0
- {web3-7.5.0 → web3-7.6.1}/README.md +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/_normalization.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/abis.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/async_ens.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/auto.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/base_ens.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/constants.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/contract_data.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/ens.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/exceptions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/specs/nf.json +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/specs/normalization_spec.json +0 -0
- {web3-7.5.0 → web3-7.6.1}/ens/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/pyproject.toml +0 -0
- {web3-7.5.0 → web3-7.6.1}/setup.cfg +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/beacon/test_async_beacon.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/beacon/test_beacon.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/admin-module/test_admin_addPeer.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/admin-module/test_admin_peers.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/caching-utils/test_request_caching.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_build_transaction.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_caller_interface.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_constructor.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_constructor_encoding.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_deployment.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_estimate_gas.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_events.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_example.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_method_abi_encoding.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_panic_errors.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_transact_interface.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_contract_util_functions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_extracting_event_data.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_extracting_event_data_old.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/test_offchain_lookup.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/contracts/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/datastructures/test_datastructures.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_accounts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_block_api.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_default_account_api.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_eth_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_eth_fee_history.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_eth_filter.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_eth_properties.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_gas_pricing.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_poa.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-module/test_transactions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/exceptions/test_exceptions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_basic_filter_tests.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_contract_data_filters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_contract_get_logs.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_contract_on_event_filtering.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_contract_past_event_filtering.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_contract_topic_filters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_existing_filter_instance.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_filters_against_many_blocks.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/test_utils_functions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/filtering/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/test_default_middlewares.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/test_middleware_onion_api.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/test_provider_property.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/test_provider_request_wrapping.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/manager/test_response_formatters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/method-class/test_method.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/method-class/test_result_formatters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_attrdict_middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_filter_middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_formatting_middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_gas_price_strategy.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_stalecheck.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/middleware/test_transaction_signing.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/module-class/test_module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_async_http_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_async_tester_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_auto_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_base_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_http_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_http_request_retry.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_legacy_websocket_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_provider_init.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_tester_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/providers/test_websocket_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/test_library_files.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/testing-module/test_testing_mine.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_abi_is_encodable.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_abi_named_tree.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_async_transaction.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_attach_modules.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_attributedict.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_caching_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_construct_event_data_set.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_construct_event_topics.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_datatypes.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_decorators.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_encoding.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_event_filter_builder.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_fee_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_formatters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_is_probably_enum.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_is_recognized_type.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_math.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_method_formatters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_select_filter_method.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_threads.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/utilities/test_valid_transaction_params.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_api.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_attach_modules.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_client_version.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_conversions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_import_and_version.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_keccak.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_providers.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/core/web3-module/test_web3_inheritance.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/normalization/normalization_tests.json +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/normalization/test_normalize_name_ensip15.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_ens.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_get_registry.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_get_text.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_nameprep.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_offchain_resolution.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_setup_address.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_setup_name.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/ens/test_wildcard_resolution.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/README.md +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/common.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/generate_fixtures/common.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/common.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_http.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ipc.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/go_ethereum/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/integration/test_ethereum_tester.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/tests/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/abi_element_identifiers.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/async_caching.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/async_transactions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/batching.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/blocks.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/caching/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/caching/caching_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/caching/request_caching_validation.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/compat/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/datatypes.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/decorators.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/empty.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/encoding.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/ens.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/error_formatters_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/events.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/fee_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/filters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/formatters.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/http.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/http_session_manager.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/hypothesis.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/math.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/go_ethereum_debug_module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/module_testing_utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/persistent_connection_provider.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/module_testing/web3_module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/normalizers.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/threads.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/transactions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/type_conversion.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/utility_methods.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/_utils/windows.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/auto/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/auto/gethdev.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/beacon/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/beacon/api_endpoints.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/beacon/async_beacon.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/beacon/beacon.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/constants.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/contract/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/datastructures.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/eth/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/eth/base_eth.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/exceptions.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/gas_strategies/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/gas_strategies/time_based.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/geth.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/logs.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/main.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/manager.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/method.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/attrdict.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/base.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/filter.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/formatting.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/names.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/pythonic.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/signing.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/stalecheck.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/middleware/validation.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/module.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/net.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/async_base.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/auto.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/base.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/eth_tester/main.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/legacy_websocket.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/persistent.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/persistent_connection.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/request_processor.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/persistent/websocket.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/rpc/async_rpc.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/rpc/rpc.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/providers/rpc/utils.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/py.typed +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/scripts/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/scripts/install_pre_releases.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/scripts/parse_pygeth_version.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/scripts/release/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/scripts/release/test_package.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/testing.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/tracing.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/types.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/utils/__init__.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/utils/caching.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3/utils/exception_handling.py +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.5.0 → web3-7.6.1}/web3.egg-info/not-zip-safe +0 -0
- {web3-7.5.0 → web3-7.6.1}/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.
|
|
3
|
+
Version: 7.6.1
|
|
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
|
|
@@ -33,11 +33,11 @@ Requires-Dist: pywin32>=223; platform_system == "Windows"
|
|
|
33
33
|
Requires-Dist: requests>=2.23.0
|
|
34
34
|
Requires-Dist: typing-extensions>=4.0.1
|
|
35
35
|
Requires-Dist: types-requests>=2.0.0
|
|
36
|
-
Requires-Dist: websockets
|
|
36
|
+
Requires-Dist: websockets<14.0.0,>=10.0.0
|
|
37
37
|
Requires-Dist: pyunormalize>=15.0.0
|
|
38
38
|
Provides-Extra: tester
|
|
39
|
-
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.
|
|
40
|
-
Requires-Dist: py-geth>=5.
|
|
39
|
+
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "tester"
|
|
40
|
+
Requires-Dist: py-geth>=5.1.0; extra == "tester"
|
|
41
41
|
Provides-Extra: dev
|
|
42
42
|
Requires-Dist: build>=0.9.0; extra == "dev"
|
|
43
43
|
Requires-Dist: bumpversion>=0.5.3; extra == "dev"
|
|
@@ -59,8 +59,8 @@ Requires-Dist: hypothesis>=3.31.2; extra == "dev"
|
|
|
59
59
|
Requires-Dist: tox>=4.0.0; extra == "dev"
|
|
60
60
|
Requires-Dist: mypy==1.10.0; extra == "dev"
|
|
61
61
|
Requires-Dist: pre-commit>=3.4.0; extra == "dev"
|
|
62
|
-
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.
|
|
63
|
-
Requires-Dist: py-geth>=5.
|
|
62
|
+
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "dev"
|
|
63
|
+
Requires-Dist: py-geth>=5.1.0; extra == "dev"
|
|
64
64
|
Provides-Extra: docs
|
|
65
65
|
Requires-Dist: sphinx>=6.0.0; extra == "docs"
|
|
66
66
|
Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "docs"
|
|
@@ -76,8 +76,8 @@ Requires-Dist: hypothesis>=3.31.2; extra == "test"
|
|
|
76
76
|
Requires-Dist: tox>=4.0.0; extra == "test"
|
|
77
77
|
Requires-Dist: mypy==1.10.0; extra == "test"
|
|
78
78
|
Requires-Dist: pre-commit>=3.4.0; extra == "test"
|
|
79
|
-
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.
|
|
80
|
-
Requires-Dist: py-geth>=5.
|
|
79
|
+
Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "test"
|
|
80
|
+
Requires-Dist: py-geth>=5.1.0; extra == "test"
|
|
81
81
|
|
|
82
82
|
# web3.py
|
|
83
83
|
|
|
@@ -8,8 +8,8 @@ extras_require = {
|
|
|
8
8
|
"tester": [
|
|
9
9
|
# Note: ethereum-maintained libraries in this list should be added to the
|
|
10
10
|
# `install_pre_releases.py` script.
|
|
11
|
-
"eth-tester[py-evm]>=0.
|
|
12
|
-
"py-geth>=5.
|
|
11
|
+
"eth-tester[py-evm]>=0.12.0b1,<0.13.0b1",
|
|
12
|
+
"py-geth>=5.1.0",
|
|
13
13
|
],
|
|
14
14
|
"dev": [
|
|
15
15
|
"build>=0.9.0",
|
|
@@ -55,7 +55,7 @@ with open("./README.md") as readme:
|
|
|
55
55
|
setup(
|
|
56
56
|
name="web3",
|
|
57
57
|
# *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme
|
|
58
|
-
version="7.
|
|
58
|
+
version="7.6.1",
|
|
59
59
|
description="""web3: A Python library for interacting with Ethereum""",
|
|
60
60
|
long_description=long_description,
|
|
61
61
|
long_description_content_type="text/markdown",
|
|
@@ -78,7 +78,7 @@ setup(
|
|
|
78
78
|
"requests>=2.23.0",
|
|
79
79
|
"typing-extensions>=4.0.1",
|
|
80
80
|
"types-requests>=2.0.0",
|
|
81
|
-
"websockets>=10.0.0",
|
|
81
|
+
"websockets>=10.0.0,<14.0.0",
|
|
82
82
|
"pyunormalize>=15.0.0",
|
|
83
83
|
],
|
|
84
84
|
python_requires=">=3.8, <4",
|
|
@@ -10,6 +10,12 @@ from tests.core.contracts.utils import (
|
|
|
10
10
|
from tests.utils import (
|
|
11
11
|
async_partial,
|
|
12
12
|
)
|
|
13
|
+
from web3._utils.abi import (
|
|
14
|
+
get_abi_element_signature,
|
|
15
|
+
)
|
|
16
|
+
from web3._utils.contract_sources.contract_data.ambiguous_function_contract import (
|
|
17
|
+
AMBIGUOUS_FUNCTION_CONTRACT_DATA,
|
|
18
|
+
)
|
|
13
19
|
from web3._utils.contract_sources.contract_data.arrays_contract import (
|
|
14
20
|
ARRAYS_CONTRACT_DATA,
|
|
15
21
|
)
|
|
@@ -22,6 +28,7 @@ from web3._utils.contract_sources.contract_data.contract_caller_tester import (
|
|
|
22
28
|
CONTRACT_CALLER_TESTER_DATA,
|
|
23
29
|
)
|
|
24
30
|
from web3._utils.contract_sources.contract_data.event_contracts import (
|
|
31
|
+
AMBIGUOUS_EVENT_NAME_CONTRACT_DATA,
|
|
25
32
|
EVENT_CONTRACT_DATA,
|
|
26
33
|
INDEXED_EVENT_CONTRACT_DATA,
|
|
27
34
|
)
|
|
@@ -61,6 +68,10 @@ from web3._utils.contract_sources.contract_data.tuple_contracts import (
|
|
|
61
68
|
from web3.exceptions import (
|
|
62
69
|
Web3ValueError,
|
|
63
70
|
)
|
|
71
|
+
from web3.utils.abi import (
|
|
72
|
+
abi_to_signature,
|
|
73
|
+
get_abi_element,
|
|
74
|
+
)
|
|
64
75
|
|
|
65
76
|
# --- function name tester contract --- #
|
|
66
77
|
|
|
@@ -187,6 +198,26 @@ def non_strict_string_contract(
|
|
|
187
198
|
)
|
|
188
199
|
|
|
189
200
|
|
|
201
|
+
# --- ambiguous function contract --- #
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
@pytest.fixture(scope="session")
|
|
205
|
+
def ambiguous_function_contract_data():
|
|
206
|
+
return AMBIGUOUS_FUNCTION_CONTRACT_DATA
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
@pytest.fixture
|
|
210
|
+
def ambiguous_function_contract_factory(w3):
|
|
211
|
+
return w3.eth.contract(**AMBIGUOUS_FUNCTION_CONTRACT_DATA)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
@pytest.fixture
|
|
215
|
+
def ambiguous_function_contract(
|
|
216
|
+
w3, ambiguous_function_contract_factory, address_conversion_func
|
|
217
|
+
):
|
|
218
|
+
return deploy(w3, ambiguous_function_contract_factory, address_conversion_func)
|
|
219
|
+
|
|
220
|
+
|
|
190
221
|
# --- emitter contract --- #
|
|
191
222
|
|
|
192
223
|
|
|
@@ -283,6 +314,30 @@ def indexed_event_contract(
|
|
|
283
314
|
return indexed_event_contract
|
|
284
315
|
|
|
285
316
|
|
|
317
|
+
@pytest.fixture
|
|
318
|
+
def ambiguous_event_contract(
|
|
319
|
+
w3, wait_for_block, wait_for_transaction, address_conversion_func
|
|
320
|
+
):
|
|
321
|
+
wait_for_block(w3)
|
|
322
|
+
|
|
323
|
+
ambiguous_event_contract_factory = w3.eth.contract(
|
|
324
|
+
**AMBIGUOUS_EVENT_NAME_CONTRACT_DATA
|
|
325
|
+
)
|
|
326
|
+
deploy_txn_hash = ambiguous_event_contract_factory.constructor().transact(
|
|
327
|
+
{"gas": 1000000}
|
|
328
|
+
)
|
|
329
|
+
deploy_receipt = wait_for_transaction(w3, deploy_txn_hash)
|
|
330
|
+
contract_address = address_conversion_func(deploy_receipt["contractAddress"])
|
|
331
|
+
|
|
332
|
+
bytecode = w3.eth.get_code(contract_address)
|
|
333
|
+
assert bytecode == ambiguous_event_contract_factory.bytecode_runtime
|
|
334
|
+
ambiguous_event_name_contract = ambiguous_event_contract_factory(
|
|
335
|
+
address=contract_address
|
|
336
|
+
)
|
|
337
|
+
assert ambiguous_event_name_contract.address == contract_address
|
|
338
|
+
return ambiguous_event_name_contract
|
|
339
|
+
|
|
340
|
+
|
|
286
341
|
# --- arrays contract --- #
|
|
287
342
|
|
|
288
343
|
|
|
@@ -470,6 +525,11 @@ def invoke_contract(
|
|
|
470
525
|
func_kwargs=None,
|
|
471
526
|
tx_params=None,
|
|
472
527
|
):
|
|
528
|
+
function_signature = contract_function
|
|
529
|
+
function_arg_count = len(func_args or ()) + len(func_kwargs or {})
|
|
530
|
+
if function_arg_count == 0:
|
|
531
|
+
function_signature = get_abi_element_signature(contract_function)
|
|
532
|
+
|
|
473
533
|
if func_args is None:
|
|
474
534
|
func_args = []
|
|
475
535
|
if func_kwargs is None:
|
|
@@ -482,7 +542,14 @@ def invoke_contract(
|
|
|
482
542
|
f"allowable_invoke_method must be one of: {allowable_call_desig}"
|
|
483
543
|
)
|
|
484
544
|
|
|
485
|
-
|
|
545
|
+
fn_abi = get_abi_element(
|
|
546
|
+
contract.abi,
|
|
547
|
+
function_signature,
|
|
548
|
+
*func_args,
|
|
549
|
+
abi_codec=contract.w3.codec,
|
|
550
|
+
**func_kwargs,
|
|
551
|
+
)
|
|
552
|
+
function = contract.functions[abi_to_signature(fn_abi)]
|
|
486
553
|
result = getattr(function(*func_args, **func_kwargs), api_call_desig)(tx_params)
|
|
487
554
|
|
|
488
555
|
return result
|
|
@@ -736,6 +803,17 @@ async def async_nested_tuple_contract_with_decode_tuples(
|
|
|
736
803
|
)
|
|
737
804
|
|
|
738
805
|
|
|
806
|
+
@pytest_asyncio.fixture
|
|
807
|
+
async def async_ambiguous_event_contract(async_w3, address_conversion_func):
|
|
808
|
+
async_ambiguous_event_contract_factory = async_w3.eth.contract(
|
|
809
|
+
**AMBIGUOUS_EVENT_NAME_CONTRACT_DATA
|
|
810
|
+
)
|
|
811
|
+
|
|
812
|
+
return await async_deploy(
|
|
813
|
+
async_w3, async_ambiguous_event_contract_factory, address_conversion_func
|
|
814
|
+
)
|
|
815
|
+
|
|
816
|
+
|
|
739
817
|
async def async_invoke_contract(
|
|
740
818
|
api_call_desig="call",
|
|
741
819
|
contract=None,
|
|
@@ -744,6 +822,11 @@ async def async_invoke_contract(
|
|
|
744
822
|
func_kwargs=None,
|
|
745
823
|
tx_params=None,
|
|
746
824
|
):
|
|
825
|
+
function_signature = contract_function
|
|
826
|
+
function_arg_count = len(func_args or ()) + len(func_kwargs or {})
|
|
827
|
+
if function_arg_count == 0:
|
|
828
|
+
function_signature = get_abi_element_signature(contract_function)
|
|
829
|
+
|
|
747
830
|
if func_args is None:
|
|
748
831
|
func_args = []
|
|
749
832
|
if func_kwargs is None:
|
|
@@ -756,7 +839,14 @@ async def async_invoke_contract(
|
|
|
756
839
|
f"allowable_invoke_method must be one of: {allowable_call_desig}"
|
|
757
840
|
)
|
|
758
841
|
|
|
759
|
-
|
|
842
|
+
fn_abi = get_abi_element(
|
|
843
|
+
contract.abi,
|
|
844
|
+
function_signature,
|
|
845
|
+
*func_args,
|
|
846
|
+
abi_codec=contract.w3.codec,
|
|
847
|
+
**func_kwargs,
|
|
848
|
+
)
|
|
849
|
+
function = contract.functions[abi_to_signature(fn_abi)]
|
|
760
850
|
result = await getattr(function(*func_args, **func_kwargs), api_call_desig)(
|
|
761
851
|
tx_params
|
|
762
852
|
)
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from typing import (
|
|
3
|
+
cast,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
from eth_typing import (
|
|
7
|
+
ABI,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
from web3.contract.async_contract import (
|
|
11
|
+
AsyncContract,
|
|
12
|
+
)
|
|
13
|
+
from web3.contract.contract import (
|
|
14
|
+
Contract,
|
|
15
|
+
ContractEvent,
|
|
16
|
+
)
|
|
17
|
+
from web3.exceptions import (
|
|
18
|
+
MismatchedABI,
|
|
19
|
+
)
|
|
20
|
+
from web3.main import (
|
|
21
|
+
AsyncWeb3,
|
|
22
|
+
Web3,
|
|
23
|
+
)
|
|
24
|
+
from web3.utils.abi import (
|
|
25
|
+
get_abi_element,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
ABI_EVENT_TRANSFER = {
|
|
29
|
+
"anonymous": False,
|
|
30
|
+
"inputs": [
|
|
31
|
+
{
|
|
32
|
+
"indexed": True,
|
|
33
|
+
"internalType": "address",
|
|
34
|
+
"name": "from",
|
|
35
|
+
"type": "address",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"indexed": True,
|
|
39
|
+
"internalType": "address",
|
|
40
|
+
"name": "to",
|
|
41
|
+
"type": "address",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"indexed": False,
|
|
45
|
+
"internalType": "uint256",
|
|
46
|
+
"name": "value",
|
|
47
|
+
"type": "uint256",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
"name": "Transfer",
|
|
51
|
+
"type": "event",
|
|
52
|
+
}
|
|
53
|
+
ABI_EVENT_DEPOSIT_WITH_TUPLE = {
|
|
54
|
+
"anonymous": False,
|
|
55
|
+
"inputs": [
|
|
56
|
+
{
|
|
57
|
+
"indexed": True,
|
|
58
|
+
"internalType": "address",
|
|
59
|
+
"name": "from",
|
|
60
|
+
"type": "address",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"indexed": True,
|
|
64
|
+
"internalType": "bytes32",
|
|
65
|
+
"name": "id",
|
|
66
|
+
"type": "bytes32",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"components": [
|
|
70
|
+
{"internalType": "uint256", "name": "x", "type": "uint256"},
|
|
71
|
+
{"internalType": "uint256", "name": "y", "type": "uint256"},
|
|
72
|
+
],
|
|
73
|
+
"indexed": False,
|
|
74
|
+
"internalType": "struct DepositEventContract.T",
|
|
75
|
+
"name": "value",
|
|
76
|
+
"type": "tuple",
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
"name": "Deposit",
|
|
80
|
+
"type": "event",
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
ABI_EVENT_DEPOSIT = {
|
|
84
|
+
"anonymous": False,
|
|
85
|
+
"inputs": [
|
|
86
|
+
{
|
|
87
|
+
"indexed": True,
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "from",
|
|
90
|
+
"type": "address",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"indexed": True,
|
|
94
|
+
"internalType": "bytes32",
|
|
95
|
+
"name": "id",
|
|
96
|
+
"type": "bytes32",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"indexed": False,
|
|
100
|
+
"internalType": "uint256",
|
|
101
|
+
"name": "value",
|
|
102
|
+
"type": "uint256",
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
"name": "Deposit",
|
|
106
|
+
"type": "event",
|
|
107
|
+
}
|
|
108
|
+
ABI_FUNCTION_DEPOSIT_STRUCT = {
|
|
109
|
+
"inputs": [{"internalType": "bytes32", "name": "id", "type": "bytes32"}],
|
|
110
|
+
"name": "depositStruct",
|
|
111
|
+
"outputs": [],
|
|
112
|
+
"stateMutability": "payable",
|
|
113
|
+
"type": "function",
|
|
114
|
+
}
|
|
115
|
+
ABI_FUNCTION_DEPOSIT_VALUE = {
|
|
116
|
+
"inputs": [{"internalType": "bytes32", "name": "id", "type": "bytes32"}],
|
|
117
|
+
"name": "depositValue",
|
|
118
|
+
"outputs": [],
|
|
119
|
+
"stateMutability": "payable",
|
|
120
|
+
"type": "function",
|
|
121
|
+
}
|
|
122
|
+
AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI = [
|
|
123
|
+
ABI_EVENT_DEPOSIT_WITH_TUPLE,
|
|
124
|
+
ABI_EVENT_DEPOSIT,
|
|
125
|
+
ABI_EVENT_TRANSFER,
|
|
126
|
+
ABI_FUNCTION_DEPOSIT_STRUCT,
|
|
127
|
+
ABI_FUNCTION_DEPOSIT_VALUE,
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def test_get_abi_from_event_signature(ambiguous_event_contract: "Contract") -> None:
|
|
132
|
+
expected_event_abi = {
|
|
133
|
+
"anonymous": False,
|
|
134
|
+
"inputs": [
|
|
135
|
+
{
|
|
136
|
+
"indexed": False,
|
|
137
|
+
"internalType": "uint256",
|
|
138
|
+
"name": "arg0",
|
|
139
|
+
"type": "uint256",
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"name": "LogSingleArg",
|
|
143
|
+
"type": "event",
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
event_get_abi_result = ambiguous_event_contract.events["LogSingleArg(uint256)"].abi
|
|
147
|
+
assert expected_event_abi == event_get_abi_result
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def test_get_abi_from_event_call_without_args(ambiguous_event_contract: "Contract"):
|
|
151
|
+
expected_event_abi = {
|
|
152
|
+
"anonymous": False,
|
|
153
|
+
"inputs": [
|
|
154
|
+
{
|
|
155
|
+
"indexed": False,
|
|
156
|
+
"internalType": "uint256",
|
|
157
|
+
"name": "arg0",
|
|
158
|
+
"type": "uint256",
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"name": "LogSingleArg",
|
|
162
|
+
"type": "event",
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
event_get_abi_result = ambiguous_event_contract.events.LogSingleArg.abi
|
|
166
|
+
assert expected_event_abi == event_get_abi_result
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def test_get_abi_from_event_call_with_any_args(ambiguous_event_contract: "Contract"):
|
|
170
|
+
expected_event_abi = {
|
|
171
|
+
"anonymous": False,
|
|
172
|
+
"inputs": [
|
|
173
|
+
{
|
|
174
|
+
"indexed": False,
|
|
175
|
+
"internalType": "uint256",
|
|
176
|
+
"name": "arg0",
|
|
177
|
+
"type": "uint256",
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
"name": "LogSingleArg",
|
|
181
|
+
"type": "event",
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
event_get_abi_result = ambiguous_event_contract.events.LogSingleArg().abi
|
|
185
|
+
assert expected_event_abi == event_get_abi_result
|
|
186
|
+
|
|
187
|
+
event_get_abi_result = ambiguous_event_contract.events.LogSingleArg(1).abi
|
|
188
|
+
assert expected_event_abi == event_get_abi_result
|
|
189
|
+
|
|
190
|
+
event_get_abi_result = ambiguous_event_contract.events.LogSingleArg(
|
|
191
|
+
b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # noqa: E501
|
|
192
|
+
).abi
|
|
193
|
+
assert expected_event_abi == event_get_abi_result
|
|
194
|
+
|
|
195
|
+
event_get_abi_result = ambiguous_event_contract.events.LogSingleArg("hi").abi
|
|
196
|
+
assert expected_event_abi == event_get_abi_result
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def test_async_get_abi_from_event(
|
|
200
|
+
async_ambiguous_event_contract: "AsyncContract",
|
|
201
|
+
) -> None:
|
|
202
|
+
expected_event_abi = {
|
|
203
|
+
"anonymous": False,
|
|
204
|
+
"inputs": [
|
|
205
|
+
{
|
|
206
|
+
"indexed": False,
|
|
207
|
+
"internalType": "uint256",
|
|
208
|
+
"name": "arg0",
|
|
209
|
+
"type": "uint256",
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"name": "LogSingleArg",
|
|
213
|
+
"type": "event",
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
event_get_abi_result = async_ambiguous_event_contract.events[
|
|
217
|
+
"LogSingleArg(uint256)"
|
|
218
|
+
].abi
|
|
219
|
+
assert expected_event_abi == event_get_abi_result
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def test_get_abi_element_for_ambiguous_tuple_events() -> None:
|
|
223
|
+
event_abi = get_abi_element(
|
|
224
|
+
cast(ABI, AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI),
|
|
225
|
+
"Deposit",
|
|
226
|
+
*[
|
|
227
|
+
"0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7",
|
|
228
|
+
b"0x0",
|
|
229
|
+
],
|
|
230
|
+
**{"value": {"x": 1, "y": 2}},
|
|
231
|
+
)
|
|
232
|
+
|
|
233
|
+
assert event_abi == ABI_EVENT_DEPOSIT_WITH_TUPLE
|
|
234
|
+
|
|
235
|
+
event_abi = get_abi_element(
|
|
236
|
+
cast(ABI, AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI),
|
|
237
|
+
"Deposit",
|
|
238
|
+
*[
|
|
239
|
+
"0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7",
|
|
240
|
+
b"0x0",
|
|
241
|
+
1,
|
|
242
|
+
],
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
assert event_abi == ABI_EVENT_DEPOSIT
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def test_get_abi_element_with_signature_for_ambiguous_tuple_events() -> None:
|
|
249
|
+
event_abi = get_abi_element(
|
|
250
|
+
cast(ABI, AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI),
|
|
251
|
+
"Deposit(address,bytes32,(uint256,uint256))",
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
assert event_abi == ABI_EVENT_DEPOSIT_WITH_TUPLE
|
|
255
|
+
|
|
256
|
+
event_abi = get_abi_element(
|
|
257
|
+
cast(ABI, AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI),
|
|
258
|
+
"Deposit(address,bytes32,uint256)",
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
assert event_abi == ABI_EVENT_DEPOSIT
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
def test_get_abi_element_by_name_and_arguments_errors(
|
|
265
|
+
ambiguous_event_contract: "Contract",
|
|
266
|
+
) -> None:
|
|
267
|
+
with pytest.raises(
|
|
268
|
+
MismatchedABI,
|
|
269
|
+
match=r"ABI Not Found!\nNo element named `NotAnEvent` with 0 argument\(s\).",
|
|
270
|
+
):
|
|
271
|
+
get_abi_element(ambiguous_event_contract.abi, "NotAnEvent")
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def test_contract_event_methods(
|
|
275
|
+
w3: "Web3", ambiguous_event_contract: "Contract"
|
|
276
|
+
) -> None:
|
|
277
|
+
log_arg_event = cast(
|
|
278
|
+
ContractEvent, ambiguous_event_contract.events["LogSingleArg(uint256)"]
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
assert log_arg_event.abi == {
|
|
282
|
+
"anonymous": False,
|
|
283
|
+
"inputs": [
|
|
284
|
+
{
|
|
285
|
+
"indexed": False,
|
|
286
|
+
"internalType": "uint256",
|
|
287
|
+
"name": "arg0",
|
|
288
|
+
"type": "uint256",
|
|
289
|
+
}
|
|
290
|
+
],
|
|
291
|
+
"name": "LogSingleArg",
|
|
292
|
+
"type": "event",
|
|
293
|
+
}
|
|
294
|
+
assert log_arg_event.name == "LogSingleArg"
|
|
295
|
+
assert log_arg_event.abi_element_identifier == "LogSingleArg(uint256)"
|
|
296
|
+
assert log_arg_event.get_logs() == []
|
|
297
|
+
|
|
298
|
+
filter_builder = log_arg_event.build_filter()
|
|
299
|
+
filter_builder.from_block = "latest"
|
|
300
|
+
filter_builder.to_block = "latest"
|
|
301
|
+
filter_builder.args.arg0.match_single(1)
|
|
302
|
+
filter_instance = filter_builder.deploy(w3)
|
|
303
|
+
|
|
304
|
+
assert filter_instance.filter_params == {
|
|
305
|
+
"fromBlock": "latest",
|
|
306
|
+
"toBlock": "latest",
|
|
307
|
+
"address": ambiguous_event_contract.address,
|
|
308
|
+
"topics": (
|
|
309
|
+
"0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",
|
|
310
|
+
),
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
log_filter = log_arg_event.create_filter(from_block="latest")
|
|
314
|
+
log_entry = {
|
|
315
|
+
"address": ambiguous_event_contract.address,
|
|
316
|
+
"topics": (
|
|
317
|
+
"0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",
|
|
318
|
+
),
|
|
319
|
+
"data": "0x0000000000000000000000000000000000000000000000000000000000000005",
|
|
320
|
+
"logIndex": 0,
|
|
321
|
+
"transactionIndex": 0,
|
|
322
|
+
"transactionHash": "0x0",
|
|
323
|
+
"blockHash": "0x0",
|
|
324
|
+
"blockNumber": 0,
|
|
325
|
+
}
|
|
326
|
+
assert log_filter.log_entry_formatter(log_entry) == {
|
|
327
|
+
"args": {"arg0": 5},
|
|
328
|
+
"event": "LogSingleArg",
|
|
329
|
+
"logIndex": 0,
|
|
330
|
+
"transactionIndex": 0,
|
|
331
|
+
"transactionHash": "0x0",
|
|
332
|
+
"address": ambiguous_event_contract.address,
|
|
333
|
+
"blockHash": "0x0",
|
|
334
|
+
"blockNumber": 0,
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
@pytest.mark.asyncio
|
|
339
|
+
async def test_async_contract_event_methods(
|
|
340
|
+
async_w3: "AsyncWeb3", async_ambiguous_event_contract: "AsyncContract"
|
|
341
|
+
) -> None:
|
|
342
|
+
log_arg_event = cast(
|
|
343
|
+
ContractEvent, async_ambiguous_event_contract.events["LogSingleArg(uint256)"]
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
assert log_arg_event.abi == {
|
|
347
|
+
"anonymous": False,
|
|
348
|
+
"inputs": [
|
|
349
|
+
{
|
|
350
|
+
"indexed": False,
|
|
351
|
+
"internalType": "uint256",
|
|
352
|
+
"name": "arg0",
|
|
353
|
+
"type": "uint256",
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"name": "LogSingleArg",
|
|
357
|
+
"type": "event",
|
|
358
|
+
}
|
|
359
|
+
assert log_arg_event.event_name == "LogSingleArg"
|
|
360
|
+
assert log_arg_event.name == "LogSingleArg"
|
|
361
|
+
assert log_arg_event.abi_element_identifier == "LogSingleArg(uint256)"
|
|
362
|
+
assert await log_arg_event.get_logs() == []
|
|
363
|
+
|
|
364
|
+
filter_builder = log_arg_event.build_filter()
|
|
365
|
+
filter_builder.from_block = "latest"
|
|
366
|
+
filter_builder.to_block = "latest"
|
|
367
|
+
filter_builder.args.arg0.match_single(1)
|
|
368
|
+
filter_instance = await filter_builder.deploy(async_w3)
|
|
369
|
+
|
|
370
|
+
assert filter_instance.filter_params == {
|
|
371
|
+
"fromBlock": "latest",
|
|
372
|
+
"toBlock": "latest",
|
|
373
|
+
"address": async_ambiguous_event_contract.address,
|
|
374
|
+
"topics": (
|
|
375
|
+
"0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",
|
|
376
|
+
),
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
log_filter = await log_arg_event.create_filter(from_block="latest")
|
|
380
|
+
log_entry = {
|
|
381
|
+
"address": async_ambiguous_event_contract.address,
|
|
382
|
+
"topics": (
|
|
383
|
+
"0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",
|
|
384
|
+
),
|
|
385
|
+
"data": "0x0000000000000000000000000000000000000000000000000000000000000005",
|
|
386
|
+
"logIndex": 0,
|
|
387
|
+
"transactionIndex": 0,
|
|
388
|
+
"transactionHash": "0x0",
|
|
389
|
+
"blockHash": "0x0",
|
|
390
|
+
"blockNumber": 0,
|
|
391
|
+
}
|
|
392
|
+
assert log_filter.log_entry_formatter(log_entry) == {
|
|
393
|
+
"args": {"arg0": 5},
|
|
394
|
+
"event": "LogSingleArg",
|
|
395
|
+
"logIndex": 0,
|
|
396
|
+
"transactionIndex": 0,
|
|
397
|
+
"transactionHash": "0x0",
|
|
398
|
+
"address": async_ambiguous_event_contract.address,
|
|
399
|
+
"blockHash": "0x0",
|
|
400
|
+
"blockNumber": 0,
|
|
401
|
+
}
|