web3 7.0.0b2__tar.gz → 7.0.0b3__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.
Files changed (176) hide show
  1. {web3-7.0.0b2/web3.egg-info → web3-7.0.0b3}/PKG-INFO +3 -1
  2. {web3-7.0.0b2 → web3-7.0.0b3}/ens/async_ens.py +2 -2
  3. {web3-7.0.0b2 → web3-7.0.0b3}/ens/ens.py +2 -2
  4. {web3-7.0.0b2 → web3-7.0.0b3}/ens/utils.py +8 -6
  5. {web3-7.0.0b2 → web3-7.0.0b3}/setup.py +2 -1
  6. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/events.py +15 -6
  7. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/math.py +12 -14
  8. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/method_formatters.py +7 -0
  9. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/eth_module.py +67 -6
  10. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/rpc_abi.py +1 -0
  11. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/transactions.py +4 -0
  12. {web3-7.0.0b2 → web3-7.0.0b3}/web3/contract/base_contract.py +1 -1
  13. {web3-7.0.0b2 → web3-7.0.0b3}/web3/eth/async_eth.py +20 -2
  14. {web3-7.0.0b2 → web3-7.0.0b3}/web3/eth/eth.py +13 -1
  15. {web3-7.0.0b2 → web3-7.0.0b3}/web3/exceptions.py +11 -0
  16. {web3-7.0.0b2 → web3-7.0.0b3}/web3/manager.py +6 -7
  17. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/persistent.py +1 -1
  18. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/request_processor.py +3 -5
  19. web3-7.0.0b3/web3/tools/benchmark/__init__.py +0 -0
  20. web3-7.0.0b3/web3/tools/benchmark/main.py +185 -0
  21. web3-7.0.0b3/web3/tools/benchmark/node.py +126 -0
  22. web3-7.0.0b3/web3/tools/benchmark/reporting.py +39 -0
  23. web3-7.0.0b3/web3/tools/benchmark/utils.py +69 -0
  24. {web3-7.0.0b2 → web3-7.0.0b3}/web3/types.py +4 -0
  25. {web3-7.0.0b2 → web3-7.0.0b3}/web3/utils/caching.py +2 -4
  26. {web3-7.0.0b2 → web3-7.0.0b3/web3.egg-info}/PKG-INFO +3 -1
  27. {web3-7.0.0b2 → web3-7.0.0b3}/web3.egg-info/SOURCES.txt +5 -0
  28. {web3-7.0.0b2 → web3-7.0.0b3}/web3.egg-info/requires.txt +2 -0
  29. {web3-7.0.0b2 → web3-7.0.0b3}/LICENSE +0 -0
  30. {web3-7.0.0b2 → web3-7.0.0b3}/MANIFEST.in +0 -0
  31. {web3-7.0.0b2 → web3-7.0.0b3}/README.md +0 -0
  32. {web3-7.0.0b2 → web3-7.0.0b3}/ens/__init__.py +0 -0
  33. {web3-7.0.0b2 → web3-7.0.0b3}/ens/_normalization.py +0 -0
  34. {web3-7.0.0b2 → web3-7.0.0b3}/ens/abis.py +0 -0
  35. {web3-7.0.0b2 → web3-7.0.0b3}/ens/auto.py +0 -0
  36. {web3-7.0.0b2 → web3-7.0.0b3}/ens/base_ens.py +0 -0
  37. {web3-7.0.0b2 → web3-7.0.0b3}/ens/constants.py +0 -0
  38. {web3-7.0.0b2 → web3-7.0.0b3}/ens/contract_data.py +0 -0
  39. {web3-7.0.0b2 → web3-7.0.0b3}/ens/exceptions.py +0 -0
  40. {web3-7.0.0b2 → web3-7.0.0b3}/ens/specs/nf.json +0 -0
  41. {web3-7.0.0b2 → web3-7.0.0b3}/ens/specs/normalization_spec.json +0 -0
  42. {web3-7.0.0b2 → web3-7.0.0b3}/pyproject.toml +0 -0
  43. {web3-7.0.0b2 → web3-7.0.0b3}/setup.cfg +0 -0
  44. {web3-7.0.0b2 → web3-7.0.0b3}/web3/__init__.py +0 -0
  45. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/__init__.py +0 -0
  46. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/abi.py +0 -0
  47. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/async_caching.py +0 -0
  48. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/async_transactions.py +0 -0
  49. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/blocks.py +0 -0
  50. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/caching.py +0 -0
  51. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/compat/__init__.py +0 -0
  52. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/__init__.py +0 -0
  53. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/compile_contracts.py +0 -0
  54. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
  55. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
  56. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/address_reflector.py +0 -0
  57. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
  58. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
  59. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
  60. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
  61. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
  62. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/event_contracts.py +0 -0
  63. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
  64. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
  65. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
  66. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
  67. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
  68. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
  69. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
  70. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
  71. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
  72. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
  73. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
  74. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
  75. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
  76. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
  77. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
  78. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/contracts.py +0 -0
  79. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/datatypes.py +0 -0
  80. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/decorators.py +0 -0
  81. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/empty.py +0 -0
  82. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/encoding.py +0 -0
  83. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/ens.py +0 -0
  84. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/error_formatters_utils.py +0 -0
  85. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/fee_utils.py +0 -0
  86. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/filters.py +0 -0
  87. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/formatters.py +0 -0
  88. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/function_identifiers.py +0 -0
  89. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/http.py +0 -0
  90. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/hypothesis.py +0 -0
  91. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module.py +0 -0
  92. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/__init__.py +0 -0
  93. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
  94. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/go_ethereum_personal_module.py +0 -0
  95. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
  96. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/module_testing_utils.py +0 -0
  97. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/net_module.py +0 -0
  98. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/persistent_connection_provider.py +0 -0
  99. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/utils.py +0 -0
  100. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/module_testing/web3_module.py +0 -0
  101. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/normalizers.py +0 -0
  102. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/request.py +0 -0
  103. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/threads.py +0 -0
  104. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/type_conversion.py +0 -0
  105. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/utility_methods.py +0 -0
  106. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/validation.py +0 -0
  107. {web3-7.0.0b2 → web3-7.0.0b3}/web3/_utils/windows.py +0 -0
  108. {web3-7.0.0b2 → web3-7.0.0b3}/web3/auto/__init__.py +0 -0
  109. {web3-7.0.0b2 → web3-7.0.0b3}/web3/auto/gethdev.py +0 -0
  110. {web3-7.0.0b2 → web3-7.0.0b3}/web3/beacon/__init__.py +0 -0
  111. {web3-7.0.0b2 → web3-7.0.0b3}/web3/beacon/api_endpoints.py +0 -0
  112. {web3-7.0.0b2 → web3-7.0.0b3}/web3/beacon/async_beacon.py +0 -0
  113. {web3-7.0.0b2 → web3-7.0.0b3}/web3/beacon/beacon.py +0 -0
  114. {web3-7.0.0b2 → web3-7.0.0b3}/web3/constants.py +0 -0
  115. {web3-7.0.0b2 → web3-7.0.0b3}/web3/contract/__init__.py +0 -0
  116. {web3-7.0.0b2 → web3-7.0.0b3}/web3/contract/async_contract.py +0 -0
  117. {web3-7.0.0b2 → web3-7.0.0b3}/web3/contract/contract.py +0 -0
  118. {web3-7.0.0b2 → web3-7.0.0b3}/web3/contract/utils.py +0 -0
  119. {web3-7.0.0b2 → web3-7.0.0b3}/web3/datastructures.py +0 -0
  120. {web3-7.0.0b2 → web3-7.0.0b3}/web3/eth/__init__.py +0 -0
  121. {web3-7.0.0b2 → web3-7.0.0b3}/web3/eth/base_eth.py +0 -0
  122. {web3-7.0.0b2 → web3-7.0.0b3}/web3/gas_strategies/__init__.py +0 -0
  123. {web3-7.0.0b2 → web3-7.0.0b3}/web3/gas_strategies/rpc.py +0 -0
  124. {web3-7.0.0b2 → web3-7.0.0b3}/web3/gas_strategies/time_based.py +0 -0
  125. {web3-7.0.0b2 → web3-7.0.0b3}/web3/geth.py +0 -0
  126. {web3-7.0.0b2 → web3-7.0.0b3}/web3/logs.py +0 -0
  127. {web3-7.0.0b2 → web3-7.0.0b3}/web3/main.py +0 -0
  128. {web3-7.0.0b2 → web3-7.0.0b3}/web3/method.py +0 -0
  129. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/__init__.py +0 -0
  130. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/attrdict.py +0 -0
  131. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/base.py +0 -0
  132. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/buffered_gas_estimate.py +0 -0
  133. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/filter.py +0 -0
  134. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/formatting.py +0 -0
  135. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/gas_price_strategy.py +0 -0
  136. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/names.py +0 -0
  137. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/proof_of_authority.py +0 -0
  138. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/pythonic.py +0 -0
  139. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/signing.py +0 -0
  140. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/stalecheck.py +0 -0
  141. {web3-7.0.0b2 → web3-7.0.0b3}/web3/middleware/validation.py +0 -0
  142. {web3-7.0.0b2 → web3-7.0.0b3}/web3/module.py +0 -0
  143. {web3-7.0.0b2 → web3-7.0.0b3}/web3/net.py +0 -0
  144. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/__init__.py +0 -0
  145. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/async_base.py +0 -0
  146. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/auto.py +0 -0
  147. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/base.py +0 -0
  148. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/eth_tester/__init__.py +0 -0
  149. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/eth_tester/defaults.py +0 -0
  150. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/eth_tester/main.py +0 -0
  151. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/eth_tester/middleware.py +0 -0
  152. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/ipc.py +0 -0
  153. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/legacy_websocket.py +0 -0
  154. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/__init__.py +0 -0
  155. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/async_ipc.py +0 -0
  156. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/persistent_connection.py +0 -0
  157. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/utils.py +0 -0
  158. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/persistent/websocket.py +0 -0
  159. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/rpc/__init__.py +0 -0
  160. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/rpc/async_rpc.py +0 -0
  161. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/rpc/rpc.py +0 -0
  162. {web3-7.0.0b2 → web3-7.0.0b3}/web3/providers/rpc/utils.py +0 -0
  163. {web3-7.0.0b2 → web3-7.0.0b3}/web3/py.typed +0 -0
  164. {web3-7.0.0b2 → web3-7.0.0b3}/web3/scripts/__init__.py +0 -0
  165. {web3-7.0.0b2 → web3-7.0.0b3}/web3/scripts/release/__init__.py +0 -0
  166. {web3-7.0.0b2 → web3-7.0.0b3}/web3/scripts/release/test_package.py +0 -0
  167. {web3-7.0.0b2 → web3-7.0.0b3}/web3/testing.py +0 -0
  168. {web3-7.0.0b2 → web3-7.0.0b3}/web3/tracing.py +0 -0
  169. {web3-7.0.0b2 → web3-7.0.0b3}/web3/utils/__init__.py +0 -0
  170. {web3-7.0.0b2 → web3-7.0.0b3}/web3/utils/abi.py +0 -0
  171. {web3-7.0.0b2 → web3-7.0.0b3}/web3/utils/address.py +0 -0
  172. {web3-7.0.0b2 → web3-7.0.0b3}/web3/utils/async_exception_handling.py +0 -0
  173. {web3-7.0.0b2 → web3-7.0.0b3}/web3/utils/exception_handling.py +0 -0
  174. {web3-7.0.0b2 → web3-7.0.0b3}/web3.egg-info/dependency_links.txt +0 -0
  175. {web3-7.0.0b2 → web3-7.0.0b3}/web3.egg-info/not-zip-safe +0 -0
  176. {web3-7.0.0b2 → web3-7.0.0b3}/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.0b2
