web3 7.0.0b7__tar.gz → 7.0.0b8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {web3-7.0.0b7/web3.egg-info → web3-7.0.0b8}/PKG-INFO +8 -4
- {web3-7.0.0b7 → web3-7.0.0b8}/README.md +7 -3
- {web3-7.0.0b7 → web3-7.0.0b8}/setup.py +1 -1
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_transactions.py +2 -6
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_websocket_provider.py +14 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/test_library_files.py +1 -1
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_method_formatters.py +44 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/conftest.py +11 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/method_formatters.py +19 -1
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/eth_module.py +2 -2
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/module_testing_utils.py +8 -9
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/persistent_connection_provider.py +44 -16
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/exceptions.py +6 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/manager.py +34 -11
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/module.py +1 -1
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/persistent/async_ipc.py +34 -79
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/persistent/persistent.py +76 -7
- web3-7.0.0b8/web3/providers/persistent/persistent_connection.py +84 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/persistent/websocket.py +19 -59
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/utils/caching.py +24 -0
- {web3-7.0.0b7 → web3-7.0.0b8/web3.egg-info}/PKG-INFO +8 -4
- web3-7.0.0b7/web3/providers/persistent/persistent_connection.py +0 -42
- {web3-7.0.0b7 → web3-7.0.0b8}/LICENSE +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/MANIFEST.in +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/_normalization.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/abis.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/async_ens.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/auto.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/base_ens.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/constants.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/contract_data.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/ens.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/exceptions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/specs/nf.json +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/specs/normalization_spec.json +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/ens/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/pyproject.toml +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/setup.cfg +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/.DS_Store +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/beacon/test_async_beacon.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/beacon/test_beacon.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/admin-module/test_admin_addPeer.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/admin-module/test_admin_peers.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/caching-utils/test_request_caching.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_args_and_kwargs_merger.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_ambiguous_functions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_attributes.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_build_transaction.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_call_interface.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_caller_interface.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_class_construction.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_constructor.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_constructor_encoding.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_deployment.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_estimate_gas.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_example.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_init.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_method_abi_decoding.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_method_abi_encoding.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_method_to_argument_matching.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_panic_errors.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_transact_interface.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_contract_util_functions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_extracting_event_data.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_extracting_event_data_old.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/test_offchain_lookup.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/contracts/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/datastructures/test_datastructures.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_accounts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_block_api.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_default_account_api.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_eth_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_eth_fee_history.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_eth_filter.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_eth_properties.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_gas_pricing.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-module/test_poa.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/exceptions/test_exceptions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_basic_filter_tests.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_contract_data_filters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_contract_get_logs.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_contract_on_event_filtering.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_contract_past_event_filtering.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_contract_topic_filters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_existing_filter_instance.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_filters_against_many_blocks.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/test_utils_functions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/filtering/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/test_default_middlewares.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/test_middleware_onion_api.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/test_provider_property.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/test_provider_request_wrapping.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/manager/test_response_formatters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/method-class/test_method.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/method-class/test_result_formatters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_attrdict_middleware.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_filter_middleware.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_formatting_middleware.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_gas_price_strategy.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_stalecheck.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/middleware/test_transaction_signing.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/module-class/test_module.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_async_http_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_async_ipc_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_async_tester_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_auto_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_base_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_http_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_http_request_retry.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_ipc_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_legacy_websocket_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/providers/test_tester_provider.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/testing-module/test_testing_mine.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_abi.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_abi_filter_by_abi_name.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_abi_is_encodable.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_abi_named_tree.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_address.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_async_transaction.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_attach_modules.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_attributedict.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_caching_utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_construct_event_data_set.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_construct_event_topics.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_datatypes.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_decorators.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_encoding.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_event_filter_builder.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_event_interface.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_fee_utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_formatters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_http_session_manager.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_is_probably_enum.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_is_recognized_type.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_math.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_select_filter_method.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_threads.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_valid_transaction_params.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/utilities/test_validation.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_api.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_attach_modules.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_client_version.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_conversions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_import_and_version.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_keccak.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_providers.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/core/web3-module/test_web3_inheritance.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/normalization/normalization_tests.json +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/normalization/test_normalize_name_ensip15.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_ens.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_get_registry.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_get_text.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_nameprep.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_offchain_resolution.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_setup_address.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_setup_name.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/ens/test_wildcard_resolution.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/.DS_Store +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/README.md +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/common.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/generate_fixtures/common.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/generate_fixtures/go_ethereum.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/geth-1.14.5-fixture.zip +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/common.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_http.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_ipc.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/go_ethereum/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/integration/test_ethereum_tester.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/tests/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/abi.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/async_caching.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/async_transactions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/batching.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/blocks.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/caching.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/compat/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/compile_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/event_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/contracts.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/datatypes.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/decorators.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/empty.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/encoding.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/ens.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/error_formatters_utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/events.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/fee_utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/filters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/formatters.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/function_identifiers.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/http.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/http_session_manager.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/hypothesis.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/math.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/net_module.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/module_testing/web3_module.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/normalizers.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/rpc_abi.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/threads.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/transactions.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/type_conversion.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/utility_methods.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/validation.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/_utils/windows.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/auto/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/auto/gethdev.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/beacon/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/beacon/api_endpoints.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/beacon/async_beacon.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/beacon/beacon.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/constants.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/contract/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/contract/async_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/contract/base_contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/contract/contract.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/contract/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/datastructures.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/eth/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/eth/async_eth.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/eth/base_eth.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/eth/eth.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/gas_strategies/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/gas_strategies/rpc.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/gas_strategies/time_based.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/geth.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/logs.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/main.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/method.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/attrdict.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/base.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/buffered_gas_estimate.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/filter.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/formatting.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/gas_price_strategy.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/names.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/proof_of_authority.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/pythonic.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/signing.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/stalecheck.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/middleware/validation.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/net.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/async_base.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/auto.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/base.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/eth_tester/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/eth_tester/defaults.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/eth_tester/main.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/eth_tester/middleware.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/ipc.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/legacy_websocket.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/persistent/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/persistent/request_processor.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/persistent/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/rpc/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/rpc/async_rpc.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/rpc/rpc.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/providers/rpc/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/py.typed +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/scripts/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/scripts/release/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/scripts/release/test_package.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/testing.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/tools/benchmark/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/tools/benchmark/main.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/tools/benchmark/node.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/tools/benchmark/reporting.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/tools/benchmark/utils.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/tracing.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/types.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/utils/__init__.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/utils/abi.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/utils/address.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/utils/async_exception_handling.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3/utils/exception_handling.py +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3.egg-info/SOURCES.txt +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3.egg-info/dependency_links.txt +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3.egg-info/not-zip-safe +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3.egg-info/requires.txt +0 -0
- {web3-7.0.0b7 → web3-7.0.0b8}/web3.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: web3
|
|
3
|
-
Version: 7.0.
|
|
3
|
+
Version: 7.0.0b8
|
|
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
|
|
@@ -80,7 +80,9 @@ Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
|
80
80
|
[](https://pypi.python.org/pypi/web3)
|
|
81
81
|
[](https://web3py.readthedocs.io/en/latest/?badge=latest)
|
|
82
82
|
|
|
83
|
-
A Python
|
|
83
|
+
## A Python Library for Interacting with Ethereum
|
|
84
|
+
|
|
85
|
+
web3.py allows you to interact with the Ethereum blockchain using Python, enabling you to build decentralized applications, interact with smart contracts, and much more.
|
|
84
86
|
|
|
85
87
|
- Python 3.8+ support
|
|
86
88
|
|
|
@@ -95,7 +97,7 @@ ______________________________________________________________________
|
|
|
95
97
|
|
|
96
98
|
For additional guides, examples, and APIs, see the [documentation](https://web3py.readthedocs.io/en/latest/).
|
|
97
99
|
|
|
98
|
-
## Want to
|
|
100
|
+
## Want to Help?
|
|
99
101
|
|
|
100
102
|
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
|
101
103
|
guidelines for [contributing](https://web3py.readthedocs.io/en/latest/contributing.html),
|
|
@@ -104,4 +106,6 @@ then check out issues that are labeled
|
|
|
104
106
|
|
|
105
107
|
______________________________________________________________________
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
## Questions on Implementation or Usage?
|
|
110
|
+
|
|
111
|
+
Join the conversation in the Ethereum Python Community [Discord](https://discord.gg/GHryRvPB84).
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
[](https://pypi.python.org/pypi/web3)
|
|
7
7
|
[](https://web3py.readthedocs.io/en/latest/?badge=latest)
|
|
8
8
|
|
|
9
|
-
A Python
|
|
9
|
+
## A Python Library for Interacting with Ethereum
|
|
10
|
+
|
|
11
|
+
web3.py allows you to interact with the Ethereum blockchain using Python, enabling you to build decentralized applications, interact with smart contracts, and much more.
|
|
10
12
|
|
|
11
13
|
- Python 3.8+ support
|
|
12
14
|
|
|
@@ -21,7 +23,7 @@ ______________________________________________________________________
|
|
|
21
23
|
|
|
22
24
|
For additional guides, examples, and APIs, see the [documentation](https://web3py.readthedocs.io/en/latest/).
|
|
23
25
|
|
|
24
|
-
## Want to
|
|
26
|
+
## Want to Help?
|
|
25
27
|
|
|
26
28
|
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
|
27
29
|
guidelines for [contributing](https://web3py.readthedocs.io/en/latest/contributing.html),
|
|
@@ -30,4 +32,6 @@ then check out issues that are labeled
|
|
|
30
32
|
|
|
31
33
|
______________________________________________________________________
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
## Questions on Implementation or Usage?
|
|
36
|
+
|
|
37
|
+
Join the conversation in the Ethereum Python Community [Discord](https://discord.gg/GHryRvPB84).
|
|
@@ -51,7 +51,7 @@ with open("./README.md") as readme:
|
|
|
51
51
|
setup(
|
|
52
52
|
name="web3",
|
|
53
53
|
# *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme
|
|
54
|
-
version="7.0.0-beta.
|
|
54
|
+
version="7.0.0-beta.8",
|
|
55
55
|
description="""web3: A Python library for interacting with Ethereum""",
|
|
56
56
|
long_description=long_description,
|
|
57
57
|
long_description_content_type="text/markdown",
|
|
@@ -318,12 +318,8 @@ def test_get_transaction_formatters(w3, request_mocker):
|
|
|
318
318
|
{
|
|
319
319
|
"address": checksummed_addr,
|
|
320
320
|
"storageKeys": [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
),
|
|
324
|
-
HexBytes(
|
|
325
|
-
"0x0000000000000000000000000000000000000000000000000000000000000036" # noqa: E501
|
|
326
|
-
),
|
|
321
|
+
"0x0000000000000000000000000000000000000000000000000000000000000032", # noqa: E501
|
|
322
|
+
"0x0000000000000000000000000000000000000000000000000000000000000036", # noqa: E501
|
|
327
323
|
],
|
|
328
324
|
}
|
|
329
325
|
),
|
|
@@ -12,6 +12,7 @@ from eth_utils import (
|
|
|
12
12
|
)
|
|
13
13
|
from websockets import (
|
|
14
14
|
ConnectionClosed,
|
|
15
|
+
ConnectionClosedOK,
|
|
15
16
|
)
|
|
16
17
|
|
|
17
18
|
from web3 import (
|
|
@@ -365,3 +366,16 @@ async def test_async_iterator_pattern_exception_handling_for_subscriptions():
|
|
|
365
366
|
pytest.fail("Expected `ConnectionClosed` exception.")
|
|
366
367
|
|
|
367
368
|
assert iterations == 3
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
@pytest.mark.asyncio
|
|
372
|
+
async def test_connection_closed_ok_breaks_message_iteration():
|
|
373
|
+
with patch(
|
|
374
|
+
"web3.providers.persistent.websocket.connect",
|
|
375
|
+
new=lambda *_1, **_2: WebSocketMessageStreamMock(
|
|
376
|
+
raise_exception=ConnectionClosedOK(None, None)
|
|
377
|
+
),
|
|
378
|
+
):
|
|
379
|
+
w3 = await AsyncWeb3(WebSocketProvider("ws://mocked"))
|
|
380
|
+
async for _ in w3.socket.process_subscriptions():
|
|
381
|
+
pytest.fail("Should not reach this point.")
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
|
+
from eth_typing import (
|
|
4
|
+
HexStr,
|
|
5
|
+
)
|
|
6
|
+
|
|
3
7
|
from web3._utils.method_formatters import (
|
|
4
8
|
get_error_formatters,
|
|
5
9
|
raise_contract_logic_error_on_revert,
|
|
10
|
+
storage_key_to_hexstr,
|
|
6
11
|
)
|
|
7
12
|
from web3._utils.rpc_abi import (
|
|
8
13
|
RPC,
|
|
9
14
|
)
|
|
10
15
|
from web3.exceptions import (
|
|
11
16
|
ContractLogicError,
|
|
17
|
+
Web3ValueError,
|
|
12
18
|
)
|
|
13
19
|
from web3.types import (
|
|
14
20
|
RPCResponse,
|
|
@@ -192,3 +198,41 @@ def test_get_error_formatters() -> None:
|
|
|
192
198
|
with pytest.raises(ContractLogicError):
|
|
193
199
|
formatters(REVERT_WITHOUT_MSG)
|
|
194
200
|
assert formatters(OTHER_ERROR) == OTHER_ERROR
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
@pytest.mark.parametrize(
|
|
204
|
+
"input_value,expected_output",
|
|
205
|
+
[
|
|
206
|
+
("0x" + "a" * 64, HexStr("0x" + "a" * 64)),
|
|
207
|
+
("a" * 64, HexStr("0x" + "a" * 64)),
|
|
208
|
+
("0x" + "a" * 63, Web3ValueError),
|
|
209
|
+
("a" * 63, Web3ValueError),
|
|
210
|
+
(b"a" * 32, HexStr("0x" + "61" * 32)),
|
|
211
|
+
(b"a" * 31, Web3ValueError),
|
|
212
|
+
(b"a" * 33, Web3ValueError),
|
|
213
|
+
(
|
|
214
|
+
7719472615821079694904732333912527190217998977709370935963838933860875309329, # noqa: E501
|
|
215
|
+
HexStr("0x" + "1" * 64),
|
|
216
|
+
),
|
|
217
|
+
(3567, Web3ValueError),
|
|
218
|
+
(3.14, Web3ValueError),
|
|
219
|
+
],
|
|
220
|
+
ids=[
|
|
221
|
+
"valid-0x-hex-string",
|
|
222
|
+
"valid-no-0x-hex-string",
|
|
223
|
+
"invalid-0x-hex-string",
|
|
224
|
+
"invalid-no-0x-hex-string",
|
|
225
|
+
"valid-32-byte-value",
|
|
226
|
+
"invalid-31-byte-value",
|
|
227
|
+
"invalid-33-byte-value",
|
|
228
|
+
"valid-integer",
|
|
229
|
+
"invalid-integer",
|
|
230
|
+
"invalid-float",
|
|
231
|
+
],
|
|
232
|
+
)
|
|
233
|
+
def test_storage_key_to_hexstr(input_value, expected_output):
|
|
234
|
+
if isinstance(expected_output, type) and issubclass(expected_output, Exception):
|
|
235
|
+
with pytest.raises(expected_output):
|
|
236
|
+
storage_key_to_hexstr(input_value)
|
|
237
|
+
else:
|
|
238
|
+
assert storage_key_to_hexstr(input_value) == expected_output
|
|
@@ -64,3 +64,14 @@ def event_loop():
|
|
|
64
64
|
loop = asyncio.get_event_loop_policy().new_event_loop()
|
|
65
65
|
yield loop
|
|
66
66
|
loop.close()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@pytest.fixture(autouse=True)
|
|
70
|
+
def _async_test_setup(request) -> None:
|
|
71
|
+
# Check if the 'async_w3' fixture is available in the current context
|
|
72
|
+
if "async_w3" in request.fixturenames:
|
|
73
|
+
async_w3 = request.getfixturevalue("async_w3")
|
|
74
|
+
if hasattr(async_w3.provider, "_request_processor"):
|
|
75
|
+
# Clear the request processor cache for persistent connection provider tests
|
|
76
|
+
async_w3.provider._request_processor.clear_caches()
|
|
77
|
+
yield
|
|
@@ -187,10 +187,28 @@ def apply_list_to_array_formatter(formatter: Any) -> Callable[..., Any]:
|
|
|
187
187
|
return to_list(apply_formatter_to_array(formatter))
|
|
188
188
|
|
|
189
189
|
|
|
190
|
+
def storage_key_to_hexstr(value: Union[bytes, int, str]) -> HexStr:
|
|
191
|
+
if not isinstance(value, (bytes, int, str)):
|
|
192
|
+
raise Web3ValueError(
|
|
193
|
+
f"Storage key must be one of bytes, int, str, got {type(value)}"
|
|
194
|
+
)
|
|
195
|
+
if isinstance(value, str):
|
|
196
|
+
if value.startswith("0x") and len(value) == 66:
|
|
197
|
+
return HexStr(value)
|
|
198
|
+
elif len(value) == 64:
|
|
199
|
+
return HexStr(f"0x{value}")
|
|
200
|
+
elif isinstance(value, bytes):
|
|
201
|
+
if len(value) == 32:
|
|
202
|
+
return HexBytes(value).to_0x_hex()
|
|
203
|
+
elif isinstance(value, int):
|
|
204
|
+
return storage_key_to_hexstr(hex(value))
|
|
205
|
+
raise Web3ValueError(f"Storage key must be a 32-byte value, got {value!r}")
|
|
206
|
+
|
|
207
|
+
|
|
190
208
|
ACCESS_LIST_FORMATTER = type_aware_apply_formatters_to_dict(
|
|
191
209
|
{
|
|
192
210
|
"address": to_checksum_address,
|
|
193
|
-
"storageKeys": apply_list_to_array_formatter(
|
|
211
|
+
"storageKeys": apply_list_to_array_formatter(storage_key_to_hexstr),
|
|
194
212
|
}
|
|
195
213
|
)
|
|
196
214
|
|
|
@@ -1210,7 +1210,7 @@ class AsyncEthModuleTest:
|
|
|
1210
1210
|
assert len(access_list) > 0
|
|
1211
1211
|
assert access_list[0]["address"] is not None
|
|
1212
1212
|
assert is_checksum_address(access_list[0]["address"])
|
|
1213
|
-
assert len(access_list[0]["storageKeys"][0]) ==
|
|
1213
|
+
assert len(access_list[0]["storageKeys"][0]) == 66
|
|
1214
1214
|
assert int(response["gasUsed"]) >= 0
|
|
1215
1215
|
|
|
1216
1216
|
# assert the result can be used directly in a transaction dict
|
|
@@ -2786,7 +2786,7 @@ class EthModuleTest:
|
|
|
2786
2786
|
assert len(access_list) > 0
|
|
2787
2787
|
assert access_list[0]["address"] is not None
|
|
2788
2788
|
assert is_checksum_address(access_list[0]["address"])
|
|
2789
|
-
assert len(access_list[0]["storageKeys"][0]) ==
|
|
2789
|
+
assert len(access_list[0]["storageKeys"][0]) == 66
|
|
2790
2790
|
assert int(response["gasUsed"]) >= 0
|
|
2791
2791
|
|
|
2792
2792
|
# assert the result can be used directly in a transaction dict
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
deque,
|
|
3
|
-
)
|
|
1
|
+
import asyncio
|
|
4
2
|
from typing import (
|
|
5
3
|
TYPE_CHECKING,
|
|
6
4
|
Any,
|
|
@@ -179,7 +177,9 @@ class WebSocketMessageStreamMock:
|
|
|
179
177
|
def __init__(
|
|
180
178
|
self, messages: Collection[bytes] = None, raise_exception: Exception = None
|
|
181
179
|
) -> None:
|
|
182
|
-
self.
|
|
180
|
+
self.queue = asyncio.Queue() # type: ignore # py38 issue
|
|
181
|
+
for msg in messages or []:
|
|
182
|
+
self.queue.put_nowait(msg)
|
|
183
183
|
self.raise_exception = raise_exception
|
|
184
184
|
|
|
185
185
|
def __await__(self) -> Generator[Any, Any, "Self"]:
|
|
@@ -192,13 +192,12 @@ class WebSocketMessageStreamMock:
|
|
|
192
192
|
return self
|
|
193
193
|
|
|
194
194
|
async def __anext__(self) -> bytes:
|
|
195
|
+
return await self.queue.get()
|
|
196
|
+
|
|
197
|
+
async def recv(self) -> bytes:
|
|
195
198
|
if self.raise_exception:
|
|
196
199
|
raise self.raise_exception
|
|
197
|
-
|
|
198
|
-
elif len(self.messages) == 0:
|
|
199
|
-
raise StopAsyncIteration
|
|
200
|
-
|
|
201
|
-
return self.messages.popleft()
|
|
200
|
+
return await self.queue.get()
|
|
202
201
|
|
|
203
202
|
@staticmethod
|
|
204
203
|
async def pong() -> Literal[False]:
|
|
@@ -23,6 +23,7 @@ from web3.middleware import (
|
|
|
23
23
|
)
|
|
24
24
|
from web3.types import (
|
|
25
25
|
FormattedEthSubscriptionResponse,
|
|
26
|
+
RPCEndpoint,
|
|
26
27
|
)
|
|
27
28
|
|
|
28
29
|
if TYPE_CHECKING:
|
|
@@ -31,6 +32,22 @@ if TYPE_CHECKING:
|
|
|
31
32
|
)
|
|
32
33
|
|
|
33
34
|
|
|
35
|
+
SOME_BLOCK_KEYS = [
|
|
36
|
+
"number",
|
|
37
|
+
"hash",
|
|
38
|
+
"parentHash",
|
|
39
|
+
"transactionsRoot",
|
|
40
|
+
"stateRoot",
|
|
41
|
+
"receiptsRoot",
|
|
42
|
+
"size",
|
|
43
|
+
"gasLimit",
|
|
44
|
+
"gasUsed",
|
|
45
|
+
"timestamp",
|
|
46
|
+
"transactions",
|
|
47
|
+
"baseFeePerGas",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
|
|
34
51
|
class PersistentConnectionProviderTest:
|
|
35
52
|
@pytest.mark.asyncio
|
|
36
53
|
@pytest.mark.parametrize(
|
|
@@ -372,22 +389,8 @@ class PersistentConnectionProviderTest:
|
|
|
372
389
|
assert isinstance(pending, AttributeDict)
|
|
373
390
|
|
|
374
391
|
# assert block values
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
"hash",
|
|
378
|
-
"parentHash",
|
|
379
|
-
"transactionsRoot",
|
|
380
|
-
"stateRoot",
|
|
381
|
-
"receiptsRoot",
|
|
382
|
-
"size",
|
|
383
|
-
"gasLimit",
|
|
384
|
-
"gasUsed",
|
|
385
|
-
"timestamp",
|
|
386
|
-
"transactions",
|
|
387
|
-
"baseFeePerGas",
|
|
388
|
-
]
|
|
389
|
-
assert all(k in latest.keys() for k in some_block_keys)
|
|
390
|
-
assert all(k in pending.keys() for k in some_block_keys)
|
|
392
|
+
assert all(k in latest.keys() for k in SOME_BLOCK_KEYS)
|
|
393
|
+
assert all(k in pending.keys() for k in SOME_BLOCK_KEYS)
|
|
391
394
|
|
|
392
395
|
assert isinstance(block_num, int)
|
|
393
396
|
assert latest["number"] == block_num
|
|
@@ -395,3 +398,28 @@ class PersistentConnectionProviderTest:
|
|
|
395
398
|
assert isinstance(chain_id, int)
|
|
396
399
|
assert isinstance(chain_id2, int)
|
|
397
400
|
assert isinstance(chain_id3, int)
|
|
401
|
+
|
|
402
|
+
@pytest.mark.asyncio
|
|
403
|
+
async def test_public_socket_api(self, async_w3: "AsyncWeb3") -> None:
|
|
404
|
+
# send a request over the socket
|
|
405
|
+
await async_w3.socket.send(
|
|
406
|
+
RPCEndpoint("eth_getBlockByNumber"), ["latest", True]
|
|
407
|
+
)
|
|
408
|
+
|
|
409
|
+
# recv and validate the unprocessed response
|
|
410
|
+
response = await async_w3.socket.recv()
|
|
411
|
+
assert "id" in response, "Expected 'id' key in response."
|
|
412
|
+
assert "jsonrpc" in response, "Expected 'jsonrpc' key in response."
|
|
413
|
+
assert "result" in response, "Expected 'result' key in response."
|
|
414
|
+
assert all(k in response["result"].keys() for k in SOME_BLOCK_KEYS)
|
|
415
|
+
assert not isinstance(response["result"]["number"], int) # assert not processed
|
|
416
|
+
|
|
417
|
+
# make a request over the socket
|
|
418
|
+
response = await async_w3.socket.make_request(
|
|
419
|
+
RPCEndpoint("eth_getBlockByNumber"), ["latest", True]
|
|
420
|
+
)
|
|
421
|
+
assert "id" in response, "Expected 'id' key in response."
|
|
422
|
+
assert "jsonrpc" in response, "Expected 'jsonrpc' key in response."
|
|
423
|
+
assert "result" in response, "Expected 'result' key in response."
|
|
424
|
+
assert all(k in response["result"].keys() for k in SOME_BLOCK_KEYS)
|
|
425
|
+
assert not isinstance(response["result"]["number"], int) # assert not processed
|
|
@@ -327,6 +327,12 @@ class TaskNotRunning(Web3Exception):
|
|
|
327
327
|
super().__init__(message)
|
|
328
328
|
|
|
329
329
|
|
|
330
|
+
class PersistentConnectionClosedOK(Web3Exception):
|
|
331
|
+
"""
|
|
332
|
+
Raised when a persistent connection is closed gracefully by the server.
|
|
333
|
+
"""
|
|
334
|
+
|
|
335
|
+
|
|
330
336
|
class Web3RPCError(Web3Exception):
|
|
331
337
|
"""
|
|
332
338
|
Raised when a JSON-RPC response contains an error field.
|
|
@@ -20,9 +20,6 @@ from eth_utils.toolz import (
|
|
|
20
20
|
from hexbytes import (
|
|
21
21
|
HexBytes,
|
|
22
22
|
)
|
|
23
|
-
from websockets.exceptions import (
|
|
24
|
-
ConnectionClosedOK,
|
|
25
|
-
)
|
|
26
23
|
|
|
27
24
|
from web3._utils.batching import (
|
|
28
25
|
RequestBatcher,
|
|
@@ -472,22 +469,50 @@ class RequestManager:
|
|
|
472
469
|
|
|
473
470
|
# -- persistent connection -- #
|
|
474
471
|
|
|
475
|
-
async def
|
|
472
|
+
async def socket_request(self, method: RPCEndpoint, params: Any) -> RPCResponse:
|
|
476
473
|
provider = cast(PersistentConnectionProvider, self._provider)
|
|
477
474
|
request_func = await provider.request_func(
|
|
478
475
|
cast("AsyncWeb3", self.w3), cast("MiddlewareOnion", self.middleware_onion)
|
|
479
476
|
)
|
|
480
477
|
self.logger.debug(
|
|
481
|
-
"Making request to open socket connection: "
|
|
478
|
+
"Making request to open socket connection and waiting for response: "
|
|
482
479
|
f"{provider.get_endpoint_uri_or_ipc_path()}, method: {method}"
|
|
483
480
|
)
|
|
484
481
|
response = await request_func(method, params)
|
|
485
482
|
return await self._process_response(response)
|
|
486
483
|
|
|
484
|
+
async def send(self, method: RPCEndpoint, params: Any) -> None:
|
|
485
|
+
provider = cast(PersistentConnectionProvider, self._provider)
|
|
486
|
+
# run through the request processors of the middleware
|
|
487
|
+
for mw_class in self.middleware_onion.as_tuple_of_middleware():
|
|
488
|
+
mw = mw_class(self.w3)
|
|
489
|
+
method, params = mw.request_processor(method, params)
|
|
490
|
+
|
|
491
|
+
self.logger.debug(
|
|
492
|
+
"Sending request to open socket connection: "
|
|
493
|
+
f"{provider.get_endpoint_uri_or_ipc_path()}, method: {method}"
|
|
494
|
+
)
|
|
495
|
+
await provider.socket_send(provider.encode_rpc_request(method, params))
|
|
496
|
+
|
|
497
|
+
async def recv(self) -> RPCResponse:
|
|
498
|
+
provider = cast(PersistentConnectionProvider, self._provider)
|
|
499
|
+
self.logger.debug(
|
|
500
|
+
"Getting next response from open socket connection: "
|
|
501
|
+
f"{provider.get_endpoint_uri_or_ipc_path()}"
|
|
502
|
+
)
|
|
503
|
+
# pop from the queue since the listener task is responsible for reading
|
|
504
|
+
# directly from the socket
|
|
505
|
+
request_response_cache = self._request_processor._request_response_cache
|
|
506
|
+
_key, response = await request_response_cache.async_await_and_popitem(
|
|
507
|
+
last=False,
|
|
508
|
+
timeout=provider.request_timeout,
|
|
509
|
+
)
|
|
510
|
+
return await self._process_response(response)
|
|
511
|
+
|
|
487
512
|
def _persistent_message_stream(self) -> "_AsyncPersistentMessageStream":
|
|
488
513
|
return _AsyncPersistentMessageStream(self)
|
|
489
514
|
|
|
490
|
-
async def _get_next_message(self) ->
|
|
515
|
+
async def _get_next_message(self) -> RPCResponse:
|
|
491
516
|
return await self._message_stream().__anext__()
|
|
492
517
|
|
|
493
518
|
async def _message_stream(self) -> AsyncGenerator[RPCResponse, None]:
|
|
@@ -515,12 +540,13 @@ class RequestManager:
|
|
|
515
540
|
# if response is an active subscription response, process it
|
|
516
541
|
yield await self._process_response(response)
|
|
517
542
|
except TaskNotRunning:
|
|
543
|
+
await asyncio.sleep(0)
|
|
518
544
|
self._provider._handle_listener_task_exceptions()
|
|
519
545
|
self.logger.error(
|
|
520
546
|
"Message listener background task has stopped unexpectedly. "
|
|
521
547
|
"Stopping message stream."
|
|
522
548
|
)
|
|
523
|
-
|
|
549
|
+
return
|
|
524
550
|
|
|
525
551
|
async def _process_response(self, response: RPCResponse) -> RPCResponse:
|
|
526
552
|
provider = cast(PersistentConnectionProvider, self._provider)
|
|
@@ -586,7 +612,4 @@ class _AsyncPersistentMessageStream:
|
|
|
586
612
|
return self
|
|
587
613
|
|
|
588
614
|
async def __anext__(self) -> RPCResponse:
|
|
589
|
-
|
|
590
|
-
return await self.manager._get_next_message()
|
|
591
|
-
except ConnectionClosedOK:
|
|
592
|
-
raise StopAsyncIteration
|
|
615
|
+
return await self.manager._get_next_message()
|
|
@@ -138,7 +138,7 @@ def retrieve_async_method_call_fn(
|
|
|
138
138
|
|
|
139
139
|
try:
|
|
140
140
|
method_str = cast(RPCEndpoint, method_str)
|
|
141
|
-
return await async_w3.manager.
|
|
141
|
+
return await async_w3.manager.socket_request(method_str, params)
|
|
142
142
|
except Exception as e:
|
|
143
143
|
if (
|
|
144
144
|
cache_key is not None
|
|
@@ -11,11 +11,9 @@ from pathlib import (
|
|
|
11
11
|
import sys
|
|
12
12
|
from typing import (
|
|
13
13
|
Any,
|
|
14
|
-
List,
|
|
15
14
|
Optional,
|
|
16
15
|
Tuple,
|
|
17
16
|
Union,
|
|
18
|
-
cast,
|
|
19
17
|
)
|
|
20
18
|
|
|
21
19
|
from eth_utils import (
|
|
@@ -23,20 +21,12 @@ from eth_utils import (
|
|
|
23
21
|
)
|
|
24
22
|
|
|
25
23
|
from web3.types import (
|
|
26
|
-
RPCEndpoint,
|
|
27
24
|
RPCResponse,
|
|
28
25
|
)
|
|
29
26
|
|
|
30
27
|
from . import (
|
|
31
28
|
PersistentConnectionProvider,
|
|
32
29
|
)
|
|
33
|
-
from ..._utils.batching import (
|
|
34
|
-
BATCH_REQUEST_ID,
|
|
35
|
-
sort_batch_response_by_response_ids,
|
|
36
|
-
)
|
|
37
|
-
from ..._utils.caching import (
|
|
38
|
-
async_handle_request_caching,
|
|
39
|
-
)
|
|
40
30
|
from ...exceptions import (
|
|
41
31
|
ProviderConnectionError,
|
|
42
32
|
Web3TypeError,
|
|
@@ -91,12 +81,7 @@ class AsyncIPCProvider(PersistentConnectionProvider):
|
|
|
91
81
|
return False
|
|
92
82
|
|
|
93
83
|
try:
|
|
94
|
-
|
|
95
|
-
RPCEndpoint("web3_clientVersions"), []
|
|
96
|
-
)
|
|
97
|
-
self._writer.write(request_data)
|
|
98
|
-
current_request_id = json.loads(request_data)["id"]
|
|
99
|
-
await self._get_response_for_request_id(current_request_id, timeout=2)
|
|
84
|
+
await self.make_request("web3_clientVersion", [])
|
|
100
85
|
return True
|
|
101
86
|
except (OSError, ProviderConnectionError) as e:
|
|
102
87
|
if show_traceback:
|
|
@@ -105,55 +90,33 @@ class AsyncIPCProvider(PersistentConnectionProvider):
|
|
|
105
90
|
)
|
|
106
91
|
return False
|
|
107
92
|
|
|
108
|
-
async def
|
|
109
|
-
self._reader, self._writer = await async_get_ipc_socket(self.ipc_path)
|
|
110
|
-
|
|
111
|
-
async def _provider_specific_disconnect(self) -> None:
|
|
112
|
-
if self._writer and not self._writer.is_closing():
|
|
113
|
-
self._writer.close()
|
|
114
|
-
await self._writer.wait_closed()
|
|
115
|
-
self._writer = None
|
|
116
|
-
if self._reader:
|
|
117
|
-
self._reader = None
|
|
118
|
-
|
|
119
|
-
async def _reset_socket(self) -> None:
|
|
120
|
-
self._writer.close()
|
|
121
|
-
await self._writer.wait_closed()
|
|
122
|
-
self._reader, self._writer = await async_get_ipc_socket(self.ipc_path)
|
|
123
|
-
|
|
124
|
-
@async_handle_request_caching
|
|
125
|
-
async def make_request(self, method: RPCEndpoint, params: Any) -> RPCResponse:
|
|
93
|
+
async def socket_send(self, request_data: bytes) -> None:
|
|
126
94
|
if self._writer is None:
|
|
127
95
|
raise ProviderConnectionError(
|
|
128
96
|
"Connection to ipc socket has not been initiated for the provider."
|
|
129
97
|
)
|
|
130
98
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
await self._writer.drain()
|
|
135
|
-
except OSError as e:
|
|
136
|
-
# Broken pipe
|
|
137
|
-
if e.errno == errno.EPIPE:
|
|
138
|
-
# one extra attempt, then give up
|
|
139
|
-
await self._reset_socket()
|
|
140
|
-
self._writer.write(request_data)
|
|
141
|
-
await self._writer.drain()
|
|
99
|
+
return await asyncio.wait_for(
|
|
100
|
+
self._socket_send(request_data), timeout=self.request_timeout
|
|
101
|
+
)
|
|
142
102
|
|
|
143
|
-
|
|
144
|
-
|
|
103
|
+
async def socket_recv(self) -> RPCResponse:
|
|
104
|
+
while True:
|
|
105
|
+
# yield to the event loop to allow other tasks to run
|
|
106
|
+
await asyncio.sleep(0)
|
|
145
107
|
|
|
146
|
-
|
|
108
|
+
try:
|
|
109
|
+
response, pos = self._decoder.raw_decode(self._raw_message)
|
|
110
|
+
self._raw_message = self._raw_message[pos:].lstrip()
|
|
111
|
+
return response
|
|
112
|
+
except JSONDecodeError:
|
|
113
|
+
# read more data from the socket if the current raw message is
|
|
114
|
+
# incomplete
|
|
115
|
+
self._raw_message += to_text(await self._reader.read(4096)).lstrip()
|
|
147
116
|
|
|
148
|
-
|
|
149
|
-
self, requests: List[Tuple[RPCEndpoint, Any]]
|
|
150
|
-
) -> List[RPCResponse]:
|
|
151
|
-
if self._writer is None:
|
|
152
|
-
raise ProviderConnectionError(
|
|
153
|
-
"Connection to ipc socket has not been initiated for the provider."
|
|
154
|
-
)
|
|
117
|
+
# -- private methods -- #
|
|
155
118
|
|
|
156
|
-
|
|
119
|
+
async def _socket_send(self, request_data: bytes) -> None:
|
|
157
120
|
try:
|
|
158
121
|
self._writer.write(request_data)
|
|
159
122
|
await self._writer.drain()
|
|
@@ -165,32 +128,24 @@ class AsyncIPCProvider(PersistentConnectionProvider):
|
|
|
165
128
|
self._writer.write(request_data)
|
|
166
129
|
await self._writer.drain()
|
|
167
130
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
async def _provider_specific_message_listener(self) -> None:
|
|
174
|
-
self._raw_message += to_text(await self._reader.read(4096)).lstrip()
|
|
131
|
+
async def _reset_socket(self) -> None:
|
|
132
|
+
self._writer.close()
|
|
133
|
+
await self._writer.wait_closed()
|
|
134
|
+
self._reader, self._writer = await async_get_ipc_socket(self.ipc_path)
|
|
175
135
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
response, pos = self._decoder.raw_decode(self._raw_message)
|
|
179
|
-
except JSONDecodeError:
|
|
180
|
-
break
|
|
136
|
+
async def _provider_specific_connect(self) -> None:
|
|
137
|
+
self._reader, self._writer = await async_get_ipc_socket(self.ipc_path)
|
|
181
138
|
|
|
182
|
-
|
|
183
|
-
|
|
139
|
+
async def _provider_specific_disconnect(self) -> None:
|
|
140
|
+
if self._writer and not self._writer.is_closing():
|
|
141
|
+
self._writer.close()
|
|
142
|
+
await self._writer.wait_closed()
|
|
143
|
+
self._writer = None
|
|
144
|
+
if self._reader:
|
|
145
|
+
self._reader = None
|
|
184
146
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
if not isinstance(response, list)
|
|
188
|
-
else False
|
|
189
|
-
)
|
|
190
|
-
await self._request_processor.cache_raw_response(
|
|
191
|
-
response, subscription=is_subscription
|
|
192
|
-
)
|
|
193
|
-
self._raw_message = self._raw_message[pos:].lstrip()
|
|
147
|
+
async def _provider_specific_socket_reader(self) -> RPCResponse:
|
|
148
|
+
return await self.socket_recv()
|
|
194
149
|
|
|
195
150
|
def _error_log_listener_task_exception(self, e: Exception) -> None:
|
|
196
151
|
super()._error_log_listener_task_exception(e)
|