web3 7.6.0__tar.gz → 7.6.1__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 (354) hide show
  1. {web3-7.6.0/web3.egg-info → web3-7.6.1}/PKG-INFO +7 -7
  2. {web3-7.6.0 → web3-7.6.1}/setup.py +3 -3
  3. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/conftest.py +34 -0
  4. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_ambiguous_events.py +144 -2
  5. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_ambiguous_functions.py +50 -2
  6. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_call_interface.py +24 -26
  7. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_class_construction.py +92 -0
  8. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_init.py +24 -0
  9. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_method_abi_decoding.py +4 -4
  10. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_async_ipc_provider.py +24 -3
  11. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_ipc_provider.py +12 -0
  12. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_address.py +16 -0
  13. {web3-7.6.0 → web3-7.6.1}/tests/integration/generate_fixtures/go_ethereum.py +74 -16
  14. web3-7.6.1/tests/integration/geth-1.14.12-fixture.zip +0 -0
  15. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/conftest.py +1 -1
  16. web3-7.6.1/web3/_utils/contract_sources/contract_data/ambiguous_function_contract.py +42 -0
  17. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contracts.py +1 -1
  18. {web3-7.6.0 → web3-7.6.1}/web3/contract/async_contract.py +123 -76
  19. {web3-7.6.0 → web3-7.6.1}/web3/contract/base_contract.py +70 -40
  20. {web3-7.6.0 → web3-7.6.1}/web3/contract/contract.py +140 -84
  21. {web3-7.6.0 → web3-7.6.1}/web3/contract/utils.py +4 -1
  22. {web3-7.6.0 → web3-7.6.1}/web3/providers/ipc.py +1 -1
  23. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/async_ipc.py +1 -1
  24. {web3-7.6.0 → web3-7.6.1}/web3/utils/abi.py +39 -56
  25. {web3-7.6.0 → web3-7.6.1}/web3/utils/address.py +8 -0
  26. {web3-7.6.0 → web3-7.6.1/web3.egg-info}/PKG-INFO +7 -7
  27. {web3-7.6.0 → web3-7.6.1}/web3.egg-info/SOURCES.txt +2 -1
  28. {web3-7.6.0 → web3-7.6.1}/web3.egg-info/requires.txt +6 -6
  29. web3-7.6.0/tests/integration/geth-1.14.5-fixture.zip +0 -0
  30. {web3-7.6.0 → web3-7.6.1}/LICENSE +0 -0
  31. {web3-7.6.0 → web3-7.6.1}/MANIFEST.in +0 -0
  32. {web3-7.6.0 → web3-7.6.1}/README.md +0 -0
  33. {web3-7.6.0 → web3-7.6.1}/ens/__init__.py +0 -0
  34. {web3-7.6.0 → web3-7.6.1}/ens/_normalization.py +0 -0
  35. {web3-7.6.0 → web3-7.6.1}/ens/abis.py +0 -0
  36. {web3-7.6.0 → web3-7.6.1}/ens/async_ens.py +0 -0
  37. {web3-7.6.0 → web3-7.6.1}/ens/auto.py +0 -0
  38. {web3-7.6.0 → web3-7.6.1}/ens/base_ens.py +0 -0
  39. {web3-7.6.0 → web3-7.6.1}/ens/constants.py +0 -0
  40. {web3-7.6.0 → web3-7.6.1}/ens/contract_data.py +0 -0
  41. {web3-7.6.0 → web3-7.6.1}/ens/ens.py +0 -0
  42. {web3-7.6.0 → web3-7.6.1}/ens/exceptions.py +0 -0
  43. {web3-7.6.0 → web3-7.6.1}/ens/specs/nf.json +0 -0
  44. {web3-7.6.0 → web3-7.6.1}/ens/specs/normalization_spec.json +0 -0
  45. {web3-7.6.0 → web3-7.6.1}/ens/utils.py +0 -0
  46. {web3-7.6.0 → web3-7.6.1}/pyproject.toml +0 -0
  47. {web3-7.6.0 → web3-7.6.1}/setup.cfg +0 -0
  48. {web3-7.6.0 → web3-7.6.1}/tests/__init__.py +0 -0
  49. {web3-7.6.0 → web3-7.6.1}/tests/beacon/test_async_beacon.py +0 -0
  50. {web3-7.6.0 → web3-7.6.1}/tests/beacon/test_beacon.py +0 -0
  51. {web3-7.6.0 → web3-7.6.1}/tests/conftest.py +0 -0
  52. {web3-7.6.0 → web3-7.6.1}/tests/core/admin-module/test_admin_addPeer.py +0 -0
  53. {web3-7.6.0 → web3-7.6.1}/tests/core/admin-module/test_admin_nodeInfo.py +0 -0
  54. {web3-7.6.0 → web3-7.6.1}/tests/core/admin-module/test_admin_peers.py +0 -0
  55. {web3-7.6.0 → web3-7.6.1}/tests/core/block-utils/test_select_method_for_block_identifier.py +0 -0
  56. {web3-7.6.0 → web3-7.6.1}/tests/core/caching-utils/test_generate_cache_key.py +0 -0
  57. {web3-7.6.0 → web3-7.6.1}/tests/core/caching-utils/test_request_caching.py +0 -0
  58. {web3-7.6.0 → web3-7.6.1}/tests/core/conftest.py +0 -0
  59. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_attributes.py +0 -0
  60. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_build_transaction.py +0 -0
  61. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_caller_interface.py +0 -0
  62. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_constructor.py +0 -0
  63. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_constructor_encoding.py +0 -0
  64. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_deployment.py +0 -0
  65. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_estimate_gas.py +0 -0
  66. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_events.py +0 -0
  67. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_events_build_filter.py +0 -0
  68. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_example.py +0 -0
  69. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_method_abi_encoding.py +0 -0
  70. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_method_to_argument_matching.py +0 -0
  71. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_panic_errors.py +0 -0
  72. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_transact_interface.py +0 -0
  73. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_contract_util_functions.py +0 -0
  74. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_extracting_event_data.py +0 -0
  75. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_extracting_event_data_old.py +0 -0
  76. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/test_offchain_lookup.py +0 -0
  77. {web3-7.6.0 → web3-7.6.1}/tests/core/contracts/utils.py +0 -0
  78. {web3-7.6.0 → web3-7.6.1}/tests/core/datastructures/test_datastructures.py +0 -0
  79. {web3-7.6.0 → web3-7.6.1}/tests/core/empty-object/test_empty_object_is_falsy.py +0 -0
  80. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/conftest.py +0 -0
  81. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_accounts.py +0 -0
  82. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_block_api.py +0 -0
  83. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_default_account_api.py +0 -0
  84. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_eth_contract.py +0 -0
  85. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_eth_fee_history.py +0 -0
  86. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_eth_filter.py +0 -0
  87. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_eth_properties.py +0 -0
  88. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_gas_pricing.py +0 -0
  89. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_poa.py +0 -0
  90. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-module/test_transactions.py +0 -0
  91. {web3-7.6.0 → web3-7.6.1}/tests/core/eth-tester-api/test_withdrawals.py +0 -0
  92. {web3-7.6.0 → web3-7.6.1}/tests/core/exceptions/test_exceptions.py +0 -0
  93. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/conftest.py +0 -0
  94. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_basic_filter_tests.py +0 -0
  95. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_contract_create_filter_topic_merging.py +0 -0
  96. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_contract_data_filters.py +0 -0
  97. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_contract_get_logs.py +0 -0
  98. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_contract_on_event_filtering.py +0 -0
  99. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_contract_past_event_filtering.py +0 -0
  100. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_contract_topic_filters.py +0 -0
  101. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_existing_filter_instance.py +0 -0
  102. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_filter_against_latest_blocks.py +0 -0
  103. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_filter_against_pending_transactions.py +0 -0
  104. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_filter_against_transaction_logs.py +0 -0
  105. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_filters_against_many_blocks.py +0 -0
  106. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/test_utils_functions.py +0 -0
  107. {web3-7.6.0 → web3-7.6.1}/tests/core/filtering/utils.py +0 -0
  108. {web3-7.6.0 → web3-7.6.1}/tests/core/gas-strategies/test_rpc_gas_pricing_strategies.py +0 -0
  109. {web3-7.6.0 → web3-7.6.1}/tests/core/gas-strategies/test_time_based_gas_price_strategy.py +0 -0
  110. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/conftest.py +0 -0
  111. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/test_default_middlewares.py +0 -0
  112. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/test_middleware_can_be_stateful.py +0 -0
  113. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/test_middleware_onion_api.py +0 -0
  114. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/test_provider_property.py +0 -0
  115. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/test_provider_request_wrapping.py +0 -0
  116. {web3-7.6.0 → web3-7.6.1}/tests/core/manager/test_response_formatters.py +0 -0
  117. {web3-7.6.0 → web3-7.6.1}/tests/core/method-class/test_method.py +0 -0
  118. {web3-7.6.0 → web3-7.6.1}/tests/core/method-class/test_result_formatters.py +0 -0
  119. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_attrdict_middleware.py +0 -0
  120. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_eth_tester_middleware.py +0 -0
  121. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_filter_middleware.py +0 -0
  122. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_formatting_middleware.py +0 -0
  123. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_gas_price_strategy.py +0 -0
  124. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_middleware.py +0 -0
  125. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_name_to_address_middleware.py +0 -0
  126. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_stalecheck.py +0 -0
  127. {web3-7.6.0 → web3-7.6.1}/tests/core/middleware/test_transaction_signing.py +0 -0
  128. {web3-7.6.0 → web3-7.6.1}/tests/core/module-class/test_module.py +0 -0
  129. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_async_http_provider.py +0 -0
  130. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_async_tester_provider.py +0 -0
  131. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_auto_provider.py +0 -0
  132. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_base_provider.py +0 -0
  133. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_http_provider.py +0 -0
  134. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_http_request_retry.py +0 -0
  135. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_legacy_websocket_provider.py +0 -0
  136. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_provider_init.py +0 -0
  137. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_tester_provider.py +0 -0
  138. {web3-7.6.0 → web3-7.6.1}/tests/core/providers/test_websocket_provider.py +0 -0
  139. {web3-7.6.0 → web3-7.6.1}/tests/core/test_library_files.py +0 -0
  140. {web3-7.6.0 → web3-7.6.1}/tests/core/testing-module/test_testing_mine.py +0 -0
  141. {web3-7.6.0 → web3-7.6.1}/tests/core/testing-module/test_testing_snapshot_and_revert.py +0 -0
  142. {web3-7.6.0 → web3-7.6.1}/tests/core/testing-module/test_testing_timeTravel.py +0 -0
  143. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/__init__.py +0 -0
  144. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/conftest.py +0 -0
  145. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_abi.py +0 -0
  146. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_abi_filtering_by_argument_name.py +0 -0
  147. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_abi_is_encodable.py +0 -0
  148. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_abi_named_tree.py +0 -0
  149. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_async_transaction.py +0 -0
  150. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_attach_modules.py +0 -0
  151. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_attributedict.py +0 -0
  152. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_caching_utils.py +0 -0
  153. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_construct_event_data_set.py +0 -0
  154. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_construct_event_filter_params.py +0 -0
  155. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_construct_event_topics.py +0 -0
  156. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_datatypes.py +0 -0
  157. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_decorators.py +0 -0
  158. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_encoding.py +0 -0
  159. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_event_filter_builder.py +0 -0
  160. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_event_interface.py +0 -0
  161. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_fee_utils.py +0 -0
  162. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_formatters.py +0 -0
  163. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_http_session_manager.py +0 -0
  164. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_is_predefined_block_number.py +0 -0
  165. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_is_probably_enum.py +0 -0
  166. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_is_recognized_type.py +0 -0
  167. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_math.py +0 -0
  168. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_method_formatters.py +0 -0
  169. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_prepare_transaction_replacement.py +0 -0
  170. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_select_filter_method.py +0 -0
  171. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_threads.py +0 -0
  172. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_valid_transaction_params.py +0 -0
  173. {web3-7.6.0 → web3-7.6.1}/tests/core/utilities/test_validation.py +0 -0
  174. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_api.py +0 -0
  175. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_attach_modules.py +0 -0
  176. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_client_version.py +0 -0
  177. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_conversions.py +0 -0
  178. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_import_and_version.py +0 -0
  179. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_keccak.py +0 -0
  180. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_providers.py +0 -0
  181. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_strict_bytes_type_checking.py +0 -0
  182. {web3-7.6.0 → web3-7.6.1}/tests/core/web3-module/test_web3_inheritance.py +0 -0
  183. {web3-7.6.0 → web3-7.6.1}/tests/ens/conftest.py +0 -0
  184. {web3-7.6.0 → web3-7.6.1}/tests/ens/normalization/normalization_tests.json +0 -0
  185. {web3-7.6.0 → web3-7.6.1}/tests/ens/normalization/test_normalize_name_ensip15.py +0 -0
  186. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_ens.py +0 -0
  187. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_get_registry.py +0 -0
  188. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_get_text.py +0 -0
  189. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_nameprep.py +0 -0
  190. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_offchain_resolution.py +0 -0
  191. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_setup_address.py +0 -0
  192. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_setup_name.py +0 -0
  193. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_utils.py +0 -0
  194. {web3-7.6.0 → web3-7.6.1}/tests/ens/test_wildcard_resolution.py +0 -0
  195. {web3-7.6.0 → web3-7.6.1}/tests/integration/README.md +0 -0
  196. {web3-7.6.0 → web3-7.6.1}/tests/integration/common.py +0 -0
  197. {web3-7.6.0 → web3-7.6.1}/tests/integration/conftest.py +0 -0
  198. {web3-7.6.0 → web3-7.6.1}/tests/integration/generate_fixtures/common.py +0 -0
  199. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/__init__.py +0 -0
  200. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/common.py +0 -0
  201. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_http.py +0 -0
  202. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ipc.py +0 -0
  203. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_legacy_ws.py +0 -0
  204. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/__init__.py +0 -0
  205. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/conftest.py +0 -0
  206. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/test_async_await_w3.py +0 -0
  207. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/test_async_ctx_manager_w3.py +0 -0
  208. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/test_goethereum_ws/test_async_iterator_w3.py +0 -0
  209. {web3-7.6.0 → web3-7.6.1}/tests/integration/go_ethereum/utils.py +0 -0
  210. {web3-7.6.0 → web3-7.6.1}/tests/integration/test_ethereum_tester.py +0 -0
  211. {web3-7.6.0 → web3-7.6.1}/tests/utils.py +0 -0
  212. {web3-7.6.0 → web3-7.6.1}/web3/__init__.py +0 -0
  213. {web3-7.6.0 → web3-7.6.1}/web3/_utils/__init__.py +0 -0
  214. {web3-7.6.0 → web3-7.6.1}/web3/_utils/abi.py +0 -0
  215. {web3-7.6.0 → web3-7.6.1}/web3/_utils/abi_element_identifiers.py +0 -0
  216. {web3-7.6.0 → web3-7.6.1}/web3/_utils/async_caching.py +0 -0
  217. {web3-7.6.0 → web3-7.6.1}/web3/_utils/async_transactions.py +0 -0
  218. {web3-7.6.0 → web3-7.6.1}/web3/_utils/batching.py +0 -0
  219. {web3-7.6.0 → web3-7.6.1}/web3/_utils/blocks.py +0 -0
  220. {web3-7.6.0 → web3-7.6.1}/web3/_utils/caching/__init__.py +0 -0
  221. {web3-7.6.0 → web3-7.6.1}/web3/_utils/caching/caching_utils.py +0 -0
  222. {web3-7.6.0 → web3-7.6.1}/web3/_utils/caching/request_caching_validation.py +0 -0
  223. {web3-7.6.0 → web3-7.6.1}/web3/_utils/compat/__init__.py +0 -0
  224. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/__init__.py +0 -0
  225. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/compile_contracts.py +0 -0
  226. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/__init__.py +0 -0
  227. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/_custom_contract_data.py +0 -0
  228. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/arrays_contract.py +0 -0
  229. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/bytes_contracts.py +0 -0
  230. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/constructor_contracts.py +0 -0
  231. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/contract_caller_tester.py +0 -0
  232. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/emitter_contract.py +0 -0
  233. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/event_contracts.py +0 -0
  234. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/extended_resolver.py +0 -0
  235. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/fallback_function_contract.py +0 -0
  236. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/function_name_tester_contract.py +0 -0
  237. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/math_contract.py +0 -0
  238. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/offchain_lookup.py +0 -0
  239. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/offchain_resolver.py +0 -0
  240. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/panic_errors_contract.py +0 -0
  241. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/payable_tester.py +0 -0
  242. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/receive_function_contracts.py +0 -0
  243. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/reflector_contracts.py +0 -0
  244. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/revert_contract.py +0 -0
  245. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/simple_resolver.py +0 -0
  246. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/storage_contract.py +0 -0
  247. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/string_contract.py +0 -0
  248. {web3-7.6.0 → web3-7.6.1}/web3/_utils/contract_sources/contract_data/tuple_contracts.py +0 -0
  249. {web3-7.6.0 → web3-7.6.1}/web3/_utils/datatypes.py +0 -0
  250. {web3-7.6.0 → web3-7.6.1}/web3/_utils/decorators.py +0 -0
  251. {web3-7.6.0 → web3-7.6.1}/web3/_utils/empty.py +0 -0
  252. {web3-7.6.0 → web3-7.6.1}/web3/_utils/encoding.py +0 -0
  253. {web3-7.6.0 → web3-7.6.1}/web3/_utils/ens.py +0 -0
  254. {web3-7.6.0 → web3-7.6.1}/web3/_utils/error_formatters_utils.py +0 -0
  255. {web3-7.6.0 → web3-7.6.1}/web3/_utils/events.py +0 -0
  256. {web3-7.6.0 → web3-7.6.1}/web3/_utils/fee_utils.py +0 -0
  257. {web3-7.6.0 → web3-7.6.1}/web3/_utils/filters.py +0 -0
  258. {web3-7.6.0 → web3-7.6.1}/web3/_utils/formatters.py +0 -0
  259. {web3-7.6.0 → web3-7.6.1}/web3/_utils/http.py +0 -0
  260. {web3-7.6.0 → web3-7.6.1}/web3/_utils/http_session_manager.py +0 -0
  261. {web3-7.6.0 → web3-7.6.1}/web3/_utils/hypothesis.py +0 -0
  262. {web3-7.6.0 → web3-7.6.1}/web3/_utils/math.py +0 -0
  263. {web3-7.6.0 → web3-7.6.1}/web3/_utils/method_formatters.py +0 -0
  264. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module.py +0 -0
  265. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/__init__.py +0 -0
  266. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/eth_module.py +0 -0
  267. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/go_ethereum_admin_module.py +0 -0
  268. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/go_ethereum_debug_module.py +0 -0
  269. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/go_ethereum_txpool_module.py +0 -0
  270. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/module_testing_utils.py +0 -0
  271. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/net_module.py +0 -0
  272. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/persistent_connection_provider.py +0 -0
  273. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/utils.py +0 -0
  274. {web3-7.6.0 → web3-7.6.1}/web3/_utils/module_testing/web3_module.py +0 -0
  275. {web3-7.6.0 → web3-7.6.1}/web3/_utils/normalizers.py +0 -0
  276. {web3-7.6.0 → web3-7.6.1}/web3/_utils/rpc_abi.py +0 -0
  277. {web3-7.6.0 → web3-7.6.1}/web3/_utils/threads.py +0 -0
  278. {web3-7.6.0 → web3-7.6.1}/web3/_utils/transactions.py +0 -0
  279. {web3-7.6.0 → web3-7.6.1}/web3/_utils/type_conversion.py +0 -0
  280. {web3-7.6.0 → web3-7.6.1}/web3/_utils/utility_methods.py +0 -0
  281. {web3-7.6.0 → web3-7.6.1}/web3/_utils/validation.py +0 -0
  282. {web3-7.6.0 → web3-7.6.1}/web3/_utils/windows.py +0 -0
  283. {web3-7.6.0 → web3-7.6.1}/web3/auto/__init__.py +0 -0
  284. {web3-7.6.0 → web3-7.6.1}/web3/auto/gethdev.py +0 -0
  285. {web3-7.6.0 → web3-7.6.1}/web3/beacon/__init__.py +0 -0
  286. {web3-7.6.0 → web3-7.6.1}/web3/beacon/api_endpoints.py +0 -0
  287. {web3-7.6.0 → web3-7.6.1}/web3/beacon/async_beacon.py +0 -0
  288. {web3-7.6.0 → web3-7.6.1}/web3/beacon/beacon.py +0 -0
  289. {web3-7.6.0 → web3-7.6.1}/web3/constants.py +0 -0
  290. {web3-7.6.0 → web3-7.6.1}/web3/contract/__init__.py +0 -0
  291. {web3-7.6.0 → web3-7.6.1}/web3/datastructures.py +0 -0
  292. {web3-7.6.0 → web3-7.6.1}/web3/eth/__init__.py +0 -0
  293. {web3-7.6.0 → web3-7.6.1}/web3/eth/async_eth.py +0 -0
  294. {web3-7.6.0 → web3-7.6.1}/web3/eth/base_eth.py +0 -0
  295. {web3-7.6.0 → web3-7.6.1}/web3/eth/eth.py +0 -0
  296. {web3-7.6.0 → web3-7.6.1}/web3/exceptions.py +0 -0
  297. {web3-7.6.0 → web3-7.6.1}/web3/gas_strategies/__init__.py +0 -0
  298. {web3-7.6.0 → web3-7.6.1}/web3/gas_strategies/rpc.py +0 -0
  299. {web3-7.6.0 → web3-7.6.1}/web3/gas_strategies/time_based.py +0 -0
  300. {web3-7.6.0 → web3-7.6.1}/web3/geth.py +0 -0
  301. {web3-7.6.0 → web3-7.6.1}/web3/logs.py +0 -0
  302. {web3-7.6.0 → web3-7.6.1}/web3/main.py +0 -0
  303. {web3-7.6.0 → web3-7.6.1}/web3/manager.py +0 -0
  304. {web3-7.6.0 → web3-7.6.1}/web3/method.py +0 -0
  305. {web3-7.6.0 → web3-7.6.1}/web3/middleware/__init__.py +0 -0
  306. {web3-7.6.0 → web3-7.6.1}/web3/middleware/attrdict.py +0 -0
  307. {web3-7.6.0 → web3-7.6.1}/web3/middleware/base.py +0 -0
  308. {web3-7.6.0 → web3-7.6.1}/web3/middleware/buffered_gas_estimate.py +0 -0
  309. {web3-7.6.0 → web3-7.6.1}/web3/middleware/filter.py +0 -0
  310. {web3-7.6.0 → web3-7.6.1}/web3/middleware/formatting.py +0 -0
  311. {web3-7.6.0 → web3-7.6.1}/web3/middleware/gas_price_strategy.py +0 -0
  312. {web3-7.6.0 → web3-7.6.1}/web3/middleware/names.py +0 -0
  313. {web3-7.6.0 → web3-7.6.1}/web3/middleware/proof_of_authority.py +0 -0
  314. {web3-7.6.0 → web3-7.6.1}/web3/middleware/pythonic.py +0 -0
  315. {web3-7.6.0 → web3-7.6.1}/web3/middleware/signing.py +0 -0
  316. {web3-7.6.0 → web3-7.6.1}/web3/middleware/stalecheck.py +0 -0
  317. {web3-7.6.0 → web3-7.6.1}/web3/middleware/validation.py +0 -0
  318. {web3-7.6.0 → web3-7.6.1}/web3/module.py +0 -0
  319. {web3-7.6.0 → web3-7.6.1}/web3/net.py +0 -0
  320. {web3-7.6.0 → web3-7.6.1}/web3/providers/__init__.py +0 -0
  321. {web3-7.6.0 → web3-7.6.1}/web3/providers/async_base.py +0 -0
  322. {web3-7.6.0 → web3-7.6.1}/web3/providers/auto.py +0 -0
  323. {web3-7.6.0 → web3-7.6.1}/web3/providers/base.py +0 -0
  324. {web3-7.6.0 → web3-7.6.1}/web3/providers/eth_tester/__init__.py +0 -0
  325. {web3-7.6.0 → web3-7.6.1}/web3/providers/eth_tester/defaults.py +0 -0
  326. {web3-7.6.0 → web3-7.6.1}/web3/providers/eth_tester/main.py +0 -0
  327. {web3-7.6.0 → web3-7.6.1}/web3/providers/eth_tester/middleware.py +0 -0
  328. {web3-7.6.0 → web3-7.6.1}/web3/providers/legacy_websocket.py +0 -0
  329. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/__init__.py +0 -0
  330. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/persistent.py +0 -0
  331. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/persistent_connection.py +0 -0
  332. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/request_processor.py +0 -0
  333. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/utils.py +0 -0
  334. {web3-7.6.0 → web3-7.6.1}/web3/providers/persistent/websocket.py +0 -0
  335. {web3-7.6.0 → web3-7.6.1}/web3/providers/rpc/__init__.py +0 -0
  336. {web3-7.6.0 → web3-7.6.1}/web3/providers/rpc/async_rpc.py +0 -0
  337. {web3-7.6.0 → web3-7.6.1}/web3/providers/rpc/rpc.py +0 -0
  338. {web3-7.6.0 → web3-7.6.1}/web3/providers/rpc/utils.py +0 -0
  339. {web3-7.6.0 → web3-7.6.1}/web3/py.typed +0 -0
  340. {web3-7.6.0 → web3-7.6.1}/web3/scripts/__init__.py +0 -0
  341. {web3-7.6.0 → web3-7.6.1}/web3/scripts/install_pre_releases.py +0 -0
  342. {web3-7.6.0 → web3-7.6.1}/web3/scripts/parse_pygeth_version.py +0 -0
  343. {web3-7.6.0 → web3-7.6.1}/web3/scripts/release/__init__.py +0 -0
  344. {web3-7.6.0 → web3-7.6.1}/web3/scripts/release/test_package.py +0 -0
  345. {web3-7.6.0 → web3-7.6.1}/web3/testing.py +0 -0
  346. {web3-7.6.0 → web3-7.6.1}/web3/tracing.py +0 -0
  347. {web3-7.6.0 → web3-7.6.1}/web3/types.py +0 -0
  348. {web3-7.6.0 → web3-7.6.1}/web3/utils/__init__.py +0 -0
  349. {web3-7.6.0 → web3-7.6.1}/web3/utils/async_exception_handling.py +0 -0
  350. {web3-7.6.0 → web3-7.6.1}/web3/utils/caching.py +0 -0
  351. {web3-7.6.0 → web3-7.6.1}/web3/utils/exception_handling.py +0 -0
  352. {web3-7.6.0 → web3-7.6.1}/web3.egg-info/dependency_links.txt +0 -0
  353. {web3-7.6.0 → web3-7.6.1}/web3.egg-info/not-zip-safe +0 -0
  354. {web3-7.6.0 → web3-7.6.1}/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.6.0