3
+ Version: 7.0.0b3
4
4
  Summary: web3.py
5
5
  Home-page: https://github.com/ethereum/web3.py
6
6
  Author: The Ethereum Foundation
@@ -37,6 +37,7 @@ Requires-Dist: eth-tester[py-evm]==v0.10.0-b.3; extra == "tester"
37
37
  Requires-Dist: py-geth>=4.1.0; extra == "tester"
38
38
  Provides-Extra: linter
39
39
  Requires-Dist: black>=22.1.0; extra == "linter"
40
+ Requires-Dist: blocklint>=0.2.4; extra == "linter"
40
41
  Requires-Dist: flake8==3.8.3; extra == "linter"
41
42
  Requires-Dist: isort>=5.11.0; extra == "linter"
42
43
  Requires-Dist: mypy==1.4.1; extra == "linter"
@@ -50,6 +51,7 @@ Provides-Extra: dev
50
51
  Requires-Dist: eth-tester[py-evm]==v0.10.0-b.3; extra == "dev"
51
52
  Requires-Dist: py-geth>=4.1.0; extra == "dev"
52
53
  Requires-Dist: black>=22.1.0; extra == "dev"
54
+ Requires-Dist: blocklint>=0.2.4; extra == "dev"
53
55
  Requires-Dist: flake8==3.8.3; extra == "dev"
