web3 7.4.0__tar.gz → 7.5.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.4.0/web3.egg-info → web3-7.5.0}/PKG-INFO +2 -1
- {web3-7.4.0 → web3-7.5.0}/setup.py +2 -1
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/conftest.py +46 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_ambiguous_functions.py +47 -0
- web3-7.5.0/tests/core/contracts/test_contract_events.py +145 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_extracting_event_data.py +115 -46
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_extracting_event_data_old.py +2 -24
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_filters_against_many_blocks.py +4 -8
- web3-7.5.0/tests/integration/geth-1.14.5-fixture.zip +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/common.py +2 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_http.py +11 -1
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_ipc.py +10 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +6 -1
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +1 -1
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +5 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +5 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +5 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/utils.py +2 -1
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/arrays_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +5 -5
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +7 -7
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/emitter_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/event_contracts.py +5 -5
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/extended_resolver.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/math_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/payable_tester.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +5 -5
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/revert_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/simple_resolver.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/storage_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/string_contract.py +3 -3
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +5 -5
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/method_formatters.py +108 -1
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/__init__.py +4 -0
- web3-7.5.0/web3/_utils/module_testing/go_ethereum_debug_module.py +128 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/rpc_abi.py +3 -0
- {web3-7.4.0 → web3-7.5.0}/web3/contract/async_contract.py +45 -2
- {web3-7.4.0 → web3-7.5.0}/web3/contract/base_contract.py +248 -63
- {web3-7.4.0 → web3-7.5.0}/web3/contract/contract.py +41 -0
- {web3-7.4.0 → web3-7.5.0}/web3/contract/utils.py +48 -0
- {web3-7.4.0 → web3-7.5.0}/web3/geth.py +59 -0
- {web3-7.4.0 → web3-7.5.0}/web3/main.py +4 -0
- {web3-7.4.0 → web3-7.5.0}/web3/manager.py +10 -0
- {web3-7.4.0 → web3-7.5.0}/web3/types.py +87 -2
- {web3-7.4.0 → web3-7.5.0/web3.egg-info}/PKG-INFO +2 -1
- {web3-7.4.0 → web3-7.5.0}/web3.egg-info/SOURCES.txt +2 -0
- web3-7.4.0/tests/integration/geth-1.14.5-fixture.zip +0 -0
- {web3-7.4.0 → web3-7.5.0}/LICENSE +0 -0
- {web3-7.4.0 → web3-7.5.0}/MANIFEST.in +0 -0
- {web3-7.4.0 → web3-7.5.0}/README.md +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/_normalization.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/abis.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/async_ens.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/auto.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/base_ens.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/constants.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/contract_data.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/ens.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/exceptions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/specs/nf.json +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/specs/normalization_spec.json +0 -0
- {web3-7.4.0 → web3-7.5.0}/ens/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/pyproject.toml +0 -0
- {web3-7.4.0 → web3-7.5.0}/setup.cfg +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/beacon/test_async_beacon.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/beacon/test_beacon.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/admin-module/test_admin_addPeer.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/admin-module/test_admin_peers.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/caching-utils/test_request_caching.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_attributes.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_build_transaction.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_call_interface.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_caller_interface.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_class_construction.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_constructor.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_constructor_encoding.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_deployment.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_estimate_gas.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_example.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_init.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_method_abi_decoding.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_method_abi_encoding.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_method_to_argument_matching.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_panic_errors.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_transact_interface.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_contract_util_functions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/test_offchain_lookup.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/contracts/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/datastructures/test_datastructures.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_accounts.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_block_api.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_default_account_api.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_eth_contract.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_eth_fee_history.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_eth_filter.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_eth_properties.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_gas_pricing.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_poa.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-module/test_transactions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/exceptions/test_exceptions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_basic_filter_tests.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_contract_data_filters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_contract_get_logs.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_contract_on_event_filtering.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_contract_past_event_filtering.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_contract_topic_filters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_existing_filter_instance.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/test_utils_functions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/filtering/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/test_default_middlewares.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/test_middleware_onion_api.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/test_provider_property.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/test_provider_request_wrapping.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/manager/test_response_formatters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/method-class/test_method.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/method-class/test_result_formatters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_attrdict_middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_filter_middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_formatting_middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_gas_price_strategy.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_stalecheck.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/middleware/test_transaction_signing.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/module-class/test_module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_async_http_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_async_ipc_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_async_tester_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_auto_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_base_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_http_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_http_request_retry.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_ipc_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_legacy_websocket_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_provider_init.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_tester_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/providers/test_websocket_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/test_library_files.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/testing-module/test_testing_mine.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_abi.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_abi_is_encodable.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_abi_named_tree.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_address.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_async_transaction.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_attach_modules.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_attributedict.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_caching_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_construct_event_data_set.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_construct_event_topics.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_datatypes.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_decorators.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_encoding.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_event_filter_builder.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_event_interface.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_fee_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_formatters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_http_session_manager.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_is_probably_enum.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_is_recognized_type.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_math.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_method_formatters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_select_filter_method.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_threads.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_valid_transaction_params.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/utilities/test_validation.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_api.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_attach_modules.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_client_version.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_conversions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_import_and_version.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_keccak.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_providers.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/core/web3-module/test_web3_inheritance.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/normalization/normalization_tests.json +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/normalization/test_normalize_name_ensip15.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_ens.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_get_registry.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_get_text.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_nameprep.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_offchain_resolution.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_setup_address.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_setup_name.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/ens/test_wildcard_resolution.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/README.md +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/common.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/generate_fixtures/common.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/generate_fixtures/go_ethereum.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/conftest.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/integration/test_ethereum_tester.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/tests/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/abi.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/abi_element_identifiers.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/async_caching.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/async_transactions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/batching.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/blocks.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/caching/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/caching/caching_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/caching/request_caching_validation.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/compat/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/contracts.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/datatypes.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/decorators.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/empty.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/encoding.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/ens.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/error_formatters_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/events.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/fee_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/filters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/formatters.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/http.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/http_session_manager.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/hypothesis.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/math.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/eth_module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/module_testing_utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/persistent_connection_provider.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/module_testing/web3_module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/normalizers.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/threads.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/transactions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/type_conversion.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/utility_methods.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/validation.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/_utils/windows.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/auto/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/auto/gethdev.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/beacon/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/beacon/api_endpoints.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/beacon/async_beacon.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/beacon/beacon.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/constants.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/contract/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/datastructures.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/eth/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/eth/async_eth.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/eth/base_eth.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/eth/eth.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/exceptions.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/gas_strategies/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/gas_strategies/time_based.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/logs.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/method.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/attrdict.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/base.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/filter.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/formatting.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/names.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/pythonic.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/signing.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/stalecheck.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/middleware/validation.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/module.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/net.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/async_base.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/auto.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/base.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/eth_tester/defaults.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/eth_tester/main.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/ipc.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/legacy_websocket.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/async_ipc.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/persistent.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/persistent_connection.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/request_processor.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/persistent/websocket.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/rpc/async_rpc.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/rpc/rpc.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/providers/rpc/utils.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/py.typed +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/scripts/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/scripts/install_pre_releases.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/scripts/parse_pygeth_version.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/scripts/release/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/scripts/release/test_package.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/testing.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/tracing.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/utils/__init__.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/utils/abi.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/utils/address.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/utils/caching.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3/utils/exception_handling.py +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3.egg-info/not-zip-safe +0 -0
- {web3-7.4.0 → web3-7.5.0}/web3.egg-info/requires.txt +0 -0
- {web3-7.4.0 → web3-7.5.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.
|
|
3
|
+
Version: 7.5.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
|
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
21
|
Requires-Python: >=3.8, <4
|
|
21
22
|
Description-Content-Type: text/markdown
|
|
22
23
|
License-File: LICENSE
|
|
@@ -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.5.0",
|
|
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",
|
|
@@ -100,5 +100,6 @@ setup(
|
|
|
100
100
|
"Programming Language :: Python :: 3.10",
|
|
101
101
|
"Programming Language :: Python :: 3.11",
|
|
102
102
|
"Programming Language :: Python :: 3.12",
|
|
103
|
+
"Programming Language :: Python :: 3.13",
|
|
103
104
|
],
|
|
104
105
|
)
|
|
@@ -217,6 +217,28 @@ def non_strict_emitter(
|
|
|
217
217
|
return emitter_contract
|
|
218
218
|
|
|
219
219
|
|
|
220
|
+
@pytest.fixture
|
|
221
|
+
def emitter(
|
|
222
|
+
w3,
|
|
223
|
+
emitter_contract_data,
|
|
224
|
+
wait_for_transaction,
|
|
225
|
+
wait_for_block,
|
|
226
|
+
address_conversion_func,
|
|
227
|
+
):
|
|
228
|
+
emitter_contract_factory = w3.eth.contract(**emitter_contract_data)
|
|
229
|
+
|
|
230
|
+
wait_for_block(w3)
|
|
231
|
+
deploy_txn_hash = emitter_contract_factory.constructor().transact({"gas": 30029121})
|
|
232
|
+
deploy_receipt = wait_for_transaction(w3, deploy_txn_hash)
|
|
233
|
+
contract_address = address_conversion_func(deploy_receipt["contractAddress"])
|
|
234
|
+
|
|
235
|
+
bytecode = w3.eth.get_code(contract_address)
|
|
236
|
+
assert bytecode == emitter_contract_factory.bytecode_runtime
|
|
237
|
+
_emitter = emitter_contract_factory(address=contract_address)
|
|
238
|
+
assert _emitter.address == contract_address
|
|
239
|
+
return _emitter
|
|
240
|
+
|
|
241
|
+
|
|
220
242
|
# --- event contract --- #
|
|
221
243
|
|
|
222
244
|
|
|
@@ -760,3 +782,27 @@ def async_call(request):
|
|
|
760
782
|
@pytest.fixture
|
|
761
783
|
def async_estimate_gas(request):
|
|
762
784
|
return async_partial(async_invoke_contract, api_call_desig="estimate_gas")
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
@pytest_asyncio.fixture
|
|
788
|
+
async def async_emitter(
|
|
789
|
+
async_w3,
|
|
790
|
+
emitter_contract_data,
|
|
791
|
+
async_wait_for_transaction,
|
|
792
|
+
async_wait_for_block,
|
|
793
|
+
address_conversion_func,
|
|
794
|
+
):
|
|
795
|
+
async_emitter_contract_factory = async_w3.eth.contract(**emitter_contract_data)
|
|
796
|
+
|
|
797
|
+
await async_wait_for_block(async_w3)
|
|
798
|
+
deploy_txn_hash = await async_emitter_contract_factory.constructor().transact(
|
|
799
|
+
{"gas": 10000000}
|
|
800
|
+
)
|
|
801
|
+
deploy_receipt = await async_wait_for_transaction(async_w3, deploy_txn_hash)
|
|
802
|
+
contract_address = address_conversion_func(deploy_receipt["contractAddress"])
|
|
803
|
+
|
|
804
|
+
bytecode = await async_w3.eth.get_code(contract_address)
|
|
805
|
+
assert bytecode == async_emitter_contract_factory.bytecode_runtime
|
|
806
|
+
_emitter = async_emitter_contract_factory(address=contract_address)
|
|
807
|
+
assert _emitter.address == contract_address
|
|
808
|
+
return _emitter
|
|
@@ -133,6 +133,53 @@ def test_find_or_get_functions_by_type(w3, method, args, repr_func, expected):
|
|
|
133
133
|
assert repr_func(function) == expected
|
|
134
134
|
|
|
135
135
|
|
|
136
|
+
def test_get_function_by_name(w3):
|
|
137
|
+
FUNCTION_NAME_OVERLAP_ABI = [
|
|
138
|
+
{
|
|
139
|
+
"anonymous": False,
|
|
140
|
+
"inputs": [],
|
|
141
|
+
"name": "increment",
|
|
142
|
+
"type": "function",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"anonymous": False,
|
|
146
|
+
"inputs": [],
|
|
147
|
+
"name": "incrementCount",
|
|
148
|
+
"type": "function",
|
|
149
|
+
},
|
|
150
|
+
]
|
|
151
|
+
contract = w3.eth.contract(abi=FUNCTION_NAME_OVERLAP_ABI)
|
|
152
|
+
|
|
153
|
+
increment_func = contract.get_function_by_name("increment")
|
|
154
|
+
increment_count_func = contract.get_function_by_name("incrementCount")
|
|
155
|
+
assert repr(increment_func) == "<Function increment()>"
|
|
156
|
+
assert repr(increment_count_func) == "<Function incrementCount()>"
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def test_get_event_by_name(w3):
|
|
160
|
+
EVENT_NAME_OVERLAP_ABI = [
|
|
161
|
+
{
|
|
162
|
+
"anonymous": False,
|
|
163
|
+
"inputs": [],
|
|
164
|
+
"name": "Deposit",
|
|
165
|
+
"type": "event",
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"anonymous": False,
|
|
169
|
+
"inputs": [],
|
|
170
|
+
"name": "Deposited",
|
|
171
|
+
"type": "event",
|
|
172
|
+
},
|
|
173
|
+
]
|
|
174
|
+
contract = w3.eth.contract(abi=EVENT_NAME_OVERLAP_ABI)
|
|
175
|
+
|
|
176
|
+
deposit_event = contract.get_event_by_name("Deposit")
|
|
177
|
+
deposited_event = contract.get_event_by_name("Deposited")
|
|
178
|
+
|
|
179
|
+
assert repr(deposit_event) == "<Event Deposit()>"
|
|
180
|
+
assert repr(deposited_event) == "<Event Deposited()>"
|
|
181
|
+
|
|
182
|
+
|
|
136
183
|
@pytest.mark.parametrize(
|
|
137
184
|
"method,args,expected_message,expected_error",
|
|
138
185
|
(
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from typing import (
|
|
3
|
+
Any,
|
|
4
|
+
Callable,
|
|
5
|
+
Sequence,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
from eth_typing import (
|
|
9
|
+
ABIEvent,
|
|
10
|
+
)
|
|
11
|
+
from eth_utils.toolz import (
|
|
12
|
+
compose,
|
|
13
|
+
curry,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
from web3 import (
|
|
17
|
+
Web3,
|
|
18
|
+
)
|
|
19
|
+
from web3.contract.async_contract import (
|
|
20
|
+
AsyncContractEvent,
|
|
21
|
+
)
|
|
22
|
+
from web3.contract.contract import (
|
|
23
|
+
Contract,
|
|
24
|
+
ContractEvent,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
map_repr = compose(list, curry(map, repr))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@pytest.mark.parametrize(
|
|
31
|
+
"method,args,repr_func,expected",
|
|
32
|
+
(
|
|
33
|
+
(
|
|
34
|
+
"all_events",
|
|
35
|
+
(),
|
|
36
|
+
map_repr,
|
|
37
|
+
[
|
|
38
|
+
"<Event LogSingleArg(uint256)>",
|
|
39
|
+
"<Event LogSingleWithIndex(uint256)>",
|
|
40
|
+
],
|
|
41
|
+
),
|
|
42
|
+
(
|
|
43
|
+
"get_event_by_signature",
|
|
44
|
+
("LogSingleArg(uint256)",),
|
|
45
|
+
repr,
|
|
46
|
+
"<Event LogSingleArg(uint256)>",
|
|
47
|
+
),
|
|
48
|
+
(
|
|
49
|
+
"find_events_by_name",
|
|
50
|
+
("LogSingleArg",),
|
|
51
|
+
map_repr,
|
|
52
|
+
[
|
|
53
|
+
"<Event LogSingleArg(uint256)>",
|
|
54
|
+
],
|
|
55
|
+
),
|
|
56
|
+
(
|
|
57
|
+
"get_event_by_name",
|
|
58
|
+
("LogSingleArg",),
|
|
59
|
+
repr,
|
|
60
|
+
"<Event LogSingleArg(uint256)>",
|
|
61
|
+
),
|
|
62
|
+
(
|
|
63
|
+
"find_events_by_selector",
|
|
64
|
+
(
|
|
65
|
+
b"\xf7\x0f\xe6\x89\xe2\x90\xd8\xce+*8\x8a\xc2\x8d\xb3o\xbb\x0e\x16\xa6\xd8\x9ch\x04\xc4a\xf6Z\x1b@\xbb\x15", # noqa: E501
|
|
66
|
+
),
|
|
67
|
+
map_repr,
|
|
68
|
+
[
|
|
69
|
+
"<Event LogSingleWithIndex(uint256)>",
|
|
70
|
+
],
|
|
71
|
+
),
|
|
72
|
+
(
|
|
73
|
+
"get_event_by_selector",
|
|
74
|
+
(
|
|
75
|
+
b"\xf7\x0f\xe6\x89\xe2\x90\xd8\xce+*8\x8a\xc2\x8d\xb3o\xbb\x0e\x16\xa6\xd8\x9ch\x04\xc4a\xf6Z\x1b@\xbb\x15", # noqa: E501
|
|
76
|
+
),
|
|
77
|
+
repr,
|
|
78
|
+
"<Event LogSingleWithIndex(uint256)>",
|
|
79
|
+
),
|
|
80
|
+
(
|
|
81
|
+
"get_event_by_selector",
|
|
82
|
+
(0xF70FE689E290D8CE2B2A388AC28DB36FBB0E16A6D89C6804C461F65A1B40BB15,),
|
|
83
|
+
repr,
|
|
84
|
+
"<Event LogSingleWithIndex(uint256)>",
|
|
85
|
+
),
|
|
86
|
+
(
|
|
87
|
+
"get_event_by_selector",
|
|
88
|
+
("0xf70fe689e290d8ce2b2a388ac28db36fbb0e16a6d89c6804c461f65a1b40bb15",),
|
|
89
|
+
repr,
|
|
90
|
+
"<Event LogSingleWithIndex(uint256)>",
|
|
91
|
+
),
|
|
92
|
+
(
|
|
93
|
+
"get_event_by_topic",
|
|
94
|
+
("0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",),
|
|
95
|
+
repr,
|
|
96
|
+
"<Event LogSingleArg(uint256)>",
|
|
97
|
+
),
|
|
98
|
+
),
|
|
99
|
+
)
|
|
100
|
+
def test_find_or_get_events_by_type(
|
|
101
|
+
w3: "Web3",
|
|
102
|
+
method: str,
|
|
103
|
+
args: Sequence[str],
|
|
104
|
+
repr_func: Callable[[Any], str],
|
|
105
|
+
expected: str,
|
|
106
|
+
event_contract: "Contract",
|
|
107
|
+
) -> None:
|
|
108
|
+
contract = w3.eth.contract(abi=event_contract.abi)
|
|
109
|
+
contract_event = getattr(contract, method)(*args)
|
|
110
|
+
assert repr_func(contract_event) == expected
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def test_find_events_by_identifier(w3: "Web3", event_contract: "Contract") -> None:
|
|
114
|
+
def callable_check(event_abi: ABIEvent) -> bool:
|
|
115
|
+
return event_abi["name"] == "LogSingleArg"
|
|
116
|
+
|
|
117
|
+
contract_events = event_contract.find_events_by_identifier(
|
|
118
|
+
event_contract.abi, w3, event_contract.address, callable_check
|
|
119
|
+
)
|
|
120
|
+
assert [repr(evt) for evt in contract_events] == ["<Event LogSingleArg(uint256)>"]
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def test_get_event_by_identifier(w3: "Web3", event_contract: "Contract") -> None:
|
|
124
|
+
contract_event = event_contract.get_event_by_identifier(
|
|
125
|
+
[event_contract.events.LogSingleArg], "LogSingleArg"
|
|
126
|
+
)
|
|
127
|
+
assert repr(contract_event) == "<Event LogSingleArg(uint256)>"
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def test_events_iterator(math_contract):
|
|
131
|
+
all_events = math_contract.all_events()
|
|
132
|
+
events_iter = math_contract.events
|
|
133
|
+
|
|
134
|
+
for event, expected_event in zip(iter(events_iter), all_events):
|
|
135
|
+
assert isinstance(event, ContractEvent)
|
|
136
|
+
assert event.name == expected_event.name
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_async_events_iterator(async_math_contract):
|
|
140
|
+
all_events = async_math_contract.all_events()
|
|
141
|
+
events_iter = async_math_contract.events
|
|
142
|
+
|
|
143
|
+
for event, expected_event in zip(iter(events_iter), all_events):
|
|
144
|
+
assert isinstance(event, AsyncContractEvent)
|
|
145
|
+
assert event.name == expected_event.name
|
|
@@ -40,28 +40,6 @@ def dup_txn_receipt(w3, indexed_event_contract, wait_for_transaction, event_cont
|
|
|
40
40
|
return wait_for_transaction(w3, dup_txn_hash)
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
@pytest.fixture
|
|
44
|
-
def emitter(
|
|
45
|
-
w3,
|
|
46
|
-
emitter_contract_data,
|
|
47
|
-
wait_for_transaction,
|
|
48
|
-
wait_for_block,
|
|
49
|
-
address_conversion_func,
|
|
50
|
-
):
|
|
51
|
-
emitter_contract_factory = w3.eth.contract(**emitter_contract_data)
|
|
52
|
-
|
|
53
|
-
wait_for_block(w3)
|
|
54
|
-
deploy_txn_hash = emitter_contract_factory.constructor().transact({"gas": 30029121})
|
|
55
|
-
deploy_receipt = wait_for_transaction(w3, deploy_txn_hash)
|
|
56
|
-
contract_address = address_conversion_func(deploy_receipt["contractAddress"])
|
|
57
|
-
|
|
58
|
-
bytecode = w3.eth.get_code(contract_address)
|
|
59
|
-
assert bytecode == emitter_contract_factory.bytecode_runtime
|
|
60
|
-
_emitter = emitter_contract_factory(address=contract_address)
|
|
61
|
-
assert _emitter.address == contract_address
|
|
62
|
-
return _emitter
|
|
63
|
-
|
|
64
|
-
|
|
65
43
|
@pytest.mark.parametrize(
|
|
66
44
|
"contract_fn,event_name,call_args,expected_args",
|
|
67
45
|
(
|
|
@@ -128,7 +106,7 @@ def test_event_data_extraction(
|
|
|
128
106
|
assert len(txn_receipt["logs"]) == 1
|
|
129
107
|
log_entry = txn_receipt["logs"][0]
|
|
130
108
|
|
|
131
|
-
event_abi = emitter.
|
|
109
|
+
event_abi = emitter.get_event_by_name(event_name).abi
|
|
132
110
|
|
|
133
111
|
event_topic = getattr(emitter_contract_log_topics, event_name)
|
|
134
112
|
is_anonymous = event_abi["anonymous"]
|
|
@@ -335,7 +313,7 @@ def test_event_data_extraction_bytes(
|
|
|
335
313
|
log_entry = txn_receipt["logs"][0]
|
|
336
314
|
|
|
337
315
|
event_name = "LogListArgs"
|
|
338
|
-
event_abi = emitter.
|
|
316
|
+
event_abi = emitter.get_event_by_name(event_name).abi
|
|
339
317
|
|
|
340
318
|
event_topic = getattr(emitter_contract_log_topics, event_name)
|
|
341
319
|
|
|
@@ -386,7 +364,7 @@ def test_event_data_extraction_bytes_non_strict(
|
|
|
386
364
|
log_entry = txn_receipt["logs"][0]
|
|
387
365
|
|
|
388
366
|
event_name = "LogListArgs"
|
|
389
|
-
event_abi = non_strict_emitter.
|
|
367
|
+
event_abi = non_strict_emitter.get_event_by_name(event_name).abi
|
|
390
368
|
|
|
391
369
|
event_topic = getattr(emitter_contract_log_topics, event_name)
|
|
392
370
|
|
|
@@ -431,7 +409,7 @@ def test_dynamic_length_argument_extraction(
|
|
|
431
409
|
assert len(txn_receipt["logs"]) == 1
|
|
432
410
|
log_entry = txn_receipt["logs"][0]
|
|
433
411
|
|
|
434
|
-
event_abi = emitter.
|
|
412
|
+
event_abi = emitter.get_event_by_name("LogDynamicArgs").abi
|
|
435
413
|
|
|
436
414
|
event_topic = emitter_contract_log_topics.LogDynamicArgs
|
|
437
415
|
assert event_topic in log_entry["topics"]
|
|
@@ -466,7 +444,7 @@ def test_argument_extraction_strict_bytes_types(
|
|
|
466
444
|
log_entry = txn_receipt["logs"][0]
|
|
467
445
|
assert len(log_entry["topics"]) == 2
|
|
468
446
|
|
|
469
|
-
event_abi = emitter.
|
|
447
|
+
event_abi = emitter.get_event_by_name("LogListArgs").abi
|
|
470
448
|
|
|
471
449
|
event_topic = emitter_contract_log_topics.LogListArgs
|
|
472
450
|
assert event_topic in log_entry["topics"]
|
|
@@ -548,11 +526,88 @@ def test_contract_event_get_logs_sorted_by_log_index(w3, emitter, request_mocker
|
|
|
548
526
|
logs = emitter.events.LogNoArguments().get_logs()
|
|
549
527
|
|
|
550
528
|
sorted_logs = sorted(
|
|
551
|
-
emitter.events.LogNoArguments
|
|
529
|
+
emitter.events.LogNoArguments.get_logs(),
|
|
552
530
|
key=lambda log: log["logIndex"],
|
|
553
531
|
)
|
|
554
532
|
sorted_logs = sorted(
|
|
555
|
-
emitter.events.LogNoArguments
|
|
533
|
+
emitter.events.LogNoArguments.get_logs(),
|
|
534
|
+
key=lambda log: log["blockNumber"],
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
assert len(logs) == 4
|
|
538
|
+
assert logs == sorted_logs
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
@pytest.mark.asyncio
|
|
542
|
+
async def test_async_contract_event_get_logs_sorted_by_log_index(
|
|
543
|
+
async_w3, async_emitter, request_mocker
|
|
544
|
+
):
|
|
545
|
+
get_logs_response = [
|
|
546
|
+
{
|
|
547
|
+
"type": "mined",
|
|
548
|
+
"logIndex": 10,
|
|
549
|
+
"transactionIndex": 0,
|
|
550
|
+
"transactionHash": "0xaef7f312d863780b861d8c38984b2a33f77e9508810735e2b042143f7f189f83", # noqa: E501
|
|
551
|
+
"blockHash": "0x2200ec3324fdaca4ee2f4629489d2d06fb28108dae61b63b84ef39702e2b64e7", # noqa: E501
|
|
552
|
+
"blockNumber": 3,
|
|
553
|
+
"address": "0xF2E246BB76DF876Cef8b38ae84130F4F55De395b",
|
|
554
|
+
"data": "0x",
|
|
555
|
+
"topics": [
|
|
556
|
+
"0x1e86022f78f8d04f8e3dfd13a2bdb280403e6632877c0dbee5e4eeb259908a5c"
|
|
557
|
+
],
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"type": "mined",
|
|
561
|
+
"logIndex": 0,
|
|
562
|
+
"transactionIndex": 0,
|
|
563
|
+
"transactionHash": "0x61e57bb1b5af14ca1b0964a84fb640bf39927961f26311a6450475a749e00cbb", # noqa: E501
|
|
564
|
+
"blockHash": "0x73dd9a3b0f581689ebd67adea0debe05672a334c723379dc506fb71a666c1754", # noqa: E501
|
|
565
|
+
"blockNumber": 4,
|
|
566
|
+
"address": "0xF2E246BB76DF876Cef8b38ae84130F4F55De395b",
|
|
567
|
+
"data": "0x",
|
|
568
|
+
"topics": [
|
|
569
|
+
"0x1e86022f78f8d04f8e3dfd13a2bdb280403e6632877c0dbee5e4eeb259908a5c"
|
|
570
|
+
],
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"type": "mined",
|
|
574
|
+
"logIndex": 123,
|
|
575
|
+
"transactionIndex": 0,
|
|
576
|
+
"transactionHash": "0x61e57bb1b5af14ca1b0964a84fb640bf39927961f26311a6450475a749e00cbb", # noqa: E501
|
|
577
|
+
"blockHash": "0x73dd9a3b0f581689ebd67adea0debe05672a334c723379dc506fb71a666c1754", # noqa: E501
|
|
578
|
+
"blockNumber": 1,
|
|
579
|
+
"address": "0xF2E246BB76DF876Cef8b38ae84130F4F55De395b",
|
|
580
|
+
"data": "0x",
|
|
581
|
+
"topics": [
|
|
582
|
+
"0x1e86022f78f8d04f8e3dfd13a2bdb280403e6632877c0dbee5e4eeb259908a5c"
|
|
583
|
+
],
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"type": "mined",
|
|
587
|
+
"logIndex": 54,
|
|
588
|
+
"transactionIndex": 0,
|
|
589
|
+
"transactionHash": "0x61e57bb1b5af14ca1b0964a84fb640bf39927961f26311a6450475a749e00cbb", # noqa: E501
|
|
590
|
+
"blockHash": "0x73dd9a3b0f581689ebd67adea0debe05672a334c723379dc506fb71a666c1754", # noqa: E501
|
|
591
|
+
"blockNumber": 1,
|
|
592
|
+
"address": "0xF2E246BB76DF876Cef8b38ae84130F4F55De395b",
|
|
593
|
+
"data": "0x",
|
|
594
|
+
"topics": [
|
|
595
|
+
"0x1e86022f78f8d04f8e3dfd13a2bdb280403e6632877c0dbee5e4eeb259908a5c"
|
|
596
|
+
],
|
|
597
|
+
},
|
|
598
|
+
]
|
|
599
|
+
|
|
600
|
+
async with request_mocker(
|
|
601
|
+
async_w3, mock_results={"eth_getLogs": lambda *_: get_logs_response}
|
|
602
|
+
):
|
|
603
|
+
logs = await async_emitter.events.LogNoArguments().get_logs()
|
|
604
|
+
|
|
605
|
+
sorted_logs = sorted(
|
|
606
|
+
await async_emitter.events.LogNoArguments.get_logs(),
|
|
607
|
+
key=lambda log: log["logIndex"],
|
|
608
|
+
)
|
|
609
|
+
sorted_logs = sorted(
|
|
610
|
+
await async_emitter.events.LogNoArguments.get_logs(),
|
|
556
611
|
key=lambda log: log["blockNumber"],
|
|
557
612
|
)
|
|
558
613
|
|
|
@@ -773,6 +828,7 @@ def test_contract_event_get_logs_sorted_by_log_index(w3, emitter, request_mocker
|
|
|
773
828
|
),
|
|
774
829
|
),
|
|
775
830
|
)
|
|
831
|
+
@pytest.mark.parametrize("event_is_instance", (True, False))
|
|
776
832
|
def test_event_rich_log(
|
|
777
833
|
w3,
|
|
778
834
|
emitter,
|
|
@@ -784,6 +840,7 @@ def test_event_rich_log(
|
|
|
784
840
|
call_args,
|
|
785
841
|
process_receipt,
|
|
786
842
|
expected_args,
|
|
843
|
+
event_is_instance,
|
|
787
844
|
):
|
|
788
845
|
emitter_fn = emitter.functions[contract_fn]
|
|
789
846
|
if hasattr(emitter_contract_event_ids, event_name):
|
|
@@ -796,14 +853,19 @@ def test_event_rich_log(
|
|
|
796
853
|
txn_hash = emitter_fn(*call_args).transact()
|
|
797
854
|
txn_receipt = wait_for_transaction(w3, txn_hash)
|
|
798
855
|
|
|
799
|
-
|
|
856
|
+
if event_is_instance:
|
|
857
|
+
event_object = emitter.events[event_name]()
|
|
858
|
+
elif not event_is_instance:
|
|
859
|
+
event_object = emitter.events[event_name]
|
|
860
|
+
else:
|
|
861
|
+
raise Exception("Unreachable!")
|
|
800
862
|
|
|
801
863
|
if process_receipt:
|
|
802
|
-
processed_logs =
|
|
864
|
+
processed_logs = event_object.process_receipt(txn_receipt)
|
|
803
865
|
assert len(processed_logs) == 1
|
|
804
866
|
rich_log = processed_logs[0]
|
|
805
867
|
elif not process_receipt:
|
|
806
|
-
rich_log =
|
|
868
|
+
rich_log = event_object.process_log(txn_receipt["logs"][0])
|
|
807
869
|
else:
|
|
808
870
|
raise Exception("Unreachable!")
|
|
809
871
|
|
|
@@ -819,7 +881,7 @@ def test_event_rich_log(
|
|
|
819
881
|
|
|
820
882
|
quiet_event = emitter.events["LogBytes"]
|
|
821
883
|
with pytest.warns(UserWarning, match=warning_msg):
|
|
822
|
-
empty_rich_log = quiet_event
|
|
884
|
+
empty_rich_log = quiet_event.process_receipt(txn_receipt)
|
|
823
885
|
assert empty_rich_log == tuple()
|
|
824
886
|
|
|
825
887
|
|
|
@@ -1036,6 +1098,7 @@ def test_event_rich_log(
|
|
|
1036
1098
|
),
|
|
1037
1099
|
),
|
|
1038
1100
|
)
|
|
1101
|
+
@pytest.mark.parametrize("event_is_instance", (True, False))
|
|
1039
1102
|
def test_event_rich_log_non_strict(
|
|
1040
1103
|
w3_non_strict_abi,
|
|
1041
1104
|
non_strict_emitter,
|
|
@@ -1047,6 +1110,7 @@ def test_event_rich_log_non_strict(
|
|
|
1047
1110
|
call_args,
|
|
1048
1111
|
process_receipt,
|
|
1049
1112
|
expected_args,
|
|
1113
|
+
event_is_instance,
|
|
1050
1114
|
):
|
|
1051
1115
|
emitter_fn = non_strict_emitter.functions[contract_fn]
|
|
1052
1116
|
if hasattr(emitter_contract_event_ids, event_name):
|
|
@@ -1059,14 +1123,19 @@ def test_event_rich_log_non_strict(
|
|
|
1059
1123
|
txn_hash = emitter_fn(*call_args).transact()
|
|
1060
1124
|
txn_receipt = wait_for_transaction(w3_non_strict_abi, txn_hash)
|
|
1061
1125
|
|
|
1062
|
-
|
|
1126
|
+
if event_is_instance:
|
|
1127
|
+
event_object = non_strict_emitter.events[event_name]()
|
|
1128
|
+
elif not event_is_instance:
|
|
1129
|
+
event_object = non_strict_emitter.events[event_name]
|
|
1130
|
+
else:
|
|
1131
|
+
raise Exception("Unreachable!")
|
|
1063
1132
|
|
|
1064
1133
|
if process_receipt:
|
|
1065
|
-
processed_logs =
|
|
1134
|
+
processed_logs = event_object.process_receipt(txn_receipt)
|
|
1066
1135
|
assert len(processed_logs) == 1
|
|
1067
1136
|
rich_log = processed_logs[0]
|
|
1068
1137
|
elif not process_receipt:
|
|
1069
|
-
rich_log =
|
|
1138
|
+
rich_log = event_object.process_log(txn_receipt["logs"][0])
|
|
1070
1139
|
else:
|
|
1071
1140
|
raise Exception("Unreachable!")
|
|
1072
1141
|
|
|
@@ -1082,7 +1151,7 @@ def test_event_rich_log_non_strict(
|
|
|
1082
1151
|
|
|
1083
1152
|
quiet_event = non_strict_emitter.events["LogBytes"]
|
|
1084
1153
|
with pytest.warns(UserWarning, match=warning_msg):
|
|
1085
|
-
empty_rich_log = quiet_event
|
|
1154
|
+
empty_rich_log = quiet_event.process_receipt(txn_receipt)
|
|
1086
1155
|
assert empty_rich_log == tuple()
|
|
1087
1156
|
|
|
1088
1157
|
|
|
@@ -1093,7 +1162,7 @@ def test_event_rich_log_with_byte_args(
|
|
|
1093
1162
|
txn_hash = emitter.functions.logListArgs([b"13"], [b"54"]).transact()
|
|
1094
1163
|
txn_receipt = wait_for_transaction(w3, txn_hash)
|
|
1095
1164
|
|
|
1096
|
-
event_instance = emitter.events.LogListArgs
|
|
1165
|
+
event_instance = emitter.events.LogListArgs
|
|
1097
1166
|
|
|
1098
1167
|
if process_receipt:
|
|
1099
1168
|
processed_logs = event_instance.process_receipt(txn_receipt)
|
|
@@ -1122,7 +1191,7 @@ def test_event_rich_log_with_byte_args(
|
|
|
1122
1191
|
def test_receipt_processing_with_discard_flag(
|
|
1123
1192
|
event_contract, indexed_event_contract, dup_txn_receipt, wait_for_transaction
|
|
1124
1193
|
):
|
|
1125
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1194
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1126
1195
|
|
|
1127
1196
|
returned_logs = event_instance.process_receipt(dup_txn_receipt, errors=DISCARD)
|
|
1128
1197
|
assert returned_logs == ()
|
|
@@ -1131,7 +1200,7 @@ def test_receipt_processing_with_discard_flag(
|
|
|
1131
1200
|
def test_receipt_processing_with_ignore_flag(
|
|
1132
1201
|
event_contract, indexed_event_contract, dup_txn_receipt, wait_for_transaction
|
|
1133
1202
|
):
|
|
1134
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1203
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1135
1204
|
|
|
1136
1205
|
returned_logs = event_instance.process_receipt(dup_txn_receipt, errors=IGNORE)
|
|
1137
1206
|
assert len(returned_logs) == 2
|
|
@@ -1155,7 +1224,7 @@ def test_receipt_processing_with_ignore_flag(
|
|
|
1155
1224
|
|
|
1156
1225
|
|
|
1157
1226
|
def test_receipt_processing_with_warn_flag(indexed_event_contract, dup_txn_receipt):
|
|
1158
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1227
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1159
1228
|
|
|
1160
1229
|
with pytest.warns(UserWarning, match="Expected 1 log topics. Got 0"):
|
|
1161
1230
|
returned_logs = event_instance.process_receipt(dup_txn_receipt, errors=WARN)
|
|
@@ -1163,21 +1232,21 @@ def test_receipt_processing_with_warn_flag(indexed_event_contract, dup_txn_recei
|
|
|
1163
1232
|
|
|
1164
1233
|
|
|
1165
1234
|
def test_receipt_processing_with_strict_flag(indexed_event_contract, dup_txn_receipt):
|
|
1166
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1235
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1167
1236
|
|
|
1168
1237
|
with pytest.raises(LogTopicError, match="Expected 1 log topics. Got 0"):
|
|
1169
1238
|
event_instance.process_receipt(dup_txn_receipt, errors=STRICT)
|
|
1170
1239
|
|
|
1171
1240
|
|
|
1172
1241
|
def test_receipt_processing_with_invalid_flag(indexed_event_contract, dup_txn_receipt):
|
|
1173
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1242
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1174
1243
|
|
|
1175
1244
|
with pytest.raises(Web3AttributeError, match="Error flag must be one of: "):
|
|
1176
1245
|
event_instance.process_receipt(dup_txn_receipt, errors="not-a-flag")
|
|
1177
1246
|
|
|
1178
1247
|
|
|
1179
1248
|
def test_receipt_processing_with_no_flag(indexed_event_contract, dup_txn_receipt):
|
|
1180
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1249
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1181
1250
|
|
|
1182
1251
|
with pytest.warns(UserWarning, match="Expected 1 log topics. Got 0"):
|
|
1183
1252
|
returned_log = event_instance.process_receipt(dup_txn_receipt)
|
|
@@ -1185,7 +1254,7 @@ def test_receipt_processing_with_no_flag(indexed_event_contract, dup_txn_receipt
|
|
|
1185
1254
|
|
|
1186
1255
|
|
|
1187
1256
|
def test_single_log_processing_with_errors(indexed_event_contract, dup_txn_receipt):
|
|
1188
|
-
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1257
|
+
event_instance = indexed_event_contract.events.LogSingleWithIndex
|
|
1189
1258
|
|
|
1190
1259
|
with pytest.raises(LogTopicError, match="Expected 1 log topics. Got 0"):
|
|
1191
1260
|
event_instance.process_log(dup_txn_receipt["logs"][0])
|
|
@@ -1244,7 +1313,7 @@ def test_receipt_processing_catches_insufficientdatabytes_error_by_default(
|
|
|
1244
1313
|
):
|
|
1245
1314
|
txn_hash = emitter.functions.logListArgs([b"13"], [b"54"]).transact()
|
|
1246
1315
|
txn_receipt = wait_for_transaction(w3, txn_hash)
|
|
1247
|
-
event_instance = emitter.events.LogListArgs
|
|
1316
|
+
event_instance = emitter.events.LogListArgs
|
|
1248
1317
|
|
|
1249
1318
|
# web3 doesn't generate logs with non-standard lengths, so we have to do it manually
|
|
1250
1319
|
txn_receipt_dict = copy.deepcopy(txn_receipt)
|
|
@@ -9,28 +9,6 @@ from web3._utils.events import (
|
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
@pytest.fixture()
|
|
13
|
-
def emitter(
|
|
14
|
-
w3,
|
|
15
|
-
emitter_contract_data,
|
|
16
|
-
wait_for_transaction,
|
|
17
|
-
wait_for_block,
|
|
18
|
-
address_conversion_func,
|
|
19
|
-
):
|
|
20
|
-
emitter_contract_factory = w3.eth.contract(**emitter_contract_data)
|
|
21
|
-
|
|
22
|
-
wait_for_block(w3)
|
|
23
|
-
deploy_txn_hash = emitter_contract_factory.constructor().transact({"gas": 10000000})
|
|
24
|
-
deploy_receipt = wait_for_transaction(w3, deploy_txn_hash)
|
|
25
|
-
contract_address = address_conversion_func(deploy_receipt["contractAddress"])
|
|
26
|
-
|
|
27
|
-
bytecode = w3.eth.get_code(contract_address)
|
|
28
|
-
assert bytecode == emitter_contract_factory.bytecode_runtime
|
|
29
|
-
_emitter = emitter_contract_factory(address=contract_address)
|
|
30
|
-
assert _emitter.address == contract_address
|
|
31
|
-
return _emitter
|
|
32
|
-
|
|
33
|
-
|
|
34
12
|
@pytest.mark.parametrize(
|
|
35
13
|
"contract_fn,event_name,call_args,expected_args",
|
|
36
14
|
(
|
|
@@ -97,7 +75,7 @@ def test_event_data_extraction(
|
|
|
97
75
|
assert len(txn_receipt["logs"]) == 1
|
|
98
76
|
log_entry = txn_receipt["logs"][0]
|
|
99
77
|
|
|
100
|
-
event_abi = emitter.
|
|
78
|
+
event_abi = emitter.get_event_by_name(event_name).abi
|
|
101
79
|
|
|
102
80
|
event_topic = getattr(emitter_contract_log_topics, event_name)
|
|
103
81
|
is_anonymous = event_abi["anonymous"]
|
|
@@ -132,7 +110,7 @@ def test_dynamic_length_argument_extraction(
|
|
|
132
110
|
assert len(txn_receipt["logs"]) == 1
|
|
133
111
|
log_entry = txn_receipt["logs"][0]
|
|
134
112
|
|
|
135
|
-
event_abi = emitter.
|
|
113
|
+
event_abi = emitter.get_event_by_name("LogDynamicArgs").abi
|
|
136
114
|
|
|
137
115
|
event_topic = emitter_contract_log_topics.LogDynamicArgs
|
|
138
116
|
assert event_topic in log_entry["topics"]
|