web3 7.7.0__tar.gz → 7.8.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.7.0 → web3-7.8.0}/LICENSE +1 -1
- {web3-7.7.0/web3.egg-info → web3-7.8.0}/PKG-INFO +1 -1
- {web3-7.7.0 → web3-7.8.0}/ens/async_ens.py +1 -1
- {web3-7.7.0 → web3-7.8.0}/ens/ens.py +1 -1
- {web3-7.7.0 → web3-7.8.0}/setup.py +1 -1
- {web3-7.7.0 → web3-7.8.0}/tests/beacon/test_async_beacon.py +85 -0
- {web3-7.7.0 → web3-7.8.0}/tests/beacon/test_beacon.py +76 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_init.py +2 -2
- {web3-7.7.0 → web3-7.8.0}/tests/core/datastructures/test_datastructures.py +12 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_async_http_provider.py +23 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_async_ipc_provider.py +22 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_http_provider.py +22 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_websocket_provider.py +22 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/subscriptions/test_subscription_manager.py +82 -4
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_http_session_manager.py +48 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_ens.py +101 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/events.py +1 -1
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/http_session_manager.py +19 -1
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/eth_module.py +3 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/module_testing_utils.py +0 -42
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/persistent_connection_provider.py +38 -0
- {web3-7.7.0 → web3-7.8.0}/web3/beacon/api_endpoints.py +10 -0
- {web3-7.7.0 → web3-7.8.0}/web3/beacon/async_beacon.py +47 -0
- {web3-7.7.0 → web3-7.8.0}/web3/beacon/beacon.py +45 -0
- {web3-7.7.0 → web3-7.8.0}/web3/contract/async_contract.py +2 -206
- {web3-7.7.0 → web3-7.8.0}/web3/contract/base_contract.py +208 -12
- {web3-7.7.0 → web3-7.8.0}/web3/contract/contract.py +2 -205
- {web3-7.7.0 → web3-7.8.0}/web3/datastructures.py +4 -0
- {web3-7.7.0 → web3-7.8.0}/web3/manager.py +62 -18
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/base.py +14 -6
- {web3-7.7.0 → web3-7.8.0}/web3/providers/async_base.py +5 -4
- {web3-7.7.0 → web3-7.8.0}/web3/providers/base.py +3 -3
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/request_processor.py +11 -1
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/subscription_manager.py +110 -45
- {web3-7.7.0 → web3-7.8.0}/web3/providers/rpc/async_rpc.py +8 -3
- {web3-7.7.0 → web3-7.8.0}/web3/providers/rpc/rpc.py +8 -3
- {web3-7.7.0 → web3-7.8.0}/web3/types.py +10 -11
- {web3-7.7.0 → web3-7.8.0}/web3/utils/subscriptions.py +5 -1
- {web3-7.7.0 → web3-7.8.0/web3.egg-info}/PKG-INFO +1 -1
- {web3-7.7.0 → web3-7.8.0}/MANIFEST.in +0 -0
- {web3-7.7.0 → web3-7.8.0}/README.md +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/_normalization.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/abis.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/auto.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/base_ens.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/constants.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/contract_data.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/exceptions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/specs/nf.json +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/specs/normalization_spec.json +0 -0
- {web3-7.7.0 → web3-7.8.0}/ens/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/pyproject.toml +0 -0
- {web3-7.7.0 → web3-7.8.0}/setup.cfg +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/.DS_Store +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/admin-module/test_admin_addPeer.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/admin-module/test_admin_peers.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/caching-utils/test_request_caching.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_ambiguous_events.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_ambiguous_functions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_attributes.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_build_transaction.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_call_interface.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_caller_interface.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_class_construction.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_constructor.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_constructor_encoding.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_deployment.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_estimate_gas.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_events.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_example.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_method_abi_decoding.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_method_abi_encoding.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_method_to_argument_matching.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_panic_errors.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_transact_interface.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_contract_util_functions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_extracting_event_data.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_extracting_event_data_old.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/test_offchain_lookup.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/contracts/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_accounts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_block_api.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_default_account_api.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_eth_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_eth_fee_history.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_eth_filter.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_eth_properties.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_gas_pricing.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_poa.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-module/test_transactions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/exceptions/test_exceptions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_basic_filter_tests.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_contract_data_filters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_contract_get_logs.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_contract_on_event_filtering.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_contract_past_event_filtering.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_contract_topic_filters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_existing_filter_instance.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_filters_against_many_blocks.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/test_utils_functions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/filtering/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/test_default_middlewares.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/test_middleware_onion_api.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/test_provider_property.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/test_provider_request_wrapping.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/manager/test_response_formatters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/method-class/test_method.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/method-class/test_result_formatters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_attrdict_middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_filter_middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_formatting_middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_gas_price_strategy.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_stalecheck.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/middleware/test_transaction_signing.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/module-class/test_module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_async_tester_provider.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_auto_provider.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_base_provider.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_http_request_retry.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_ipc_provider.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_legacy_websocket_provider.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_provider_init.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/providers/test_tester_provider.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/subscriptions/test_subscriptions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/test_library_files.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/testing-module/test_testing_mine.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_abi.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_abi_is_encodable.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_abi_named_tree.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_address.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_async_transaction.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_attach_modules.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_attributedict.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_caching_utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_construct_event_data_set.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_construct_event_topics.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_datatypes.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_decorators.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_encoding.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_event_filter_builder.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_event_interface.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_fee_utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_formatters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_is_probably_enum.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_is_recognized_type.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_math.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_method_formatters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_select_filter_method.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_threads.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_valid_transaction_params.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/utilities/test_validation.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_api.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_attach_modules.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_client_version.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_conversions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_import_and_version.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_keccak.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_providers.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/core/web3-module/test_web3_inheritance.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/normalization/normalization_tests.json +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/normalization/test_normalize_name_ensip15.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_get_registry.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_get_text.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_nameprep.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_offchain_resolution.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_setup_address.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_setup_name.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/ens/test_wildcard_resolution.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/.DS_Store +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/README.md +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/common.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/generate_fixtures/common.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/generate_fixtures/go_ethereum.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/geth-1.14.12-fixture.zip +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/common.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_http.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_ipc.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/go_ethereum/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/integration/test_ethereum_tester.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/tests/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/abi.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/abi_element_identifiers.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/async_caching.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/async_transactions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/batching.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/blocks.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/caching/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/caching/caching_utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/caching/request_caching_validation.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/compat/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/ambiguous_function_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/event_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/contracts.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/datatypes.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/decorators.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/empty.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/encoding.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/ens.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/error_formatters_utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/fee_utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/filters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/formatters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/http.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/hypothesis.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/math.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/method_formatters.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/go_ethereum_debug_module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/module_testing/web3_module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/normalizers.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/rpc_abi.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/threads.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/transactions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/type_conversion.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/utility_methods.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/validation.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/_utils/windows.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/auto/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/auto/gethdev.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/beacon/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/constants.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/contract/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/contract/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/eth/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/eth/async_eth.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/eth/base_eth.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/eth/eth.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/exceptions.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/gas_strategies/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/gas_strategies/time_based.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/geth.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/logs.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/main.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/method.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/attrdict.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/filter.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/formatting.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/names.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/pythonic.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/signing.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/stalecheck.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/middleware/validation.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/module.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/net.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/auto.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/eth_tester/defaults.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/eth_tester/main.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/ipc.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/legacy_websocket.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/async_ipc.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/persistent.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/persistent_connection.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/subscription_container.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/persistent/websocket.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/providers/rpc/utils.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/py.typed +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/scripts/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/scripts/install_pre_releases.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/scripts/parse_pygeth_version.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/scripts/release/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/scripts/release/test_package.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/testing.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/tracing.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/utils/__init__.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/utils/abi.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/utils/address.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/utils/caching.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3/utils/exception_handling.py +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3.egg-info/SOURCES.txt +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3.egg-info/not-zip-safe +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3.egg-info/requires.txt +0 -0
- {web3-7.7.0 → web3-7.8.0}/web3.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2016-
|
|
3
|
+
Copyright (c) 2016-2025 The Ethereum Foundation
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -152,12 +152,12 @@ class AsyncENS(BaseENS):
|
|
|
152
152
|
:param int coin_type: if provided, look up the address for this coin type
|
|
153
153
|
:raises InvalidName: if `name` has invalid syntax
|
|
154
154
|
"""
|
|
155
|
-
r = await self.resolver(name)
|
|
156
155
|
if coin_type is None:
|
|
157
156
|
# don't validate `addr(bytes32)` interface id since extended resolvers
|
|
158
157
|
# can implement a "resolve" function as of ENSIP-10
|
|
159
158
|
return cast(ChecksumAddress, await self._resolve(name, "addr"))
|
|
160
159
|
else:
|
|
160
|
+
r = await self.resolver(name)
|
|
161
161
|
await _async_validate_resolver_and_interface_id(
|
|
162
162
|
name, r, ENS_MULTICHAIN_ADDRESS_INTERFACE_ID, "addr(bytes32,uint256)"
|
|
163
163
|
)
|
|
@@ -154,12 +154,12 @@ class ENS(BaseENS):
|
|
|
154
154
|
:raises UnsupportedFunction: if the resolver does not support the ``addr()``
|
|
155
155
|
function
|
|
156
156
|
"""
|
|
157
|
-
r = self.resolver(name)
|
|
158
157
|
if coin_type is None:
|
|
159
158
|
# don't validate `addr(bytes32)` interface id since extended resolvers
|
|
160
159
|
# can implement a "resolve" function as of ENSIP-10
|
|
161
160
|
return cast(ChecksumAddress, self._resolve(name, "addr"))
|
|
162
161
|
else:
|
|
162
|
+
r = self.resolver(name)
|
|
163
163
|
_validate_resolver_and_interface_id(
|
|
164
164
|
name, r, ENS_MULTICHAIN_ADDRESS_INTERFACE_ID, "addr(bytes32,uint256)"
|
|
165
165
|
)
|
|
@@ -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.8.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",
|
|
@@ -256,6 +256,12 @@ async def test_async_cl_node_get_peer(async_beacon):
|
|
|
256
256
|
_assert_valid_response(response)
|
|
257
257
|
|
|
258
258
|
|
|
259
|
+
@pytest.mark.asyncio
|
|
260
|
+
async def test_async_cl_node_get_peer_count(async_beacon):
|
|
261
|
+
response = await async_beacon.get_peer_count()
|
|
262
|
+
_assert_valid_response(response)
|
|
263
|
+
|
|
264
|
+
|
|
259
265
|
@pytest.mark.asyncio
|
|
260
266
|
async def test_async_cl_node_get_health(async_beacon):
|
|
261
267
|
response = await async_beacon.get_health()
|
|
@@ -285,3 +291,82 @@ async def test_async_cl_node_get_blob_sidecars(async_beacon):
|
|
|
285
291
|
# test with indices
|
|
286
292
|
with_indices = await async_beacon.get_blob_sidecars("head", [0, 1])
|
|
287
293
|
_assert_valid_response(with_indices)
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
# Validator endpoint tests:
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
@pytest.mark.asyncio
|
|
300
|
+
async def test_async_cl_validator_get_attester_duties(async_beacon):
|
|
301
|
+
finality_checkpoint_response = await async_beacon.get_finality_checkpoint()
|
|
302
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
303
|
+
|
|
304
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
305
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
306
|
+
|
|
307
|
+
validators_response = await async_beacon.get_validators()
|
|
308
|
+
_assert_valid_response(validators_response)
|
|
309
|
+
|
|
310
|
+
validators = validators_response["data"]
|
|
311
|
+
random_validator = validators[randint(0, len(validators))]
|
|
312
|
+
random_validator_index = random_validator["index"]
|
|
313
|
+
|
|
314
|
+
response = await async_beacon.get_attester_duties(epoch, [random_validator_index])
|
|
315
|
+
_assert_valid_response(response)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
@pytest.mark.asyncio
|
|
319
|
+
async def test_async_cl_validator_get_block_proposer_duties(async_beacon):
|
|
320
|
+
finality_checkpoint_response = await async_beacon.get_finality_checkpoint()
|
|
321
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
322
|
+
|
|
323
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
324
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
325
|
+
|
|
326
|
+
response = await async_beacon.get_block_proposer_duties(epoch)
|
|
327
|
+
_assert_valid_response(response)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
@pytest.mark.asyncio
|
|
331
|
+
async def test_async_cl_validator_get_sync_committee_duties(async_beacon):
|
|
332
|
+
finality_checkpoint_response = await async_beacon.get_finality_checkpoint()
|
|
333
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
334
|
+
|
|
335
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
336
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
337
|
+
|
|
338
|
+
validators_response = await async_beacon.get_validators()
|
|
339
|
+
_assert_valid_response(validators_response)
|
|
340
|
+
|
|
341
|
+
validators = validators_response["data"]
|
|
342
|
+
random_validator = validators[randint(0, len(validators))]
|
|
343
|
+
random_validator_index = random_validator["index"]
|
|
344
|
+
|
|
345
|
+
response = await async_beacon.get_sync_committee_duties(
|
|
346
|
+
epoch, [random_validator_index]
|
|
347
|
+
)
|
|
348
|
+
_assert_valid_response(response)
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
# Rewards endpoint tests:
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
@pytest.mark.asyncio
|
|
355
|
+
async def test_async_cl_validator_get_attestations_rewards(async_beacon):
|
|
356
|
+
finality_checkpoint_response = await async_beacon.get_finality_checkpoint()
|
|
357
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
358
|
+
|
|
359
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
360
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
361
|
+
|
|
362
|
+
validators_response = await async_beacon.get_validators()
|
|
363
|
+
_assert_valid_response(validators_response)
|
|
364
|
+
|
|
365
|
+
validators = validators_response["data"]
|
|
366
|
+
random_validator = validators[randint(0, len(validators))]
|
|
367
|
+
random_validator_index = random_validator["index"]
|
|
368
|
+
|
|
369
|
+
response = await async_beacon.get_attestations_rewards(
|
|
370
|
+
epoch, [random_validator_index]
|
|
371
|
+
)
|
|
372
|
+
_assert_valid_response(response)
|
|
@@ -214,6 +214,11 @@ def test_cl_node_get_peer(beacon):
|
|
|
214
214
|
_assert_valid_response(response)
|
|
215
215
|
|
|
216
216
|
|
|
217
|
+
def test_cl_node_get_peer_count(beacon):
|
|
218
|
+
response = beacon.get_peer_count()
|
|
219
|
+
_assert_valid_response(response)
|
|
220
|
+
|
|
221
|
+
|
|
217
222
|
def test_cl_node_get_health(beacon):
|
|
218
223
|
response = beacon.get_health()
|
|
219
224
|
assert isinstance(response, int)
|
|
@@ -239,3 +244,74 @@ def test_cl_node_get_blob_sidecars(beacon):
|
|
|
239
244
|
# test with indices
|
|
240
245
|
with_indices = beacon.get_blob_sidecars("head", [0, 1])
|
|
241
246
|
_assert_valid_response(with_indices)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
# Validator endpoint tests:
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def test_cl_validator_get_attester_duties(beacon):
|
|
253
|
+
finality_checkpoint_response = beacon.get_finality_checkpoint()
|
|
254
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
255
|
+
|
|
256
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
257
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
258
|
+
|
|
259
|
+
validators_response = beacon.get_validators()
|
|
260
|
+
_assert_valid_response(validators_response)
|
|
261
|
+
|
|
262
|
+
validators = validators_response["data"]
|
|
263
|
+
random_validator = validators[randint(0, len(validators))]
|
|
264
|
+
random_validator_index = random_validator["index"]
|
|
265
|
+
|
|
266
|
+
response = beacon.get_attester_duties(epoch, [random_validator_index])
|
|
267
|
+
_assert_valid_response(response)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
def test_cl_validator_get_block_proposer_duties(beacon):
|
|
271
|
+
finality_checkpoint_response = beacon.get_finality_checkpoint()
|
|
272
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
273
|
+
|
|
274
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
275
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
276
|
+
|
|
277
|
+
response = beacon.get_block_proposer_duties(epoch)
|
|
278
|
+
_assert_valid_response(response)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def test_cl_validator_get_sync_committee_duties(beacon):
|
|
282
|
+
finality_checkpoint_response = beacon.get_finality_checkpoint()
|
|
283
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
284
|
+
|
|
285
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
286
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
287
|
+
|
|
288
|
+
validators_response = beacon.get_validators()
|
|
289
|
+
_assert_valid_response(validators_response)
|
|
290
|
+
|
|
291
|
+
validators = validators_response["data"]
|
|
292
|
+
random_validator = validators[randint(0, len(validators))]
|
|
293
|
+
random_validator_index = random_validator["index"]
|
|
294
|
+
|
|
295
|
+
response = beacon.get_sync_committee_duties(epoch, [random_validator_index])
|
|
296
|
+
_assert_valid_response(response)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
# Rewards endpoint tests:
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def test_cl_validator_get_attestations_rewards(beacon):
|
|
303
|
+
finality_checkpoint_response = beacon.get_finality_checkpoint()
|
|
304
|
+
_assert_valid_response(finality_checkpoint_response)
|
|
305
|
+
|
|
306
|
+
finality_checkpoint = finality_checkpoint_response["data"]
|
|
307
|
+
epoch = finality_checkpoint["finalized"]["epoch"]
|
|
308
|
+
|
|
309
|
+
validators_response = beacon.get_validators()
|
|
310
|
+
_assert_valid_response(validators_response)
|
|
311
|
+
|
|
312
|
+
validators = validators_response["data"]
|
|
313
|
+
random_validator = validators[randint(0, len(validators))]
|
|
314
|
+
random_validator_index = random_validator["index"]
|
|
315
|
+
|
|
316
|
+
response = beacon.get_attestations_rewards(epoch, [random_validator_index])
|
|
317
|
+
_assert_valid_response(response)
|
|
@@ -85,7 +85,7 @@ def test_init_multiple_contracts_performance(w3, emitter_contract_data):
|
|
|
85
85
|
abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
|
|
86
86
|
)
|
|
87
87
|
# assert initializing 500 contracts is within a conservative / reasonable time
|
|
88
|
-
assert (time.time() - start_time) < 1.
|
|
88
|
+
assert (time.time() - start_time) < 1.75
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
# -- async -- #
|
|
@@ -98,4 +98,4 @@ def test_async_init_multiple_contracts_performance(async_w3, emitter_contract_da
|
|
|
98
98
|
abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
|
|
99
99
|
)
|
|
100
100
|
# assert initializing 500 contracts is within a conservative / reasonable time
|
|
101
|
-
assert (time.time() - start_time) < 1.
|
|
101
|
+
assert (time.time() - start_time) < 1.75
|
|
@@ -4,8 +4,12 @@ import re
|
|
|
4
4
|
|
|
5
5
|
from web3.datastructures import (
|
|
6
6
|
AttributeDict,
|
|
7
|
+
NamedElementOnion,
|
|
7
8
|
tupleize_lists_nested,
|
|
8
9
|
)
|
|
10
|
+
from web3.middleware import (
|
|
11
|
+
GasPriceStrategyMiddleware,
|
|
12
|
+
)
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
def generate_random_value(depth=0, max_depth=3, key_type=None):
|
|
@@ -207,3 +211,11 @@ def test_AttributeDict_hashing_backwards_compatibility(input, error):
|
|
|
207
211
|
assert hash(tuple(sorted(input.items()))) == hash(input)
|
|
208
212
|
else:
|
|
209
213
|
assert hash(tuple(sorted(input.items()))) == hash(input)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def test_NamedElementOnion_values():
|
|
217
|
+
middleware = GasPriceStrategyMiddleware(None)
|
|
218
|
+
initial_items = [(middleware, "gas_price_strategy")]
|
|
219
|
+
named_element_onion = NamedElementOnion(initial_items)
|
|
220
|
+
actual = [x for x in named_element_onion.values()]
|
|
221
|
+
assert actual == [middleware]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
from unittest.mock import (
|
|
3
|
+
AsyncMock,
|
|
4
|
+
patch,
|
|
5
|
+
)
|
|
2
6
|
|
|
3
7
|
from aiohttp import (
|
|
4
8
|
ClientSession,
|
|
@@ -13,6 +17,7 @@ from web3.eth import (
|
|
|
13
17
|
)
|
|
14
18
|
from web3.exceptions import (
|
|
15
19
|
ProviderConnectionError,
|
|
20
|
+
Web3RPCError,
|
|
16
21
|
)
|
|
17
22
|
from web3.geth import (
|
|
18
23
|
AsyncGeth,
|
|
@@ -107,3 +112,21 @@ def test_get_request_headers(provider):
|
|
|
107
112
|
headers["User-Agent"] == f"web3.py/{web3py_version}/"
|
|
108
113
|
f"{AsyncHTTPProvider.__module__}.{AsyncHTTPProvider.__qualname__}"
|
|
109
114
|
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@patch(
|
|
118
|
+
"web3._utils.http_session_manager.HTTPSessionManager.async_make_post_request",
|
|
119
|
+
new_callable=AsyncMock,
|
|
120
|
+
)
|
|
121
|
+
@pytest.mark.asyncio
|
|
122
|
+
async def test_async_http_empty_batch_response(mock_async_post):
|
|
123
|
+
mock_async_post.return_value = (
|
|
124
|
+
b'{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"empty batch"}}'
|
|
125
|
+
)
|
|
126
|
+
async_w3 = AsyncWeb3(AsyncHTTPProvider())
|
|
127
|
+
async with async_w3.batch_requests() as batch:
|
|
128
|
+
with pytest.raises(Web3RPCError, match="empty batch"):
|
|
129
|
+
await batch.async_execute()
|
|
130
|
+
|
|
131
|
+
# assert that even though there was an error, we have reset the batching state
|
|
132
|
+
assert not async_w3.provider._is_batching
|
|
@@ -25,6 +25,7 @@ from web3.datastructures import (
|
|
|
25
25
|
)
|
|
26
26
|
from web3.exceptions import (
|
|
27
27
|
ReadBufferLimitReached,
|
|
28
|
+
Web3RPCError,
|
|
28
29
|
)
|
|
29
30
|
from web3.providers import (
|
|
30
31
|
AsyncIPCProvider,
|
|
@@ -366,3 +367,24 @@ async def test_async_ipc_provider_write_messages_end_with_new_line_delimiter(
|
|
|
366
367
|
|
|
367
368
|
request_data = b'{"id": 0, "jsonrpc": "2.0", "method": "method", "params": []}'
|
|
368
369
|
w3.provider._writer.write.assert_called_with(request_data + b"\n")
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
@pytest.mark.asyncio
|
|
373
|
+
async def test_persistent_connection_provider_empty_batch_response(
|
|
374
|
+
simple_ipc_server,
|
|
375
|
+
jsonrpc_ipc_pipe_path,
|
|
376
|
+
):
|
|
377
|
+
async with AsyncWeb3(
|
|
378
|
+
AsyncIPCProvider(pathlib.Path(jsonrpc_ipc_pipe_path))
|
|
379
|
+
) as async_w3:
|
|
380
|
+
async_w3.provider._reader.readline = AsyncMock()
|
|
381
|
+
async_w3.provider._reader.readline.return_value = (
|
|
382
|
+
b'{"jsonrpc": "2.0","id":null,"error": {"code": -32600, "message": '
|
|
383
|
+
b'"empty batch"}}\n'
|
|
384
|
+
)
|
|
385
|
+
async with async_w3.batch_requests() as batch:
|
|
386
|
+
with pytest.raises(Web3RPCError, match="empty batch"):
|
|
387
|
+
await batch.async_execute()
|
|
388
|
+
|
|
389
|
+
# assert that even though there was an error, we have reset the batching state
|
|
390
|
+
assert not async_w3.provider._is_batching
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
from unittest.mock import (
|
|
3
|
+
Mock,
|
|
4
|
+
patch,
|
|
5
|
+
)
|
|
2
6
|
|
|
3
7
|
from requests import (
|
|
4
8
|
Session,
|
|
@@ -16,6 +20,7 @@ from web3.eth import (
|
|
|
16
20
|
)
|
|
17
21
|
from web3.exceptions import (
|
|
18
22
|
ProviderConnectionError,
|
|
23
|
+
Web3RPCError,
|
|
19
24
|
)
|
|
20
25
|
from web3.geth import (
|
|
21
26
|
Geth,
|
|
@@ -110,3 +115,20 @@ def test_get_request_headers(provider):
|
|
|
110
115
|
headers["User-Agent"] == f"web3.py/{web3py_version}/"
|
|
111
116
|
f"{HTTPProvider.__module__}.{HTTPProvider.__qualname__}"
|
|
112
117
|
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@patch(
|
|
121
|
+
"web3._utils.http_session_manager.HTTPSessionManager.make_post_request",
|
|
122
|
+
new_callable=Mock,
|
|
123
|
+
)
|
|
124
|
+
def test_http_empty_batch_response(mock_post):
|
|
125
|
+
mock_post.return_value = (
|
|
126
|
+
b'{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"empty batch"}}'
|
|
127
|
+
)
|
|
128
|
+
w3 = Web3(HTTPProvider())
|
|
129
|
+
with w3.batch_requests() as batch:
|
|
130
|
+
with pytest.raises(Web3RPCError, match="empty batch"):
|
|
131
|
+
batch.execute()
|
|
132
|
+
|
|
133
|
+
# assert that even though there was an error, we have reset the batching state
|
|
134
|
+
assert not w3.provider._is_batching
|
|
@@ -27,6 +27,7 @@ from web3._utils.module_testing.module_testing_utils import (
|
|
|
27
27
|
)
|
|
28
28
|
from web3.exceptions import (
|
|
29
29
|
TimeExhausted,
|
|
30
|
+
Web3RPCError,
|
|
30
31
|
)
|
|
31
32
|
from web3.providers.persistent import (
|
|
32
33
|
WebSocketProvider,
|
|
@@ -432,3 +433,24 @@ async def test_listener_task_breaks_out_of_handle_subscriptions_when_cancelled()
|
|
|
432
433
|
# up the exception.
|
|
433
434
|
with pytest.raises(asyncio.CancelledError):
|
|
434
435
|
await async_w3.subscription_manager.handle_subscriptions(run_forever=True)
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
@pytest.mark.asyncio
|
|
439
|
+
async def test_persistent_connection_provider_empty_batch_response():
|
|
440
|
+
with patch(
|
|
441
|
+
"web3.providers.persistent.websocket.connect",
|
|
442
|
+
new=lambda *_1, **_2: _mocked_ws_conn(),
|
|
443
|
+
):
|
|
444
|
+
async with AsyncWeb3(WebSocketProvider("ws://mocked")) as async_w3:
|
|
445
|
+
async_w3.provider._ws.recv = AsyncMock()
|
|
446
|
+
async_w3.provider._ws.recv.return_value = (
|
|
447
|
+
b'{"jsonrpc": "2.0","id":null,"error": {"code": -32600, "message": '
|
|
448
|
+
b'"empty batch"}}\n'
|
|
449
|
+
)
|
|
450
|
+
async with async_w3.batch_requests() as batch:
|
|
451
|
+
with pytest.raises(Web3RPCError, match="empty batch"):
|
|
452
|
+
await batch.async_execute()
|
|
453
|
+
|
|
454
|
+
# assert that even though there was an error, we have reset the batching
|
|
455
|
+
# state
|
|
456
|
+
assert not async_w3.provider._is_batching
|
|
@@ -4,6 +4,9 @@ from unittest.mock import (
|
|
|
4
4
|
AsyncMock,
|
|
5
5
|
)
|
|
6
6
|
|
|
7
|
+
from eth_typing import (
|
|
8
|
+
HexStr,
|
|
9
|
+
)
|
|
7
10
|
import pytest_asyncio
|
|
8
11
|
|
|
9
12
|
from web3 import (
|
|
@@ -40,19 +43,43 @@ async def subscription_manager():
|
|
|
40
43
|
|
|
41
44
|
|
|
42
45
|
@pytest.mark.asyncio
|
|
43
|
-
async def
|
|
46
|
+
async def test_subscription_default_labels_are_unique(subscription_manager):
|
|
47
|
+
sub1 = NewHeadsSubscription()
|
|
48
|
+
sub2 = NewHeadsSubscription()
|
|
49
|
+
sub3 = NewHeadsSubscription()
|
|
50
|
+
sub4 = NewHeadsSubscription()
|
|
51
|
+
|
|
52
|
+
sub_ids = await subscription_manager.subscribe([sub1, sub2, sub3, sub4])
|
|
53
|
+
assert sub_ids == ["0x0", "0x1", "0x2", "0x3"]
|
|
54
|
+
|
|
55
|
+
assert sub1.label != sub2.label != sub3.label != sub4.label
|
|
56
|
+
assert sub1.label == "NewHeadsSubscription('newHeads',)"
|
|
57
|
+
assert sub2.label == "NewHeadsSubscription('newHeads',)#2"
|
|
58
|
+
assert sub3.label == "NewHeadsSubscription('newHeads',)#3"
|
|
59
|
+
assert sub4.label == "NewHeadsSubscription('newHeads',)#4"
|
|
60
|
+
|
|
61
|
+
# assert no issues unsubscribing
|
|
62
|
+
await subscription_manager.unsubscribe_all()
|
|
63
|
+
|
|
64
|
+
assert subscription_manager.subscriptions == []
|
|
65
|
+
assert subscription_manager._subscription_container.subscriptions == []
|
|
66
|
+
assert subscription_manager._subscription_container.subscriptions_by_id == {}
|
|
67
|
+
assert subscription_manager._subscription_container.subscriptions_by_label == {}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@pytest.mark.asyncio
|
|
71
|
+
async def test_subscription_manager_raises_for_new_subs_with_the_same_custom_label(
|
|
44
72
|
subscription_manager,
|
|
45
73
|
):
|
|
46
74
|
sub1 = NewHeadsSubscription(label="foo")
|
|
47
|
-
|
|
75
|
+
sub2 = LogsSubscription(label="foo")
|
|
48
76
|
|
|
49
77
|
with pytest.raises(
|
|
50
78
|
Web3ValueError,
|
|
51
79
|
match="Subscription label already exists. Subscriptions must have unique "
|
|
52
80
|
"labels.\n label: foo",
|
|
53
81
|
):
|
|
54
|
-
|
|
55
|
-
await subscription_manager.subscribe(sub2)
|
|
82
|
+
await subscription_manager.subscribe([sub1, sub2])
|
|
56
83
|
|
|
57
84
|
# make sure the subscription was subscribed to and not added to the manager
|
|
58
85
|
assert subscription_manager.subscriptions == [sub1]
|
|
@@ -110,3 +137,54 @@ async def test_unsubscribe_all_clears_all_subscriptions(subscription_manager):
|
|
|
110
137
|
assert sub_container.subscriptions == []
|
|
111
138
|
assert sub_container.subscriptions_by_id == {}
|
|
112
139
|
assert sub_container.subscriptions_by_label == {}
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
@pytest.mark.asyncio
|
|
143
|
+
async def test_unsubscribe_with_one_or_multiple(subscription_manager):
|
|
144
|
+
sub1 = NewHeadsSubscription()
|
|
145
|
+
sub2 = PendingTxSubscription()
|
|
146
|
+
sub3 = NewHeadsSubscription()
|
|
147
|
+
sub4 = LogsSubscription()
|
|
148
|
+
sub5 = NewHeadsSubscription()
|
|
149
|
+
sub6 = PendingTxSubscription()
|
|
150
|
+
|
|
151
|
+
(
|
|
152
|
+
sub_id1,
|
|
153
|
+
sub_id2,
|
|
154
|
+
sub_id3,
|
|
155
|
+
sub_id4,
|
|
156
|
+
sub_id5,
|
|
157
|
+
sub_id6,
|
|
158
|
+
) = await subscription_manager.subscribe([sub1, sub2, sub3, sub4, sub5, sub6])
|
|
159
|
+
assert sub_id1 == "0x0"
|
|
160
|
+
assert sub_id2 == "0x1"
|
|
161
|
+
assert sub_id3 == "0x2"
|
|
162
|
+
assert sub_id4 == "0x3"
|
|
163
|
+
assert sub_id5 == "0x4"
|
|
164
|
+
assert sub_id6 == "0x5"
|
|
165
|
+
|
|
166
|
+
assert subscription_manager.subscriptions == [sub1, sub2, sub3, sub4, sub5, sub6]
|
|
167
|
+
|
|
168
|
+
# unsubscribe single by hex id
|
|
169
|
+
assert await subscription_manager.unsubscribe(sub_id1) is True
|
|
170
|
+
assert subscription_manager.subscriptions == [sub2, sub3, sub4, sub5, sub6]
|
|
171
|
+
|
|
172
|
+
# unsubscribe many by hex id
|
|
173
|
+
assert await subscription_manager.unsubscribe([sub_id2, sub_id3]) is True
|
|
174
|
+
assert subscription_manager.subscriptions == [sub4, sub5, sub6]
|
|
175
|
+
|
|
176
|
+
# unsubscribe non-existent hex id
|
|
177
|
+
with pytest.raises(Web3ValueError, match=f"Subscription not found|{0x7}"):
|
|
178
|
+
await subscription_manager.unsubscribe(HexStr("0x7"))
|
|
179
|
+
|
|
180
|
+
# unsubscribe by subscription object
|
|
181
|
+
assert await subscription_manager.unsubscribe(sub4) is True
|
|
182
|
+
assert subscription_manager.subscriptions == [sub5, sub6]
|
|
183
|
+
|
|
184
|
+
# unsubscribe many by subscription object
|
|
185
|
+
assert await subscription_manager.unsubscribe([sub5, sub6]) is True
|
|
186
|
+
assert subscription_manager.subscriptions == []
|
|
187
|
+
|
|
188
|
+
# unsubscribe non-existent subscription object
|
|
189
|
+
with pytest.raises(Web3ValueError, match=f"Subscription not found|{sub5.id}"):
|
|
190
|
+
await subscription_manager.unsubscribe(sub5)
|
|
@@ -112,6 +112,28 @@ def test_session_manager_json_make_get_request(mocker, http_session_manager):
|
|
|
112
112
|
assert adapter._pool_maxsize == DEFAULT_POOLSIZE
|
|
113
113
|
|
|
114
114
|
|
|
115
|
+
def test_session_manager_json_make_post_request(mocker, http_session_manager):
|
|
116
|
+
mocker.patch("requests.Session.post", return_value=MockedResponse())
|
|
117
|
+
|
|
118
|
+
# Submit a first request to create a session with default parameters
|
|
119
|
+
assert len(http_session_manager.session_cache) == 0
|
|
120
|
+
response = http_session_manager.json_make_post_request(
|
|
121
|
+
TEST_URI, json={"data": "request"}
|
|
122
|
+
)
|
|
123
|
+
assert response == json.dumps({"data": "content"})
|
|
124
|
+
assert len(http_session_manager.session_cache) == 1
|
|
125
|
+
cache_key = generate_cache_key(f"{threading.get_ident()}:{TEST_URI}")
|
|
126
|
+
session = http_session_manager.session_cache.get_cache_entry(cache_key)
|
|
127
|
+
session.post.assert_called_once_with(TEST_URI, json={"data": "request"}, timeout=30)
|
|
128
|
+
|
|
129
|
+
# Ensure the adapter was created with default values
|
|
130
|
+
check_adapters_mounted(session)
|
|
131
|
+
adapter = session.get_adapter(TEST_URI)
|
|
132
|
+
assert isinstance(adapter, HTTPAdapter)
|
|
133
|
+
assert adapter._pool_connections == DEFAULT_POOLSIZE
|
|
134
|
+
assert adapter._pool_maxsize == DEFAULT_POOLSIZE
|
|
135
|
+
|
|
136
|
+
|
|
115
137
|
def test_session_manager_make_post_request_no_args(mocker, http_session_manager):
|
|
116
138
|
mocker.patch("requests.Session.post", return_value=MockedResponse())
|
|
117
139
|
|
|
@@ -332,6 +354,32 @@ async def test_session_manager_async_json_make_get_request(
|
|
|
332
354
|
await session.close()
|
|
333
355
|
|
|
334
356
|
|
|
357
|
+
@pytest.mark.asyncio
|
|
358
|
+
async def test_session_manager_async_json_make_post_request(
|
|
359
|
+
mocker, http_session_manager
|
|
360
|
+
):
|
|
361
|
+
mocker.patch("aiohttp.ClientSession.post", return_value=AsyncMockedResponse())
|
|
362
|
+
|
|
363
|
+
# Submit a first request to create a session with default parameters
|
|
364
|
+
assert len(http_session_manager.session_cache) == 0
|
|
365
|
+
response = await http_session_manager.async_json_make_post_request(
|
|
366
|
+
TEST_URI, json={"data": "request"}
|
|
367
|
+
)
|
|
368
|
+
assert response == json.dumps({"data": "content"})
|
|
369
|
+
assert len(http_session_manager.session_cache) == 1
|
|
370
|
+
cache_key = generate_cache_key(f"{threading.get_ident()}:{TEST_URI}")
|
|
371
|
+
session = http_session_manager.session_cache.get_cache_entry(cache_key)
|
|
372
|
+
assert isinstance(session, ClientSession)
|
|
373
|
+
session.post.assert_called_once_with(
|
|
374
|
+
TEST_URI,
|
|
375
|
+
json={"data": "request"},
|
|
376
|
+
timeout=ClientTimeout(
|
|
377
|
+
total=30, connect=None, sock_read=None, sock_connect=None
|
|
378
|
+
),
|
|
379
|
+
)
|
|
380
|
+
await session.close()
|
|
381
|
+
|
|
382
|
+
|
|
335
383
|
@pytest.mark.asyncio
|
|
336
384
|
async def test_session_manager_async_make_post_request(mocker, http_session_manager):
|
|
337
385
|
mocker.patch("aiohttp.ClientSession.post", return_value=AsyncMockedResponse())
|