54
56
  Requires-Dist: isort>=5.11.0; extra == "dev"
55
57
  Requires-Dist: mypy==1.4.1; extra == "dev"
@@ -89,7 +89,7 @@ class AsyncENS(BaseENS):
89
89
  like getting the address for a name.
90
90
 
91
91
  Unless otherwise specified, all addresses are assumed to be a `str` in
92
- `checksum format <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>`_,
92
+ `checksum format <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>`_, # blocklint: pragma # noqa: E501
93
93
  like: ``"0x314159265dD8dbb310642f98f50C066173C1259b"``
94
94
  """
95
95
 
@@ -490,7 +490,7 @@ class AsyncENS(BaseENS):
490
490
  ):
491
491
  contract_func_with_args = (fn_name, [node])
492
492
 
493
- calldata = resolver.encodeABI(*contract_func_with_args)
493
+ calldata = resolver.encode_abi(*contract_func_with_args)
494
494
  contract_call_result = await resolver.caller.resolve(
495
495
  ens_encode_name(normal_name),
496
496
  calldata,
@@ -88,7 +88,7 @@ class ENS(BaseENS):
88
88
  like getting the address for a name.
89
89
 
90
90
  Unless otherwise specified, all addresses are assumed to be a `str` in
91
- `checksum format <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>`_,
91
+ `checksum format <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>`_, # blocklint: pragma # noqa: E501
92
92
  like: ``"0x314159265dD8dbb310642f98f50C066173C1259b"``
93
93
  """
94
94
 
@@ -477,7 +477,7 @@ class ENS(BaseENS):
477
477
  if _resolver_supports_interface(resolver, ENS_EXTENDED_RESOLVER_INTERFACE_ID):
478
478
  contract_func_with_args = (fn_name, [node])
479
479
 