3
+ Version: 7.6.1
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
@@ -36,8 +36,8 @@ Requires-Dist: types-requests>=2.0.0
36
36
  Requires-Dist: websockets<14.0.0,>=10.0.0
37
37
  Requires-Dist: pyunormalize>=15.0.0
38
38
  Provides-Extra: tester
39
- Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.11.0b1; extra == "tester"
40
- Requires-Dist: py-geth>=5.0.0; extra == "tester"
39
+ Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "tester"
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
43
  Requires-Dist: bumpversion>=0.5.3; extra == "dev"
@@ -59,8 +59,8 @@ Requires-Dist: hypothesis>=3.31.2; extra == "dev"
59
59
  Requires-Dist: tox>=4.0.0; extra == "dev"
60
60
  Requires-Dist: mypy==1.10.0; extra == "dev"
61
61
  Requires-Dist: pre-commit>=3.4.0; extra == "dev"
62
- Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.11.0b1; extra == "dev"
63
- Requires-Dist: py-geth>=5.0.0; extra == "dev"
62
+ Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "dev"
63
+ Requires-Dist: py-geth>=5.1.0; extra == "dev"
64
64
  Provides-Extra: docs
65
65
  Requires-Dist: sphinx>=6.0.0; extra == "docs"
66
66
  Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "docs"
@@ -76,8 +76,8 @@ Requires-Dist: hypothesis>=3.31.2; extra == "test"
76
76
  Requires-Dist: tox>=4.0.0; extra == "test"
