web3 7.7.0__tar.gz → 7.9.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.9.0}/LICENSE +1 -1
- {web3-7.7.0/web3.egg-info → web3-7.9.0}/PKG-INFO +11 -7
- {web3-7.7.0 → web3-7.9.0}/README.md +7 -3
- {web3-7.7.0 → web3-7.9.0}/ens/async_ens.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/ens/ens.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/pyproject.toml +44 -0
- web3-7.9.0/scripts/release/test_package.py +50 -0
- {web3-7.7.0 → web3-7.9.0}/setup.py +4 -4
- {web3-7.7.0 → web3-7.9.0}/tests/beacon/test_async_beacon.py +85 -0
- {web3-7.7.0 → web3-7.9.0}/tests/beacon/test_beacon.py +76 -0
- {web3-7.7.0 → web3-7.9.0}/tests/conftest.py +2 -2
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_init.py +2 -2
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_extracting_event_data.py +2 -2
- {web3-7.7.0 → web3-7.9.0}/tests/core/datastructures/test_datastructures.py +12 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_async_http_provider.py +23 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_async_ipc_provider.py +24 -2
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_http_provider.py +22 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_ipc_provider.py +4 -2
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_websocket_provider.py +79 -1
- web3-7.9.0/tests/core/subscriptions/test_subscription_manager.py +215 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_async_transaction.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_http_session_manager.py +49 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_threads.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_ens.py +101 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_get_text.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/integration/generate_fixtures/common.py +5 -0
- web3-7.9.0/tests/integration/geth-1.15.5-fixture.zip +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/conftest.py +7 -3
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_http.py +20 -1
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_ipc.py +21 -2
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +3 -2
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +2 -1
- {web3-7.7.0 → web3-7.9.0}/tests/integration/test_ethereum_tester.py +5 -1
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/ambiguous_function_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/arrays_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +5 -5
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +7 -7
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/emitter_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/event_contracts.py +7 -7
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/extended_resolver.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/math_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/payable_tester.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +5 -5
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/revert_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/simple_resolver.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/storage_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/string_contract.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +5 -5
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/error_formatters_utils.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/events.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/formatters.py +28 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/http_session_manager.py +19 -1
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/method_formatters.py +121 -20
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/eth_module.py +102 -2
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/module_testing_utils.py +0 -42
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/persistent_connection_provider.py +39 -1
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/rpc_abi.py +1 -0
- web3-7.9.0/web3/_utils/validation.py +404 -0
- {web3-7.7.0 → web3-7.9.0}/web3/beacon/api_endpoints.py +10 -0
- {web3-7.7.0 → web3-7.9.0}/web3/beacon/async_beacon.py +47 -0
- {web3-7.7.0 → web3-7.9.0}/web3/beacon/beacon.py +45 -0
- {web3-7.7.0 → web3-7.9.0}/web3/contract/async_contract.py +2 -206
- {web3-7.7.0 → web3-7.9.0}/web3/contract/base_contract.py +208 -12
- {web3-7.7.0 → web3-7.9.0}/web3/contract/contract.py +2 -205
- {web3-7.7.0 → web3-7.9.0}/web3/datastructures.py +4 -0
- {web3-7.7.0 → web3-7.9.0}/web3/eth/async_eth.py +19 -0
- {web3-7.7.0 → web3-7.9.0}/web3/eth/eth.py +15 -0
- {web3-7.7.0 → web3-7.9.0}/web3/gas_strategies/time_based.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/web3/manager.py +47 -194
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/base.py +14 -6
- {web3-7.7.0 → web3-7.9.0}/web3/providers/async_base.py +5 -4
- {web3-7.7.0 → web3-7.9.0}/web3/providers/base.py +3 -3
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/persistent.py +29 -3
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/request_processor.py +11 -1
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/subscription_manager.py +116 -46
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/websocket.py +8 -3
- {web3-7.7.0 → web3-7.9.0}/web3/providers/rpc/async_rpc.py +8 -3
- {web3-7.7.0 → web3-7.9.0}/web3/providers/rpc/rpc.py +8 -3
- {web3-7.7.0 → web3-7.9.0}/web3/types.py +36 -13
- {web3-7.7.0 → web3-7.9.0}/web3/utils/subscriptions.py +5 -1
- {web3-7.7.0 → web3-7.9.0/web3.egg-info}/PKG-INFO +11 -7
- {web3-7.7.0 → web3-7.9.0}/web3.egg-info/SOURCES.txt +2 -1
- {web3-7.7.0 → web3-7.9.0}/web3.egg-info/requires.txt +3 -3
- web3-7.7.0/tests/core/subscriptions/test_subscription_manager.py +0 -112
- web3-7.7.0/tests/integration/geth-1.14.12-fixture.zip +0 -0
- web3-7.7.0/web3/_utils/validation.py +0 -213
- {web3-7.7.0 → web3-7.9.0}/MANIFEST.in +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/_normalization.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/abis.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/auto.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/base_ens.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/constants.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/contract_data.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/exceptions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/specs/nf.json +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/specs/normalization_spec.json +0 -0
- {web3-7.7.0 → web3-7.9.0}/ens/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/setup.cfg +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/.DS_Store +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/admin-module/test_admin_addPeer.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/admin-module/test_admin_peers.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/caching-utils/test_request_caching.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/conftest.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/conftest.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_ambiguous_events.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_ambiguous_functions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_attributes.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_build_transaction.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_call_interface.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_caller_interface.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_class_construction.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_constructor.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_constructor_encoding.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_deployment.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_estimate_gas.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_events.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_example.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_method_abi_decoding.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_method_abi_encoding.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_method_to_argument_matching.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_panic_errors.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_transact_interface.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_contract_util_functions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_extracting_event_data_old.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/test_offchain_lookup.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/contracts/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/conftest.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_accounts.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_block_api.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_default_account_api.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_eth_contract.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_eth_fee_history.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_eth_filter.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_eth_properties.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_gas_pricing.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_poa.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-module/test_transactions.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/exceptions/test_exceptions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/conftest.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_basic_filter_tests.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_contract_data_filters.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_contract_get_logs.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_contract_on_event_filtering.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_contract_past_event_filtering.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_contract_topic_filters.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_existing_filter_instance.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_filters_against_many_blocks.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/test_utils_functions.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/filtering/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/conftest.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/test_default_middlewares.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/test_middleware_onion_api.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/test_provider_property.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/test_provider_request_wrapping.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/manager/test_response_formatters.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/method-class/test_method.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/method-class/test_result_formatters.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_attrdict_middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_filter_middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_formatting_middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_gas_price_strategy.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_stalecheck.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/middleware/test_transaction_signing.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/module-class/test_module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_async_tester_provider.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_auto_provider.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_base_provider.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_http_request_retry.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_legacy_websocket_provider.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_provider_init.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/providers/test_tester_provider.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/subscriptions/test_subscriptions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/test_library_files.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/testing-module/test_testing_mine.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/conftest.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_abi.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_abi_is_encodable.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_abi_named_tree.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_address.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_attach_modules.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_attributedict.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_caching_utils.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_construct_event_data_set.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_construct_event_topics.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_datatypes.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_decorators.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_encoding.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_event_filter_builder.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_event_interface.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_fee_utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_formatters.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_is_probably_enum.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_is_recognized_type.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_math.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_method_formatters.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_select_filter_method.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_valid_transaction_params.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/utilities/test_validation.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_api.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_attach_modules.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_client_version.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_conversions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_import_and_version.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_keccak.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_providers.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/core/web3-module/test_web3_inheritance.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/conftest.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/ens/normalization/normalization_tests.json +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/normalization/test_normalize_name_ensip15.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_get_registry.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_nameprep.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_offchain_resolution.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_setup_address.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_setup_name.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/ens/test_wildcard_resolution.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/.DS_Store +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/README.md +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/common.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/conftest.py +1 -1
- {web3-7.7.0 → web3-7.9.0}/tests/integration/generate_fixtures/go_ethereum.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/common.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/integration/go_ethereum/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/tests/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/abi.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/abi_element_identifiers.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/async_caching.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/async_transactions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/batching.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/blocks.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/caching/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/caching/caching_utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/caching/request_caching_validation.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/compat/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/contracts.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/datatypes.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/decorators.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/empty.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/encoding.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/ens.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/fee_utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/filters.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/http.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/hypothesis.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/math.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/go_ethereum_debug_module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/module_testing/web3_module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/normalizers.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/threads.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/transactions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/type_conversion.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/utility_methods.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/_utils/windows.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/auto/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/auto/gethdev.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/beacon/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/constants.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/contract/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/contract/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/eth/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/eth/base_eth.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/exceptions.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/gas_strategies/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/geth.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/logs.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/main.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/method.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/attrdict.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/filter.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/formatting.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/names.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/pythonic.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/signing.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/stalecheck.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/middleware/validation.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/module.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/net.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/auto.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/eth_tester/defaults.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/eth_tester/main.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/ipc.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/legacy_websocket.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/async_ipc.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/persistent_connection.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/subscription_container.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/persistent/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/providers/rpc/utils.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/py.typed +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/scripts/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/scripts/install_pre_releases.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/scripts/parse_pygeth_version.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/scripts/release/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/scripts/release/test_package.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/testing.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/tracing.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/utils/__init__.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/utils/abi.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/utils/address.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/utils/caching.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3/utils/exception_handling.py +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.7.0 → web3-7.9.0}/web3.egg-info/not-zip-safe +0 -0
- {web3-7.7.0 → web3-7.9.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: web3
|
|
3
|
-
Version: 7.
|
|
3
|
+
Version: 7.9.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
|
|
@@ -40,7 +40,7 @@ Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "tester"
|
|
|
40
40
|
Requires-Dist: py-geth>=5.1.0; extra == "tester"
|
|
41
41
|
Provides-Extra: dev
|
|
42
42
|
Requires-Dist: build>=0.9.0; extra == "dev"
|
|
43
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: bump_my_version>=0.19.0; extra == "dev"
|
|
44
44
|
Requires-Dist: ipython; extra == "dev"
|
|
45
45
|
Requires-Dist: setuptools>=38.6.0; extra == "dev"
|
|
46
46
|
Requires-Dist: tqdm>4.32; extra == "dev"
|
|
@@ -49,7 +49,7 @@ Requires-Dist: wheel; extra == "dev"
|
|
|
49
49
|
Requires-Dist: sphinx>=6.0.0; extra == "dev"
|
|
50
50
|
Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "dev"
|
|
51
51
|
Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "dev"
|
|
52
|
-
Requires-Dist: towncrier<
|
|
52
|
+
Requires-Dist: towncrier<25,>=24; extra == "dev"
|
|
53
53
|
Requires-Dist: pytest-asyncio<0.23,>=0.18.1; extra == "dev"
|
|
54
54
|
Requires-Dist: pytest-mock>=1.10; extra == "dev"
|
|
55
55
|
Requires-Dist: pytest-xdist>=2.4.0; extra == "dev"
|
|
@@ -65,7 +65,7 @@ Provides-Extra: docs
|
|
|
65
65
|
Requires-Dist: sphinx>=6.0.0; extra == "docs"
|
|
66
66
|
Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "docs"
|
|
67
67
|
Requires-Dist: sphinx_rtd_theme>=1.0.0; extra == "docs"
|
|
68
|
-
Requires-Dist: towncrier<
|
|
68
|
+
Requires-Dist: towncrier<25,>=24; extra == "docs"
|
|
69
69
|
Provides-Extra: test
|
|
70
70
|
Requires-Dist: pytest-asyncio<0.23,>=0.18.1; extra == "test"
|
|
71
71
|
Requires-Dist: pytest-mock>=1.10; extra == "test"
|
|
@@ -105,14 +105,18 @@ web3.py allows you to interact with the Ethereum blockchain using Python, enabli
|
|
|
105
105
|
|
|
106
106
|
- Python 3.8+ support
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
## Installation
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
python -m pip install web3
|
|
112
|
+
```
|
|
109
113
|
|
|
110
|
-
##
|
|
114
|
+
## Documentation
|
|
111
115
|
|
|
112
116
|
[Get started in 5 minutes](https://web3py.readthedocs.io/en/latest/quickstart.html) or
|
|
113
117
|
[take a tour](https://web3py.readthedocs.io/en/latest/overview.html) of the library.
|
|
114
118
|
|
|
115
|
-
|
|
119
|
+
View the [change log](https://web3py.readthedocs.io/en/latest/release_notes.html).
|
|
116
120
|
|
|
117
121
|
For additional guides, examples, and APIs, see the [documentation](https://web3py.readthedocs.io/en/latest/).
|
|
118
122
|
|
|
@@ -12,14 +12,18 @@ web3.py allows you to interact with the Ethereum blockchain using Python, enabli
|
|
|
12
12
|
|
|
13
13
|
- Python 3.8+ support
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
python -m pip install web3
|
|
19
|
+
```
|
|
16
20
|
|
|
17
|
-
##
|
|
21
|
+
## Documentation
|
|
18
22
|
|
|
19
23
|
[Get started in 5 minutes](https://web3py.readthedocs.io/en/latest/quickstart.html) or
|
|
20
24
|
[take a tour](https://web3py.readthedocs.io/en/latest/overview.html) of the library.
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
View the [change log](https://web3py.readthedocs.io/en/latest/release_notes.html).
|
|
23
27
|
|
|
24
28
|
For additional guides, examples, and APIs, see the [documentation](https://web3py.readthedocs.io/en/latest/).
|
|
25
29
|
|
|
@@ -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
|
)
|
|
@@ -7,6 +7,7 @@ combine_as_imports = true
|
|
|
7
7
|
extra_standard_library = "pytest"
|
|
8
8
|
force_grid_wrap = 1
|
|
9
9
|
force_sort_within_sections = true
|
|
10
|
+
force_to_top = "pytest"
|
|
10
11
|
honor_noqa = true
|
|
11
12
|
known_first_party = "web3"
|
|
12
13
|
known_third_party = "hypothesis"
|
|
@@ -124,3 +125,46 @@ showcontent = true
|
|
|
124
125
|
directory = "removal"
|
|
125
126
|
name = "Removals"
|
|
126
127
|
showcontent = true
|
|
128
|
+
|
|
129
|
+
[tool.bumpversion]
|
|
130
|
+
current_version = "7.9.0"
|
|
131
|
+
parse = """
|
|
132
|
+
(?P<major>\\d+)
|
|
133
|
+
\\.(?P<minor>\\d+)
|
|
134
|
+
\\.(?P<patch>\\d+)
|
|
135
|
+
(-
|
|
136
|
+
(?P<stage>[^.]*)
|
|
137
|
+
\\.(?P<devnum>\\d+)
|
|
138
|
+
)?
|
|
139
|
+
"""
|
|
140
|
+
serialize = [
|
|
141
|
+
"{major}.{minor}.{patch}-{stage}.{devnum}",
|
|
142
|
+
"{major}.{minor}.{patch}",
|
|
143
|
+
]
|
|
144
|
+
search = "{current_version}"
|
|
145
|
+
replace = "{new_version}"
|
|
146
|
+
regex = false
|
|
147
|
+
ignore_missing_version = false
|
|
148
|
+
tag = true
|
|
149
|
+
sign_tags = true
|
|
150
|
+
tag_name = "v{new_version}"
|
|
151
|
+
tag_message = "Bump version: {current_version} → {new_version}"
|
|
152
|
+
allow_dirty = false
|
|
153
|
+
commit = true
|
|
154
|
+
message = "Bump version: {current_version} → {new_version}"
|
|
155
|
+
|
|
156
|
+
[tool.bumpversion.parts.stage]
|
|
157
|
+
optional_value = "stable"
|
|
158
|
+
first_value = "stable"
|
|
159
|
+
values = [
|
|
160
|
+
"alpha",
|
|
161
|
+
"beta",
|
|
162
|
+
"stable",
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
[tool.bumpversion.part.devnum]
|
|
166
|
+
|
|
167
|
+
[[tool.bumpversion.files]]
|
|
168
|
+
filename = "setup.py"
|
|
169
|
+
search = "version=\"{current_version}\""
|
|
170
|
+
replace = "version=\"{new_version}\""
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from pathlib import (
|
|
2
|
+
Path,
|
|
3
|
+
)
|
|
4
|
+
import subprocess
|
|
5
|
+
from tempfile import (
|
|
6
|
+
TemporaryDirectory,
|
|
7
|
+
)
|
|
8
|
+
import venv
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def create_venv(parent_path: Path) -> Path:
|
|
12
|
+
venv_path = parent_path / "package-smoke-test"
|
|
13
|
+
venv.create(venv_path, with_pip=True)
|
|
14
|
+
subprocess.run(
|
|
15
|
+
[venv_path / "bin" / "pip", "install", "-U", "pip", "setuptools"], check=True
|
|
16
|
+
)
|
|
17
|
+
return venv_path
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def find_wheel(project_path: Path) -> Path:
|
|
21
|
+
wheels = list(project_path.glob("dist/*.whl"))
|
|
22
|
+
|
|
23
|
+
if len(wheels) != 1:
|
|
24
|
+
raise Exception(
|
|
25
|
+
f"Expected one wheel. Instead found: {wheels} "
|
|
26
|
+
f"in project {project_path.absolute()}"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
return wheels[0]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def install_wheel(venv_path: Path, wheel_path: Path) -> None:
|
|
33
|
+
subprocess.run(
|
|
34
|
+
[venv_path / "bin" / "pip", "install", f"{wheel_path}"],
|
|
35
|
+
check=True,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def test_install_local_wheel() -> None:
|
|
40
|
+
with TemporaryDirectory() as tmpdir:
|
|
41
|
+
venv_path = create_venv(Path(tmpdir))
|
|
42
|
+
wheel_path = find_wheel(Path("."))
|
|
43
|
+
install_wheel(venv_path, wheel_path)
|
|
44
|
+
print("Installed", wheel_path.absolute(), "to", venv_path)
|
|
45
|
+
print(f"Activate with `source {venv_path}/bin/activate`")
|
|
46
|
+
input("Press enter when the test has completed. The directory will be deleted.")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
test_install_local_wheel()
|
|
@@ -13,7 +13,7 @@ extras_require = {
|
|
|
13
13
|
],
|
|
14
14
|
"dev": [
|
|
15
15
|
"build>=0.9.0",
|
|
16
|
-
"
|
|
16
|
+
"bump_my_version>=0.19.0",
|
|
17
17
|
"ipython",
|
|
18
18
|
"setuptools>=38.6.0",
|
|
19
19
|
"tqdm>4.32",
|
|
@@ -24,7 +24,7 @@ extras_require = {
|
|
|
24
24
|
"sphinx>=6.0.0",
|
|
25
25
|
"sphinx-autobuild>=2021.3.14",
|
|
26
26
|
"sphinx_rtd_theme>=1.0.0",
|
|
27
|
-
"towncrier>=
|
|
27
|
+
"towncrier>=24,<25",
|
|
28
28
|
],
|
|
29
29
|
"test": [
|
|
30
30
|
"pytest-asyncio>=0.18.1,<0.23",
|
|
@@ -54,8 +54,8 @@ with open("./README.md") as readme:
|
|
|
54
54
|
|
|
55
55
|
setup(
|
|
56
56
|
name="web3",
|
|
57
|
-
# *IMPORTANT*: Don't manually change the version here.
|
|
58
|
-
version="7.
|
|
57
|
+
# *IMPORTANT*: Don't manually change the version here. See Contributing docs for the release process.
|
|
58
|
+
version="7.9.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)
|
|
@@ -42,7 +42,7 @@ def emitter_contract_data():
|
|
|
42
42
|
return EMITTER_CONTRACT_DATA
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
# This class defines events for the EmitterContract and
|
|
45
|
+
# This class defines events for the EmitterContract and is used to construct
|
|
46
46
|
# a fixture for contract event logs. Parameterized tests that utilize an `emitter`
|
|
47
47
|
# contract fixture will use this data.
|
|
48
48
|
class LogFunctions:
|
|
@@ -71,7 +71,7 @@ def emitter_contract_event_ids():
|
|
|
71
71
|
return LogFunctions
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
# This class defines topics for the EmitterContract and
|
|
74
|
+
# This class defines topics for the EmitterContract and is used to construct
|
|
75
75
|
# a fixture for contract event log topics. Parameterized tests that utilize
|
|
76
76
|
# an `emitter` contract fixture will use this data.
|
|
77
77
|
class LogTopics:
|
|
@@ -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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import copy
|
|
2
1
|
import pytest
|
|
2
|
+
import copy
|
|
3
3
|
import re
|
|
4
4
|
|
|
5
5
|
from eth_abi.exceptions import (
|
|
@@ -848,7 +848,7 @@ def test_event_rich_log(
|
|
|
848
848
|
txn_hash = emitter_fn(event_id, *call_args).transact()
|
|
849
849
|
else:
|
|
850
850
|
# Some tests do not rely on the event_id. Rather than
|
|
851
|
-
# changing this test too much,bypass this here and just
|
|
851
|
+
# changing this test too much, bypass this here and just
|
|
852
852
|
# call the function with the provided args.
|
|
853
853
|
txn_hash = emitter_fn(*call_args).transact()
|
|
854
854
|
txn_receipt = wait_for_transaction(w3, txn_hash)
|
|
@@ -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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import pytest
|
|
1
2
|
import json
|
|
2
3
|
import os
|
|
3
4
|
import pathlib
|
|
4
|
-
import pytest
|
|
5
5
|
import socket
|
|
6
6
|
import tempfile
|
|
7
7
|
from threading import (
|
|
@@ -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,
|
|
@@ -359,10 +360,31 @@ async def test_async_ipc_provider_write_messages_end_with_new_line_delimiter(
|
|
|
359
360
|
async with AsyncWeb3(AsyncIPCProvider(pathlib.Path(jsonrpc_ipc_pipe_path))) as w3:
|
|
360
361
|
w3.provider._writer.write = Mock()
|
|
361
362
|
w3.provider._reader.readline = AsyncMock(
|
|
362
|
-
return_value=b'{"id": 0, "result": {}}\n'
|
|
363
|
+
return_value=b'{"id": 0, "jsonrpc": "2.0", "result": {}}\n'
|
|
363
364
|
)
|
|
364
365
|
|
|
365
366
|
await w3.provider.make_request("method", [])
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import pytest
|
|
1
2
|
import os
|
|
2
3
|
import pathlib
|
|
3
|
-
import pytest
|
|
4
4
|
import socket
|
|
5
5
|
import sys
|
|
6
6
|
import tempfile
|
|
@@ -191,7 +191,9 @@ def test_web3_auto_gethdev(request_mocker):
|
|
|
191
191
|
def test_ipc_provider_write_messages_end_with_new_line_delimiter(jsonrpc_ipc_pipe_path):
|
|
192
192
|
provider = IPCProvider(pathlib.Path(jsonrpc_ipc_pipe_path), timeout=3)
|
|
193
193
|
provider._socket.sock = Mock()
|
|
194
|
-
provider._socket.sock.recv.return_value =
|
|
194
|
+
provider._socket.sock.recv.return_value = (
|
|
195
|
+
b'{"id":0, "jsonrpc": "2.0", "result": {}}\n'
|
|
196
|
+
)
|
|
195
197
|
|
|
196
198
|
provider.make_request("method", [])
|
|
197
199
|
|