480
- calldata = resolver.encodeABI(*contract_func_with_args)
480
+ calldata = resolver.encode_abi(*contract_func_with_args)
481
481
  contract_call_result = resolver.caller.resolve(
482
482
  ens_encode_name(normal_name),
483
483
  calldata,
@@ -35,9 +35,6 @@ from hexbytes import (
35
35
  HexBytes,
36
36
  )
37
37
 
38
- from ._normalization import (
39
- normalize_name_ensip15,
40
- )
41
38
  from .constants import (
42
39
  ACCEPTABLE_STALE_HOURS,
43
40
  AUCTION_START_GAS_CONSTANT,
@@ -117,13 +114,18 @@ def customize_web3(w3: "_Web3") -> "_Web3":
117
114
  def normalize_name(name: str) -> str:
118
115
  """
119
116
  Clean the fully qualified name, as defined in ENS `EIP-137
120
- <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md#name-syntax>`_
117
+ <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md#name-syntax>`_ # blocklint: pragma # noqa: E501
121
118
 
122
119
  This does *not* enforce whether ``name`` is a label or fully qualified domain.
123
120
 
124
121
  :param str name: the dot-separated ENS name
125
122
  :raises InvalidName: if ``name`` has invalid syntax
126
123
  """
124
+ # Defer import because module initialization takes > 0.1 ms
125
+ from ._normalization import (
126
+ normalize_name_ensip15,
127
+ )
128
+
127
129
  if is_empty_name(name):
128
130
  return ""
129
131
  elif isinstance(name, (bytes, bytearray)):
@@ -169,7 +171,7 @@ def ens_encode_name(name: str) -> bytes:
169
171
  def is_valid_name(name: str) -> bool:
170
172
  """
171
173
  Validate whether the fully qualified name is valid, as defined in ENS `EIP-137
172
- <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md#name-syntax>`_
174
+ <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md#name-syntax>`_ # blocklint: pragma # noqa: E501
173
175
 
174
176
  :param str name: the dot-separated ENS name
175
177
  :returns: True if ``name`` is set, and :meth:`~ens.ENS.nameprep` will not
@@ -229,7 +231,7 @@ def raw_name_to_hash(name: str) -> HexBytes:
229
231
  behind the scenes. For advanced usage, it is a helpful utility.
230
232
 
231
233
  This normalizes the name with `nameprep
232
- <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md#name-syntax>`_
234
+ <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-137.md#name-syntax>`_ # blocklint: pragma # noqa: E501
233
235
  before hashing.
234
236
 
235
237
  :param str name: ENS name to hash
@@ -11,6 +11,7 @@ extras_require = {
11
11
  ],
12
12
  "linter": [
13
13
  "black>=22.1.0",
14
+ "blocklint>=0.2.4",
14
15
  "flake8==3.8.3",
15
16
  "isort>=5.11.0",
16
17
  "mypy==1.4.1",
@@ -53,7 +54,7 @@ with open("./README.md") as readme:
53
54
  setup(
54
55
  name="web3",
55
56
  # *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility.
56
- version="7.0.0-beta.2",
57
+ version="7.0.0-beta.3",
57
58
  description="""web3.py""",
58
59
  long_description_content_type="text/markdown",
59
60
  long_description=long_description,
@@ -29,6 +29,7 @@ from eth_abi.codec import (
29
29
  from eth_typing import (
30
30
  ChecksumAddress,
31
31
  HexStr,
32
+ Primitives,
32
33
  TypeStr,
33
34
  )
34
35
  from eth_utils import (
@@ -99,6 +100,12 @@ if TYPE_CHECKING:
99
100
  )
100
101
 
101
102
 
103
+ def _log_entry_data_to_bytes(
104
+ log_entry_data: Union[Primitives, HexStr, str],
105
+ ) -> bytes:
106
+ return hexstr_if_str(to_bytes, log_entry_data)
107
+
108
+
102
109
  def construct_event_topic_set(
103
110
  event_abi: ABIEvent,
104
111
  abi_codec: ABICodec,
@@ -228,23 +235,25 @@ def get_event_data(
228
235
  log_topics = log_entry["topics"]
229
236
  elif not log_entry["topics"]:
230
237
  raise MismatchedABI("Expected non-anonymous event to have 1 or more topics")
231
- # type ignored b/c event_abi_to_log_topic(event_abi: Dict[str, Any])
232
- elif event_abi_to_log_topic(event_abi) != log_entry["topics"][0]: # type: ignore
238
+ elif event_abi_to_log_topic(dict(event_abi)) != _log_entry_data_to_bytes(
239
+ log_entry["topics"][0]
240
+ ):
233
241
  raise MismatchedABI("The event signature did not match the provided ABI")
234
242
  else:
235
243
  log_topics = log_entry["topics"][1:]
236
244
 
245
+ log_topics_bytes = [_log_entry_data_to_bytes(topic) for topic in log_topics]
237
246
  log_topics_abi = get_indexed_event_inputs(event_abi)
238
247
  log_topic_normalized_inputs = normalize_event_input_types(log_topics_abi)
239
248
  log_topic_types = get_event_abi_types_for_decoding(log_topic_normalized_inputs)
240
249
  log_topic_names = get_abi_input_names(ABIEvent({"inputs": log_topics_abi}))
241
250
 
242
- if len(log_topics) != len(log_topic_types):
251
+ if len(log_topics_bytes) != len(log_topic_types):
243
252
  raise LogTopicError(
244
- f"Expected {len(log_topic_types)} log topics. Got {len(log_topics)}"
253
+ f"Expected {len(log_topic_types)} log topics. Got {len(log_topics_bytes)}"
245
254
  )
246
255
 
247
- log_data = hexstr_if_str(to_bytes, log_entry["data"])
256
+ log_data = _log_entry_data_to_bytes(log_entry["data"])
248
257
  log_data_abi = exclude_indexed_event_inputs(event_abi)
249
258
  log_data_normalized_inputs = normalize_event_input_types(log_data_abi)
250
259
  log_data_types = get_event_abi_types_for_decoding(log_data_normalized_inputs)
@@ -270,7 +279,7 @@ def get_event_data(
270
279
 
271
280
  decoded_topic_data = [
272
281
  abi_codec.decode([topic_type], topic_data)[0]
273
- for topic_type, topic_data in zip(log_topic_types, log_topics)
282
+ for topic_type, topic_data in zip(log_topic_types, log_topics_bytes)
274
283
  ]
275
284
  normalized_topic_data = map_abi_data(
276
285
  BASE_RETURN_NORMALIZERS, log_topic_types, decoded_topic_data
@@ -18,22 +18,20 @@ def percentile(
18
18
  )
19
19
  if percentile is None:
20
20
  raise ValueError(f"Expected a percentile choice, got {percentile}")
21
+ if percentile < 0 or percentile > 100:
22
+ raise ValueError("percentile must be in the range [0, 100]")
21
23
 
22
24
  sorted_values = sorted(values)
23
25
 
24
- rank = len(values) * percentile / 100
25
- if rank > 0:
26
- index = rank - 1
27
- if index < 0:
28
- return sorted_values[0]
29
- else:
30
- index = rank
26
+ index = len(values) * percentile / 100 - 1
27
+ if index < 0:
28
+ return sorted_values[0]
31
29
 
32
- if index % 1 == 0:
30
+ fractional = index % 1
31
+ if fractional == 0:
33
32
  return sorted_values[int(index)]
34
- else:
35
- fractional = index % 1
36
- integer = int(index - fractional)
37
- lower = sorted_values[integer]
38
- higher = sorted_values[integer + 1]
39
- return lower + fractional * (higher - lower)
33
+
34
+ integer = int(index - fractional)
35
+ lower = sorted_values[integer]
36
+ higher = sorted_values[integer + 1]
37
+ return lower + fractional * (higher - lower)
@@ -233,6 +233,10 @@ TRANSACTION_RESULT_FORMATTERS = {
233
233
  ),
234
234
  "input": HexBytes,
235
235
  "data": HexBytes, # Nethermind, for example, returns both `input` and `data`
236
+ "maxFeePerBlobGas": to_integer_if_hex,
237
+ "blobVersionedHashes": apply_formatter_if(
238
+ is_not_null, apply_formatter_to_array(to_hexbytes(32))
239
+ ),
236
240
  }
237
241
 
238
242
 
@@ -516,6 +520,7 @@ PYTHONIC_REQUEST_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = {
516
520
  ),
517
521
  RPC.eth_getBalance: apply_formatter_at_index(to_hex_if_integer, 1),
518
522
  RPC.eth_getBlockByNumber: apply_formatter_at_index(to_hex_if_integer, 0),
523
+ RPC.eth_getBlockReceipts: apply_formatter_at_index(to_hex_if_integer, 0),
519
524
  RPC.eth_getBlockTransactionCountByNumber: apply_formatter_at_index(
520
525
  to_hex_if_integer,
521
526
  0,
@@ -723,6 +728,7 @@ PYTHONIC_RESULT_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = {
723
728
  RPC.eth_getBalance: to_integer_if_hex,
724
729
  RPC.eth_getBlockByHash: apply_formatter_if(is_not_null, block_formatter),
725
730
  RPC.eth_getBlockByNumber: apply_formatter_if(is_not_null, block_formatter),
731
+ RPC.eth_getBlockReceipts: apply_formatter_to_array(receipt_formatter),
726
732
  RPC.eth_getBlockTransactionCountByHash: to_integer_if_hex,
727
733
  RPC.eth_getBlockTransactionCountByNumber: to_integer_if_hex,
728
734
  RPC.eth_getCode: HexBytes,
@@ -900,6 +906,7 @@ def raise_transaction_not_found_with_index(
900
906
  NULL_RESULT_FORMATTERS: Dict[RPCEndpoint, Callable[..., Any]] = {
901
907
  RPC.eth_getBlockByHash: raise_block_not_found,
902
908
  RPC.eth_getBlockByNumber: raise_block_not_found,
909
+ RPC.eth_getBlockReceipts: raise_block_not_found,
903
910
  RPC.eth_getBlockTransactionCountByHash: raise_block_not_found,
904
911
  RPC.eth_getBlockTransactionCountByNumber: raise_block_not_found,
905
912
  RPC.eth_getUncleCountByBlockHash: raise_block_not_found,
@@ -977,6 +977,39 @@ class AsyncEthModuleTest:
977
977
  assert block is not None
978
978
  assert isinstance(block["number"], int)
979
979
 
980
+ @pytest.mark.asyncio
981
+ async def test_eth_getBlockReceipts_hash(
982
+ self, async_w3: "AsyncWeb3", async_empty_block: BlockData
983
+ ) -> None:
984
+ receipts = await async_w3.eth.get_block_receipts(async_empty_block["hash"])
985
+ assert isinstance(receipts, list)
986
+
987
+ @pytest.mark.asyncio
988
+ async def test_eth_getBlockReceipts_not_found(self, async_w3: "AsyncWeb3") -> None:
989
+ with pytest.raises(BlockNotFound):
990
+ await async_w3.eth.get_block_receipts(UNKNOWN_HASH)
991
+
992
+ @pytest.mark.asyncio
993
+ async def test_eth_getBlockReceipts_with_integer(
994
+ self, async_w3: "AsyncWeb3", async_empty_block: BlockData
995
+ ) -> None:
996
+ receipts = await async_w3.eth.get_block_receipts(async_empty_block["number"])
997
+ assert isinstance(receipts, list)
998
+
999
+ @pytest.mark.asyncio
1000
+ async def test_eth_getBlockReceipts_safe(
1001
+ self, async_w3: "AsyncWeb3", async_empty_block: BlockData
1002
+ ) -> None:
1003
+ receipts = await async_w3.eth.get_block_receipts("safe")
1004
+ assert isinstance(receipts, list)
1005
+
1006
+ @pytest.mark.asyncio
1007
+ async def test_eth_getBlockReceipts_finalized(
1008
+ self, async_w3: "AsyncWeb3", async_empty_block: BlockData
1009
+ ) -> None:
1010
+ receipts = await async_w3.eth.get_block_receipts("finalized")
1011
+ assert isinstance(receipts, list)
1012
+
980
1013
  @pytest.mark.asyncio
981
1014
  async def test_eth_get_block_by_number_full_transactions(
982
1015
  self, async_w3: "AsyncWeb3", async_block_with_txn: BlockData
@@ -1303,7 +1336,7 @@ class AsyncEthModuleTest:
1303
1336
  async_revert_contract: "Contract",
1304
1337
  async_unlocked_account: ChecksumAddress,
1305
1338
  ) -> None:
1306
- data = async_revert_contract.encodeABI(
1339
+ data = async_revert_contract.encode_abi(
1307
1340
  fn_name="UnauthorizedWithMessage", args=["You are not authorized"]
1308
1341
  )
1309
1342
  txn_params = async_revert_contract._prepare_transaction(
@@ -1323,7 +1356,7 @@ class AsyncEthModuleTest:
1323
1356
  async_revert_contract: "Contract",
1324
1357
  async_unlocked_account: ChecksumAddress,
1325
1358
  ) -> None:
1326
- data = async_revert_contract.encodeABI(fn_name="Unauthorized")
1359
+ data = async_revert_contract.encode_abi(fn_name="Unauthorized")
1327
1360
  txn_params = async_revert_contract._prepare_transaction(
1328
1361
  fn_name="customErrorWithoutMessage",
1329
1362
  transaction={
@@ -3755,7 +3788,7 @@ class EthModuleTest:
3755
3788
  revert_contract: "Contract",
3756
3789
  unlocked_account: ChecksumAddress,
3757
3790
  ) -> None:
3758
- data = revert_contract.encodeABI(
3791
+ data = revert_contract.encode_abi(
3759
3792
  fn_name="UnauthorizedWithMessage", args=["You are not authorized"]
3760
3793
  )
3761
3794
  txn_params = revert_contract._prepare_transaction(
@@ -3775,7 +3808,7 @@ class EthModuleTest:
3775
3808
  revert_contract: "Contract",
3776
3809
  unlocked_account: ChecksumAddress,
3777
3810
  ) -> None:
3778
- data = revert_contract.encodeABI(fn_name="Unauthorized")
3811
+ data = revert_contract.encode_abi(fn_name="Unauthorized")
3779
3812
  txn_params = revert_contract._prepare_transaction(
3780
3813
  fn_name="customErrorWithoutMessage",
3781
3814
  transaction={
@@ -4064,7 +4097,7 @@ class EthModuleTest:
4064
4097
  revert_contract: "Contract",
4065
4098
  unlocked_account: ChecksumAddress,
4066
4099
  ) -> None:
4067
- data = revert_contract.encodeABI(
4100
+ data = revert_contract.encode_abi(
4068
4101
  fn_name="UnauthorizedWithMessage", args=["You are not authorized"]
4069
4102
  )
4070
4103
  txn_params = revert_contract._prepare_transaction(
@@ -4084,7 +4117,7 @@ class EthModuleTest:
4084
4117
  revert_contract: "Contract",
4085
4118
  unlocked_account: ChecksumAddress,
4086
4119
  ) -> None:
4087
- data = revert_contract.encodeABI(fn_name="Unauthorized")
4120
+ data = revert_contract.encode_abi(fn_name="Unauthorized")
4088
4121
  txn_params = revert_contract._prepare_transaction(
4089
4122
  fn_name="customErrorWithoutMessage",
4090
4123
  transaction={
@@ -4224,6 +4257,34 @@ class EthModuleTest:
4224
4257
  transaction = block["transactions"][0]
4225
4258
  assert transaction["hash"] == block_with_txn["transactions"][0] # type: ignore
4226
4259
 
4260
+ def test_eth_getBlockReceipts_hash(
4261
+ self, w3: "Web3", empty_block: BlockData
4262
+ ) -> None:
4263
+ receipts = w3.eth.get_block_receipts(empty_block["hash"])
4264
+ assert isinstance(receipts, list)
4265
+
4266
+ def test_eth_getBlockReceipts_not_found(self, w3: "Web3") -> None:
4267
+ with pytest.raises(BlockNotFound):
4268
+ w3.eth.get_block_receipts(UNKNOWN_HASH)
4269
+
4270
+ def test_eth_getBlockReceipts_with_integer(
4271
+ self, w3: "Web3", empty_block: BlockData
4272
+ ) -> None:
4273
+ receipts = w3.eth.get_block_receipts(empty_block["number"])
4274
+ assert isinstance(receipts, list)
4275
+
4276
+ def test_eth_getBlockReceipts_safe(
4277
+ self, w3: "Web3", empty_block: BlockData
4278
+ ) -> None:
4279
+ receipts = w3.eth.get_block_receipts("safe")
4280
+ assert isinstance(receipts, list)
4281
+
4282
+ def test_eth_getBlockReceipts_finalized(
4283
+ self, w3: "Web3", empty_block: BlockData
4284
+ ) -> None:
4285
+ receipts = w3.eth.get_block_receipts("finalized")
4286
+ assert isinstance(receipts, list)
4287
+
4227
4288
  def test_eth_getTransactionByHash(self, w3: "Web3", mined_txn_hash: HexStr) -> None:
4228
4289
  transaction = w3.eth.get_transaction(mined_txn_hash)
4229
4290
  assert is_dict(transaction)
@@ -57,6 +57,7 @@ class RPC:
57
57
  eth_getBalance = RPCEndpoint("eth_getBalance")
58
58
  eth_getBlockByHash = RPCEndpoint("eth_getBlockByHash")
59
59
  eth_getBlockByNumber = RPCEndpoint("eth_getBlockByNumber")
60
+ eth_getBlockReceipts = RPCEndpoint("eth_getBlockReceipts")
60
61
  eth_getBlockTransactionCountByHash = RPCEndpoint(
61
62
  "eth_getBlockTransactionCountByHash"
62
63
  )
@@ -49,6 +49,8 @@ TX_PARAM_LITERALS = Literal[
49
49
  "nonce",
50
50
  "chainId",
51
51
  "accessList",
52
+ "maxFeePerBlobGas",
53
+ "blobVersionedHashes",
52
54
  ]
53
55
 
54
56
  VALID_TRANSACTION_PARAMS: List[TX_PARAM_LITERALS] = [
@@ -64,6 +66,8 @@ VALID_TRANSACTION_PARAMS: List[TX_PARAM_LITERALS] = [
64
66
  "data",
65
67
  "nonce",
66
68
  "chainId",
69
+ "maxFeePerBlobGas",
70
+ "blobVersionedHashes",
67
71
  ]
68
72
 
69
73
  TRANSACTION_DEFAULTS = {
@@ -723,7 +723,7 @@ class BaseContract:
723
723
  # Public API
724
724
  #
725
725
  @combomethod
726
- def encodeABI(
726
+ def encode_abi(
727
727
  cls,
728
728
  fn_name: str,
729
729
  args: Optional[Any] = None,
@@ -4,6 +4,7 @@ from typing import (
4
4
  Any,
5
5
  Awaitable,
6
6
  Callable,
7
+ Dict,
7
8
  List,
8
9
  Optional,
9
10
  Tuple,
@@ -75,6 +76,7 @@ from web3.types import (
75
76
  BlockData,
76
77
  BlockIdentifier,
77
78
  BlockParams,
79
+ BlockReceipts,
78
80
  CreateAccessListResponse,
79
81
  FeeHistory,
80
82
  FilterParams,
@@ -440,6 +442,20 @@ class AsyncEth(BaseEth):
440
442
  ) -> BlockData:
441
443
  return await self._get_block(block_identifier, full_transactions)
442
444
 
445
+ # eth_getBlockReceipts
446
+
447
+ _get_block_receipts: Method[
448
+ Callable[[BlockIdentifier], Awaitable[BlockReceipts]]
449
+ ] = Method(
450
+ RPC.eth_getBlockReceipts,
451
+ mungers=[default_root_munger],
452
+ )
453
+
454
+ async def get_block_receipts(
455
+ self, block_identifier: BlockIdentifier
456
+ ) -> BlockReceipts:
457
+ return await self._get_block_receipts(block_identifier)
458
+
443
459
  # eth_getBalance
444
460
 
445
461
  _get_balance: Method[
@@ -622,14 +638,16 @@ class AsyncEth(BaseEth):
622
638
  # eth_signTypedData
623
639
 
624
640
  _sign_typed_data: Method[
625
- Callable[[Union[Address, ChecksumAddress, ENS], str], Awaitable[HexStr]]
641
+ Callable[
642
+ [Union[Address, ChecksumAddress, ENS], Dict[str, Any]], Awaitable[HexStr]
643
+ ]
626
644
  ] = Method(
627
645
  RPC.eth_signTypedData,
628
646
  mungers=[default_root_munger],
629
647
  )
630
648
 
631
649
  async def sign_typed_data(
632
- self, account: Union[Address, ChecksumAddress, ENS], data: str
650
+ self, account: Union[Address, ChecksumAddress, ENS], data: Dict[str, Any]
633
651
  ) -> HexStr:
634
652
  return await self._sign_typed_data(account, data)
635
653
 
@@ -2,6 +2,7 @@ from typing import (
2
2
  TYPE_CHECKING,
3
3
  Any,
4
4
  Callable,
5
+ Dict,
5
6
  List,
6
7
  Optional,
7
8
  Sequence,
@@ -72,6 +73,7 @@ from web3.types import (
72
73
  BlockData,
73
74
  BlockIdentifier,
74
75
  BlockParams,
76
+ BlockReceipts,
75
77
  CreateAccessListResponse,
76
78
  FeeHistory,
77
79
  FilterParams,
@@ -411,6 +413,16 @@ class Eth(BaseEth):
411
413
  ) -> BlockData:
412
414
  return self._get_block(block_identifier, full_transactions)
413
415
 
416
+ # eth_getBlockReceipts
417
+
418
+ _get_block_receipts: Method[Callable[[BlockIdentifier], BlockReceipts]] = Method(
419
+ RPC.eth_getBlockReceipts,
420
+ mungers=[default_root_munger],
421
+ )
422
+
423
+ def get_block_receipts(self, block_identifier: BlockIdentifier) -> BlockReceipts:
424
+ return self._get_block_receipts(block_identifier)
425
+
414
426
  # eth_getBalance
415
427
 
416
428
  _get_balance: Method[
@@ -611,7 +623,7 @@ class Eth(BaseEth):
611
623
  # eth_signTypedData
612
624
 
613
625
  sign_typed_data: Method[
614
- Callable[[Union[Address, ChecksumAddress, ENS], str], HexStr]
626
+ Callable[[Union[Address, ChecksumAddress, ENS], Dict[str, Any]], HexStr]
615
627
  ] = Method(
616
628
  RPC.eth_signTypedData,
617
629
  mungers=[default_root_munger],
@@ -30,6 +30,16 @@ class Web3Exception(Exception):
30
30
  # deal with other exceptions
31
31
  """
32
32
 
33
+ def __init__(
34
+ self,
35
+ *args: Any,
36
+ user_message: Optional[str] = None,
37
+ ):
38
+ super().__init__(*args)
39
+
40
+ # Assign properties of Web3Exception
41
+ self.user_message = user_message
42
+
33
43
 
34
44
  class BadFunctionCallOutput(Web3Exception):
35
45
  """
@@ -274,6 +284,7 @@ class ContractLogicError(Web3Exception):
274
284
  message: Optional[str] = None,
275
285
  data: Optional[Union[str, Dict[str, str]]] = None,
276
286
  ):
287
+ super().__init__(message, data)
277
288
  self.message = message
278
289
  self.data = data
279
290
 
@@ -1,4 +1,3 @@
1
- import asyncio
2
1
  import logging
3
2
  from typing import (
4
3
  TYPE_CHECKING,
@@ -246,7 +245,11 @@ class RequestManager:
246
245
  if not isinstance(code, int):
247
246
  _raise_bad_response_format(response, "error['code'] must be an integer")
248
247
  elif code == METHOD_NOT_FOUND:
249
- raise MethodUnavailable(error)
248
+ raise MethodUnavailable(
249
+ error,
250
+ user_message="Check your node provider's API docs to see what "
251
+ "methods are supported",
252
+ )
250
253
 
251
254
  # Errors must include a message
252
255
  if not isinstance(error.get("message"), str):
@@ -345,11 +348,7 @@ class RequestManager:
345
348
  )
346
349
 
347
350
  while True:
348
- # sleep(0) here seems to be the most efficient way to yield control
349
- # back to the event loop while waiting for the response in the queue.
350
- await asyncio.sleep(0)
351
-
352
- response = self._request_processor.pop_raw_response(subscription=True)
351
+ response = await self._request_processor.pop_raw_response(subscription=True)
353
352
  if (
354
353
  response is not None
355
354
  and response.get("params", {}).get("subscription")
@@ -78,7 +78,7 @@ class PersistentConnectionProvider(AsyncJSONBaseProvider, ABC):
78
78
  self.logger.debug(
79
79
  f"Popping response for id {request_id} from cache."
80
80
  )
81
- popped_response = self._request_processor.pop_raw_response(
81
+ popped_response = await self._request_processor.pop_raw_response(
82
82
  cache_key=request_cache_key,
83
83
  )
84
84
  return popped_response
@@ -235,19 +235,17 @@ class RequestProcessor:
235
235
  )
236
236
  self._request_response_cache.cache(cache_key, raw_response)
237
237
 
238
- def pop_raw_response(
238
+ async def pop_raw_response(
239
239
  self, cache_key: str = None, subscription: bool = False
240
240
  ) -> Any:
241
241
  if subscription:
242
242
  qsize = self._subscription_response_queue.qsize()
243
- if qsize == 0:
244
- return None
243
+ raw_response = await self._subscription_response_queue.get()
245
244
 
246
245
  if not self._provider._listen_event.is_set():
247
246
  self._provider._listen_event.set()
248
247
 
249
- raw_response = self._subscription_response_queue.get_nowait()
250
- if qsize == 1:
248
+ if qsize == 0:
251
249
  if not self._subscription_queue_synced_with_ws_stream:
252
250
  self._subscription_queue_synced_with_ws_stream = True
253
251
  self._provider.logger.info(
File without changes