77
77
  Requires-Dist: mypy==1.10.0; extra == "test"
78
78
  Requires-Dist: pre-commit>=3.4.0; extra == "test"
79
- Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.11.0b1; extra == "test"
80
- Requires-Dist: py-geth>=5.0.0; extra == "test"
79
+ Requires-Dist: eth-tester[py-evm]<0.13.0b1,>=0.12.0b1; extra == "test"
80
+ Requires-Dist: py-geth>=5.1.0; extra == "test"
81
81
 
82
82
  # web3.py
83
83
 
@@ -8,8 +8,8 @@ extras_require = {
8
8
  "tester": [
9
9
  # Note: ethereum-maintained libraries in this list should be added to the
10
10
  # `install_pre_releases.py` script.
11
- "eth-tester[py-evm]>=0.11.0b1,<0.13.0b1",
12
- "py-geth>=5.0.0",
11
+ "eth-tester[py-evm]>=0.12.0b1,<0.13.0b1",
12
+ "py-geth>=5.1.0",
13
13
  ],
14
14
  "dev": [
15
15
  "build>=0.9.0",
@@ -55,7 +55,7 @@ with open("./README.md") as readme:
55
55
  setup(
56
56
  name="web3",
57
57
  # *IMPORTANT*: Don't manually change the version here. Use `make bump`, as described in readme
58
- version="7.6.0",
58
+ version="7.6.1",
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",
@@ -13,6 +13,9 @@ from tests.utils import (
13
13
  from web3._utils.abi import (
14
14
  get_abi_element_signature,
15
15
  )
16
+ from web3._utils.contract_sources.contract_data.ambiguous_function_contract import (
17
+ AMBIGUOUS_FUNCTION_CONTRACT_DATA,
18
+ )
16
19
  from web3._utils.contract_sources.contract_data.arrays_contract import (
17
20
  ARRAYS_CONTRACT_DATA,
18
21
  )
@@ -195,6 +198,26 @@ def non_strict_string_contract(
195
198
  )
196
199
 
197
200
 
201
+ # --- ambiguous function contract --- #
202
+
203
+
204
+ @pytest.fixture(scope="session")
205
+ def ambiguous_function_contract_data():
206
+ return AMBIGUOUS_FUNCTION_CONTRACT_DATA
207
+
208
+
209
+ @pytest.fixture
210
+ def ambiguous_function_contract_factory(w3):
211
+ return w3.eth.contract(**AMBIGUOUS_FUNCTION_CONTRACT_DATA)
212
+
213
+
214
+ @pytest.fixture
215
+ def ambiguous_function_contract(
216
+ w3, ambiguous_function_contract_factory, address_conversion_func
217
+ ):
218
+ return deploy(w3, ambiguous_function_contract_factory, address_conversion_func)
219
+
220
+
198
221
  # --- emitter contract --- #
199
222
 
200
223
 
@@ -780,6 +803,17 @@ async def async_nested_tuple_contract_with_decode_tuples(
780
803
  )
781
804
 
782
805
 
806
+ @pytest_asyncio.fixture
807
+ async def async_ambiguous_event_contract(async_w3, address_conversion_func):
808
+ async_ambiguous_event_contract_factory = async_w3.eth.contract(
809
+ **AMBIGUOUS_EVENT_NAME_CONTRACT_DATA
810
+ )
811
+
812
+ return await async_deploy(
813
+ async_w3, async_ambiguous_event_contract_factory, address_conversion_func
814
+ )
815
+
816
+
783
817
  async def async_invoke_contract(
784
818
  api_call_desig="call",
785
819
  contract=None,
@@ -7,6 +7,9 @@ from eth_typing import (
7
7
  ABI,
8
8
  )
9
9
 
10
+ from web3.contract.async_contract import (
11
+ AsyncContract,
12
+ )
10
13
  from web3.contract.contract import (
11
14
  Contract,
12
15
  ContractEvent,
@@ -15,6 +18,7 @@ from web3.exceptions import (
15
18
  MismatchedABI,
16
19
  )
17
20
  from web3.main import (
21
+ AsyncWeb3,
18
22
  Web3,
19
23
  )
20
24
  from web3.utils.abi import (
@@ -124,7 +128,7 @@ AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI = [
124
128
  ]
125
129
 
126
130
 
127
- def test_get_abi_from_event(ambiguous_event_contract: "Contract") -> None:
131
+ def test_get_abi_from_event_signature(ambiguous_event_contract: "Contract") -> None:
128
132
  expected_event_abi = {
129
133
  "anonymous": False,
130
134
  "inputs": [
@@ -143,6 +147,78 @@ def test_get_abi_from_event(ambiguous_event_contract: "Contract") -> None:
143
147
  assert expected_event_abi == event_get_abi_result
144
148
 
145
149
 
150
+ def test_get_abi_from_event_call_without_args(ambiguous_event_contract: "Contract"):
151
+ expected_event_abi = {
152
+ "anonymous": False,
153
+ "inputs": [
154
+ {
155
+ "indexed": False,
156
+ "internalType": "uint256",
157
+ "name": "arg0",
158
+ "type": "uint256",
159
+ }
160
+ ],
161
+ "name": "LogSingleArg",
162
+ "type": "event",
163
+ }
164
+
165
+ event_get_abi_result = ambiguous_event_contract.events.LogSingleArg.abi
166
+ assert expected_event_abi == event_get_abi_result
167
+
168
+
169
+ def test_get_abi_from_event_call_with_any_args(ambiguous_event_contract: "Contract"):
170
+ expected_event_abi = {
171
+ "anonymous": False,
172
+ "inputs": [
173
+ {
174
+ "indexed": False,
175
+ "internalType": "uint256",
176
+ "name": "arg0",
177
+ "type": "uint256",
178
+ }
179
+ ],
180
+ "name": "LogSingleArg",
181
+ "type": "event",
182
+ }
183
+
184
+ event_get_abi_result = ambiguous_event_contract.events.LogSingleArg().abi
185
+ assert expected_event_abi == event_get_abi_result
186
+
187
+ event_get_abi_result = ambiguous_event_contract.events.LogSingleArg(1).abi
188
+ assert expected_event_abi == event_get_abi_result
189
+
190
+ event_get_abi_result = ambiguous_event_contract.events.LogSingleArg(
191
+ b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # noqa: E501
192
+ ).abi
193
+ assert expected_event_abi == event_get_abi_result
194
+
195
+ event_get_abi_result = ambiguous_event_contract.events.LogSingleArg("hi").abi
196
+ assert expected_event_abi == event_get_abi_result
197
+
198
+
199
+ def test_async_get_abi_from_event(
200
+ async_ambiguous_event_contract: "AsyncContract",
201
+ ) -> None:
202
+ expected_event_abi = {
203
+ "anonymous": False,
204
+ "inputs": [
205
+ {
206
+ "indexed": False,
207
+ "internalType": "uint256",
208
+ "name": "arg0",
209
+ "type": "uint256",
210
+ }
211
+ ],
212
+ "name": "LogSingleArg",
213
+ "type": "event",
214
+ }
215
+
216
+ event_get_abi_result = async_ambiguous_event_contract.events[
217
+ "LogSingleArg(uint256)"
218
+ ].abi
219
+ assert expected_event_abi == event_get_abi_result
220
+
221
+
146
222
  def test_get_abi_element_for_ambiguous_tuple_events() -> None:
147
223
  event_abi = get_abi_element(
148
224
  cast(ABI, AMBIGUOUS_EVENT_WITH_TUPLE_CONTRACT_ABI),
@@ -215,7 +291,7 @@ def test_contract_event_methods(
215
291
  "name": "LogSingleArg",
216
292
  "type": "event",
217
293
  }
218
- assert log_arg_event.event_name == "LogSingleArg"
294
+ assert log_arg_event.name == "LogSingleArg"
219
295
  assert log_arg_event.abi_element_identifier == "LogSingleArg(uint256)"
220
296
  assert log_arg_event.get_logs() == []
221
297
 
@@ -257,3 +333,69 @@ def test_contract_event_methods(
257
333
  "blockHash": "0x0",
258
334
  "blockNumber": 0,
259
335
  }
336
+
337
+
338
+ @pytest.mark.asyncio
339
+ async def test_async_contract_event_methods(
340
+ async_w3: "AsyncWeb3", async_ambiguous_event_contract: "AsyncContract"
341
+ ) -> None:
342
+ log_arg_event = cast(
343
+ ContractEvent, async_ambiguous_event_contract.events["LogSingleArg(uint256)"]
344
+ )
345
+
346
+ assert log_arg_event.abi == {
347
+ "anonymous": False,
348
+ "inputs": [
349
+ {
350
+ "indexed": False,
351
+ "internalType": "uint256",
352
+ "name": "arg0",
353
+ "type": "uint256",
354
+ }
355
+ ],
356
+ "name": "LogSingleArg",
357
+ "type": "event",
358
+ }
359
+ assert log_arg_event.event_name == "LogSingleArg"
360
+ assert log_arg_event.name == "LogSingleArg"
361
+ assert log_arg_event.abi_element_identifier == "LogSingleArg(uint256)"
362
+ assert await log_arg_event.get_logs() == []
363
+
364
+ filter_builder = log_arg_event.build_filter()
365
+ filter_builder.from_block = "latest"
366
+ filter_builder.to_block = "latest"
367
+ filter_builder.args.arg0.match_single(1)
368
+ filter_instance = await filter_builder.deploy(async_w3)
369
+
370
+ assert filter_instance.filter_params == {
371
+ "fromBlock": "latest",
372
+ "toBlock": "latest",
373
+ "address": async_ambiguous_event_contract.address,
374
+ "topics": (
375
+ "0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",
376
+ ),
377
+ }
378
+
379
+ log_filter = await log_arg_event.create_filter(from_block="latest")
380
+ log_entry = {
381
+ "address": async_ambiguous_event_contract.address,
382
+ "topics": (
383
+ "0x56d2ef3c5228bf5d88573621e325a4672ab50e033749a601e4f4a5e1dce905d4",
384
+ ),
385
+ "data": "0x0000000000000000000000000000000000000000000000000000000000000005",
386
+ "logIndex": 0,
387
+ "transactionIndex": 0,
388
+ "transactionHash": "0x0",
389
+ "blockHash": "0x0",
390
+ "blockNumber": 0,
391
+ }
392
+ assert log_filter.log_entry_formatter(log_entry) == {
393
+ "args": {"arg0": 5},
394
+ "event": "LogSingleArg",
395
+ "logIndex": 0,
396
+ "transactionIndex": 0,
397
+ "transactionHash": "0x0",
398
+ "address": async_ambiguous_event_contract.address,
399
+ "blockHash": "0x0",
400
+ "blockNumber": 0,
401
+ }
@@ -1,4 +1,5 @@
1
1
  import pytest
2
+ import re
2
3
  from typing import (
3
4
  cast,
4
5
  )
@@ -15,6 +16,7 @@ from hexbytes import (
15
16
  )
16
17
 
17
18
  from web3.exceptions import (
19
+ MismatchedABI,
18
20
  Web3ValueError,
19
21
  )
20
22
  from web3.utils.abi import (
@@ -101,9 +103,9 @@ map_repr = compose(list, curry(map, repr))
101
103
  map_repr,
102
104
  [
103
105
  "<Function blockHashAmphithyronVersify(uint256)>",
106
+ "<Function identity(bool)>",
104
107
  "<Function identity(uint256,bool)>",
105
108
  "<Function identity(int256,bool)>",
106
- "<Function identity(bool)>",
107
109
  ],
108
110
  ),
109
111
  (
@@ -123,9 +125,9 @@ map_repr = compose(list, curry(map, repr))
123
125
  ("identity",),
124
126
  map_repr,
125
127
  [
128
+ "<Function identity(bool)>",
126
129
  "<Function identity(uint256,bool)>",
127
130
  "<Function identity(int256,bool)>",
128
- "<Function identity(bool)>",
129
131
  ],
130
132
  ),
131
133
  (
@@ -292,6 +294,52 @@ def test_ambiguous_functions_abi_element_identifier(w3):
292
294
  assert fn_bytes32.abi_element_identifier == "isValidSignature(bytes32,bytes)"
293
295
 
294
296
 
297
+ def test_ambiguous_function_methods(ambiguous_function_contract):
298
+ is_valid_signature_func = ambiguous_function_contract.get_function_by_signature(
299
+ "isValidSignature()"
300
+ )
301
+ is_valid_signature_bytes_func = (
302
+ ambiguous_function_contract.get_function_by_signature(
303
+ "isValidSignature(bytes,bytes)"
304
+ )
305
+ )
306
+ is_valid_signature_bytes32_func = (
307
+ ambiguous_function_contract.get_function_by_signature(
308
+ "isValidSignature(bytes32,bytes)"
309
+ )
310
+ )
311
+ assert is_valid_signature_func().call() == "valid"
312
+ assert is_valid_signature_bytes_func(b"hi", b"1").call() == 1
313
+ assert (
314
+ is_valid_signature_bytes32_func(
315
+ b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # noqa: E501
316
+ b"0",
317
+ ).call()
318
+ == 0
319
+ )
320
+ assert ambiguous_function_contract.functions.isValidSignature().call() == "valid"
321
+ assert (
322
+ ambiguous_function_contract.functions.isValidSignature(b"hi", b"1").call() == 1
323
+ )
324
+
325
+
326
+ def test_ambiguous_function_methods_and_arguments(ambiguous_function_contract):
327
+ # Raises because there exists a function without arguments
328
+ # So the function that accepts a bytes32 argument is not set
329
+ # for the ContractFunctions property with just the name
330
+ with pytest.raises(
331
+ MismatchedABI,
332
+ match=re.escape(
333
+ "Found multiple elements named `isValidSignature` that accept 2 "
334
+ "argument(s)."
335
+ ),
336
+ ):
337
+ ambiguous_function_contract.functions.isValidSignature(
338
+ b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # noqa: E501
339
+ b"0",
340
+ )
341
+
342
+
295
343
  def test_contract_function_methods(string_contract):
296
344
  set_value_func = string_contract.get_function_by_signature("setValue(string)")
297
345
  get_value_func = string_contract.get_function_by_signature("getValue()")
@@ -805,11 +805,11 @@ def test_call_sending_ether_to_nonpayable_function(payable_tester_contract, call
805
805
  "function, value",
806
806
  (
807
807
  # minimum positive unambiguous value (larger than fixed8x1)
808
- ("reflect(fixed8x1)", Decimal("12.8")),
808
+ ("reflect(ufixed256x1)", Decimal("25.5")),
809
809
  # maximum value (for ufixed256x1)
810
810
  ("reflect(ufixed256x1)", Decimal(2**256 - 1) / 10),
811
811
  # maximum negative unambiguous value (less than 0 from ufixed*)
812
- ("reflect(ufixed256x1)", Decimal("-0.1")),
812
+ ("reflect(fixed8x1)", Decimal("-0.1")),
813
813
  # minimum value (for fixed8x1)
814
814
  ("reflect(fixed8x1)", Decimal("-12.8")),
815
815
  # only ufixed256x80 type supports 2-80 decimals
@@ -822,6 +822,14 @@ def test_call_sending_ether_to_nonpayable_function(payable_tester_contract, call
822
822
  ("reflect_short_u", 0),
823
823
  # maximum value (for ufixed8x1)
824
824
  ("reflect_short_u", Decimal("25.5")),
825
+ ("reflect(fixed8x1)", Decimal("12.1")),
826
+ ("reflect(fixed8x1)", Decimal(0)),
827
+ ("reflect(fixed8x1)", 0),
828
+ ("reflect(ufixed256x80)", 0),
829
+ ("reflect", Decimal("12.1")),
830
+ ("reflect", Decimal(0)),
831
+ ("reflect", 0),
832
+ ("reflect", 0),
825
833
  ),
826
834
  )
827
835
  def test_reflect_fixed_value(fixed_reflector_contract, function, value):
@@ -880,22 +888,6 @@ DEFAULT_DECIMALS = getcontext().prec
880
888
  0.1,
881
889
  "Argument 1 value `0.1` is not compatible with type `ufixed8x1`.",
882
890
  ),
883
- # ambiguous
884
- (
885
- "reflect(ufixed256x80)",
886
- Decimal("12.7"),
887
- r"Found multiple elements named `reflect` that accept 1 argument\(s\).",
888
- ),
889
- (
890
- "reflect(ufixed256x80)",
891
- Decimal(0),
892
- r"Found multiple elements named `reflect` that accept 1 argument\(s\).",
893
- ),
894
- (
895
- "reflect(ufixed256x80)",
896
- 0,
897
- r"Found multiple elements named `reflect` that accept 1 argument\(s\).",
898
- ),
899
891
  ),
900
892
  )
901
893
  def test_invalid_fixed_value_reflections(
@@ -1273,7 +1265,8 @@ def test_functions_iterator(w3, math_contract):
1273
1265
 
1274
1266
  for fn, expected_fn in zip(iter(functions_iter), all_functions):
1275
1267
  assert isinstance(fn, ContractFunction)
1276
- assert fn.fn_name == expected_fn.fn_name
1268
+ assert fn.name == expected_fn.name
1269
+ assert fn.fn_name == expected_fn.fn_name # alias for name
1277
1270
 
1278
1271
 
1279
1272
  # -- async -- #
@@ -2000,11 +1993,11 @@ async def test_async_call_sending_ether_to_nonpayable_function(
2000
1993
  "function, value",
2001
1994
  (
2002
1995
  # minimum positive unambiguous value (larger than fixed8x1)
2003
- ("reflect(fixed8x1)", Decimal("12.8")),
1996
+ ("reflect(ufixed256x1)", Decimal("25.5")),
2004
1997
  # maximum value (for ufixed256x1)
2005
1998
  ("reflect(ufixed256x1)", Decimal(2**256 - 1) / 10),
2006
1999
  # maximum negative unambiguous value (less than 0 from ufixed*)
2007
- ("reflect(ufixed256x1)", Decimal("-0.1")),
2000
+ ("reflect(fixed8x1)", Decimal("-0.1")),
2008
2001
  # minimum value (for fixed8x1)
2009
2002
  ("reflect(fixed8x1)", Decimal("-12.8")),
2010
2003
  # only ufixed256x80 type supports 2-80 decimals
@@ -2017,6 +2010,14 @@ async def test_async_call_sending_ether_to_nonpayable_function(
2017
2010
  ("reflect_short_u", 0),
2018
2011
  # maximum value (for ufixed8x1)
2019
2012
  ("reflect_short_u", Decimal("25.5")),
2013
+ ("reflect(fixed8x1)", Decimal("12.1")),
2014
+ ("reflect(fixed8x1)", Decimal(0)),
2015
+ ("reflect(fixed8x1)", 0),
2016
+ ("reflect(ufixed256x80)", 0),
2017
+ ("reflect", Decimal("12.1")),
2018
+ ("reflect", Decimal(0)),
2019
+ ("reflect", 0),
2020
+ ("reflect", 0),
2020
2021
  ),
2021
2022
  )
2022
2023
  async def test_async_reflect_fixed_value(
@@ -2059,10 +2060,6 @@ MULTIPLE_MATCHING_ELEMENTS = (
2059
2060
  ("reflect(ufixed256x80)", Decimal(1) / 10**81, MULTIPLE_MATCHING_ELEMENTS),
2060
2061
  # floats not accepted, for floating point error concerns
2061
2062
  ("reflect_short_u", 0.1, NO_MATCHING_ARGUMENTS),
2062
- # ambiguous
2063
- ("reflect(ufixed256x80)", Decimal("12.7"), MULTIPLE_MATCHING_ELEMENTS),
2064
- ("reflect(ufixed256x80)", Decimal(0), MULTIPLE_MATCHING_ELEMENTS),
2065
- ("reflect(ufixed256x80)", 0, MULTIPLE_MATCHING_ELEMENTS),
2066
2063
  ),
2067
2064
  )
2068
2065
  async def test_async_invalid_fixed_value_reflections(
@@ -2491,4 +2488,5 @@ def test_async_functions_iterator(async_w3, async_math_contract):
2491
2488
 
2492
2489
  for fn, expected_fn in zip(iter(functions_iter), all_functions):
2493
2490
  assert isinstance(fn, AsyncContractFunction)
2494
- assert fn.fn_name == expected_fn.fn_name
2491
+ assert fn.name == expected_fn.name
2492
+ assert fn.fn_name == expected_fn.fn_name # alias for name
@@ -2,9 +2,16 @@ import json
2
2
  import pytest
3
3
 
4
4
  from eth_utils import (
5
+ abi_to_signature,
5
6
  decode_hex,
7
+ filter_abi_by_type,
8
+ get_abi_input_names,
9
+ get_abi_input_types,
6
10
  )
7
11
 
12
+ from web3._utils.abi import (
13
+ get_name_from_abi_element_identifier,
14
+ )
8
15
  from web3.contract import (
9
16
  Contract,
10
17
  )
@@ -31,6 +38,7 @@ def test_class_construction_sets_class_vars(
31
38
  assert math_contract_factory.w3 == w3
32
39
  assert math_contract_factory.bytecode == decode_hex(math_contract_bytecode)
33
40
  assert math_contract_factory.bytecode_runtime == decode_hex(math_contract_runtime)
41
+ assert math_contract_factory.abi == math_contract_abi
34
42
 
35
43
 
36
44
  def test_error_to_instantiate_base_class():
@@ -79,6 +87,90 @@ def test_error_to_call_non_existent_fallback(
79
87
  math_contract.fallback.estimate_gas()
80
88
 
81
89
 
90
+ def test_contract_events_init_with_class_vars(
91
+ w3, math_contract_abi, math_contract_bytecode, math_contract_runtime
92
+ ):
93
+ math_contract = w3.eth.contract(
94
+ abi=math_contract_abi,
95
+ bytecode=math_contract_bytecode,
96
+ bytecode_runtime=math_contract_runtime,
97
+ )
98
+
99
+ for event_abi in filter_abi_by_type("event", math_contract_abi):
100
+ # Check properties of math_contract.events.EventName
101
+ event_by_name = math_contract.events[event_abi["name"]]
102
+ if event_by_name.abi["inputs"] == event_abi["inputs"]:
103
+ assert event_by_name.name == get_name_from_abi_element_identifier(
104
+ event_abi["name"]
105
+ )
106
+ assert event_by_name.abi == event_abi
107
+ assert event_by_name.abi_element_identifier == abi_to_signature(event_abi)
108
+ assert event_by_name.signature == abi_to_signature(event_abi)
109
+ assert event_by_name.argument_names == tuple(get_abi_input_names(event_abi))
110
+ assert event_by_name.argument_types == tuple(get_abi_input_types(event_abi))
111
+
112
+ # Check properties of math_contract.events._EventName(arg_names)
113
+ event_by_signature = math_contract.events[f"_{abi_to_signature(event_abi)}"]
114
+ assert event_by_signature.name == get_name_from_abi_element_identifier(
115
+ abi_to_signature(event_abi)
116
+ )
117
+ assert event_by_signature.abi == event_abi
118
+ assert event_by_signature.abi_element_identifier == abi_to_signature(event_abi)
119
+ assert event_by_signature.signature == abi_to_signature(event_abi)
120
+ assert event_by_signature.argument_names == tuple(
121
+ get_abi_input_names(event_abi)
122
+ )
123
+ assert event_by_signature.argument_types == tuple(
124
+ get_abi_input_types(event_abi)
125
+ )
126
+
127
+
128
+ def test_contract_functions_init_with_class_vars(
129
+ w3, math_contract_abi, math_contract_bytecode, math_contract_runtime
130
+ ):
131
+ math_contract = w3.eth.contract(
132
+ abi=math_contract_abi,
133
+ bytecode=math_contract_bytecode,
134
+ bytecode_runtime=math_contract_runtime,
135
+ )
136
+
137
+ for function_abi in filter_abi_by_type("function", math_contract_abi):
138
+ # Check properties of math_contract.functions.FunctionName
139
+ function_by_name = math_contract.functions[function_abi["name"]]
140
+ if function_by_name.abi["inputs"] == function_abi["inputs"]:
141
+ assert function_by_name.name == get_name_from_abi_element_identifier(
142
+ function_abi["name"]
143
+ )
144
+ assert function_by_name.abi == function_abi
145
+ assert function_by_name.abi_element_identifier == abi_to_signature(
146
+ function_abi
147
+ )
148
+ assert function_by_name.signature == abi_to_signature(function_abi)
149
+ assert function_by_name.argument_names == tuple(
150
+ get_abi_input_names(function_abi)
151
+ )
152
+ assert function_by_name.argument_types == tuple(
153
+ get_abi_input_types(function_abi)
154
+ )
155
+
156
+ # Check properties of math_contract.functions._functionName(arg_names)
157
+ function_by_signature = math_contract.functions[abi_to_signature(function_abi)]
158
+ assert function_by_signature.name == get_name_from_abi_element_identifier(
159
+ abi_to_signature(function_abi)
160
+ )
161
+ assert function_by_signature.abi == function_abi
162
+ assert function_by_signature.abi_element_identifier == abi_to_signature(
163
+ function_abi
164
+ )
165
+ assert function_by_signature.signature == abi_to_signature(function_abi)
166
+ assert function_by_signature.argument_names == tuple(
167
+ get_abi_input_names(function_abi)
168
+ )
169
+ assert function_by_signature.argument_types == tuple(
170
+ get_abi_input_types(function_abi)
171
+ )
172
+
173
+
82
174
  @pytest.mark.parametrize(
83
175
  "abi,namespace,expected_exception",
84
176
  (
@@ -1,4 +1,5 @@
1
1
  import pytest
2
+ import time
2
3
 
3
4
  from web3._utils.ens import (
4
5
  contract_ens_addresses,
@@ -75,3 +76,26 @@ def test_contract_with_name_address_changing(math_contract_factory, math_addr):
75
76
  # contract works again when name resolves correctly
76
77
  with contract_ens_addresses(mc, [("thedao.eth", math_addr)]):
77
78
  assert mc.functions.return13().call({"from": caller}) == 13
79
+
80
+
81
+ def test_init_multiple_contracts_performance(w3, emitter_contract_data):
82
+ start_time = time.time()
83
+ for _ in range(500):
84
+ w3.eth.contract(
85
+ abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
86
+ )
87
+ # assert initializing 500 contracts is within a conservative / reasonable time
88
+ assert (time.time() - start_time) < 1.5
89
+
90
+
91
+ # -- async -- #
92
+
93
+
94
+ def test_async_init_multiple_contracts_performance(async_w3, emitter_contract_data):
95
+ start_time = time.time()
96
+ for _ in range(500):
97
+ async_w3.eth.contract(
98
+ abi=emitter_contract_data["abi"], bytecode=emitter_contract_data["bytecode"]
99
+ )
100
+ # assert initializing 500 contracts is within a conservative / reasonable time
101
+ assert (time.time() - start_time) < 1.5
@@ -106,10 +106,10 @@ a32bytes = b"a".ljust(32, b"\x00")
106
106
  def test_contract_abi_decoding(w3, abi, data, method, expected):
107
107
  contract = w3.eth.contract(abi=abi)
108
108
  func, params = contract.decode_function_input(data)
109
- assert func.fn_name == method
109
+ assert func.name == method
110
110
  assert params == expected
111
111
 
112
- reinvoke_func = contract.functions[func.fn_name](**params)
112
+ reinvoke_func = contract.functions[func.name](**params)
113
113
  rebuild_txn = reinvoke_func.build_transaction(
114
114
  {"gas": 0, "nonce": 0, "to": "\x00" * 20}
115
115
  )
@@ -139,10 +139,10 @@ def test_contract_abi_decoding(w3, abi, data, method, expected):
139
139
  def test_contract_abi_encoding_kwargs(w3, abi, method, expected, data):
140
140
  contract = w3.eth.contract(abi=abi)
141
141
  func, params = contract.decode_function_input(data)
142
- assert func.fn_name == method
142
+ assert func.name == method
143
143
  assert params == expected
144
144
 
145
- reinvoke_func = contract.functions[func.fn_name](**params)
145
+ reinvoke_func = contract.functions[func.name](**params)
146
146
  rebuild_txn = reinvoke_func.build_transaction(
147
147
  {"gas": 0, "nonce": 0, "to": "\x00" * 20}
148
148
  )