web3 7.12.1__py3-none-any.whl → 7.14.0__py3-none-any.whl
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.
- ens/async_ens.py +9 -5
- ens/base_ens.py +1 -1
- ens/utils.py +2 -1
- web3/_utils/abi.py +5 -5
- web3/_utils/async_transactions.py +12 -9
- web3/_utils/batching.py +1 -1
- web3/_utils/caching/caching_utils.py +2 -2
- web3/_utils/contracts.py +5 -5
- web3/_utils/ens.py +1 -1
- web3/_utils/events.py +1 -1
- web3/_utils/module_testing/eth_module.py +133 -125
- web3/_utils/module_testing/go_ethereum_admin_module.py +7 -6
- web3/_utils/module_testing/go_ethereum_debug_module.py +5 -4
- web3/_utils/module_testing/go_ethereum_txpool_module.py +6 -3
- web3/_utils/module_testing/module_testing_utils.py +1 -1
- web3/_utils/module_testing/net_module.py +4 -3
- web3/_utils/module_testing/persistent_connection_provider.py +132 -20
- web3/_utils/module_testing/utils.py +7 -6
- web3/_utils/module_testing/web3_module.py +15 -11
- web3/_utils/normalizers.py +3 -3
- web3/_utils/transactions.py +2 -1
- web3/contract/async_contract.py +13 -13
- web3/contract/base_contract.py +11 -12
- web3/contract/utils.py +7 -7
- web3/eth/async_eth.py +3 -14
- web3/exceptions.py +8 -1
- web3/gas_strategies/time_based.py +1 -1
- web3/main.py +24 -11
- web3/manager.py +11 -13
- web3/middleware/__init__.py +1 -1
- web3/middleware/base.py +5 -5
- web3/middleware/buffered_gas_estimate.py +1 -1
- web3/middleware/filter.py +10 -9
- web3/middleware/formatting.py +11 -5
- web3/middleware/gas_price_strategy.py +1 -1
- web3/middleware/names.py +4 -4
- web3/middleware/signing.py +3 -3
- web3/middleware/stalecheck.py +2 -2
- web3/middleware/validation.py +2 -2
- web3/module.py +3 -3
- web3/providers/async_base.py +2 -2
- web3/providers/base.py +2 -2
- web3/providers/eth_tester/defaults.py +2 -2
- web3/providers/eth_tester/main.py +1 -1
- web3/providers/eth_tester/middleware.py +2 -2
- web3/providers/persistent/persistent.py +8 -7
- web3/providers/persistent/persistent_connection.py +1 -1
- web3/providers/persistent/subscription_manager.py +67 -14
- web3/providers/persistent/utils.py +1 -1
- web3/types.py +16 -3
- web3/utils/subscriptions.py +26 -4
- {web3-7.12.1.dist-info → web3-7.14.0.dist-info}/METADATA +1 -1
- {web3-7.12.1.dist-info → web3-7.14.0.dist-info}/RECORD +56 -57
- ens/specs/.DS_Store +0 -0
- {web3-7.12.1.dist-info → web3-7.14.0.dist-info}/WHEEL +0 -0
- {web3-7.12.1.dist-info → web3-7.14.0.dist-info}/licenses/LICENSE +0 -0
- {web3-7.12.1.dist-info → web3-7.14.0.dist-info}/top_level.txt +0 -0
|
@@ -130,7 +130,7 @@ if TYPE_CHECKING:
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
def abi_encoded_offchain_lookup_contract_address(
|
|
133
|
-
w3: Union["Web3", "AsyncWeb3"],
|
|
133
|
+
w3: Union["Web3", "AsyncWeb3[Any]"],
|
|
134
134
|
offchain_lookup_contract: Union["Contract", "AsyncContract"],
|
|
135
135
|
) -> HexAddress:
|
|
136
136
|
return HexAddress(
|
|
@@ -147,20 +147,20 @@ def abi_encoded_offchain_lookup_contract_address(
|
|
|
147
147
|
|
|
148
148
|
class AsyncEthModuleTest:
|
|
149
149
|
@pytest.mark.asyncio
|
|
150
|
-
async def test_eth_gas_price(self, async_w3: "AsyncWeb3") -> None:
|
|
150
|
+
async def test_eth_gas_price(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
151
151
|
gas_price = await async_w3.eth.gas_price
|
|
152
152
|
|
|
153
153
|
assert gas_price > 0
|
|
154
154
|
|
|
155
155
|
@pytest.mark.asyncio
|
|
156
|
-
async def test_is_connected(self, async_w3: "AsyncWeb3") -> None:
|
|
156
|
+
async def test_is_connected(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
157
157
|
is_connected = await async_w3.is_connected()
|
|
158
158
|
assert is_connected is True
|
|
159
159
|
|
|
160
160
|
@pytest.mark.asyncio
|
|
161
161
|
async def test_eth_send_transaction_legacy(
|
|
162
162
|
self,
|
|
163
|
-
async_w3: "AsyncWeb3",
|
|
163
|
+
async_w3: "AsyncWeb3[Any]",
|
|
164
164
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
165
165
|
) -> None:
|
|
166
166
|
txn_params: TxParams = {
|
|
@@ -182,7 +182,7 @@ class AsyncEthModuleTest:
|
|
|
182
182
|
@pytest.mark.asyncio
|
|
183
183
|
async def test_eth_modify_transaction_legacy(
|
|
184
184
|
self,
|
|
185
|
-
async_w3: "AsyncWeb3",
|
|
185
|
+
async_w3: "AsyncWeb3[Any]",
|
|
186
186
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
187
187
|
) -> None:
|
|
188
188
|
txn_params: TxParams = {
|
|
@@ -214,7 +214,7 @@ class AsyncEthModuleTest:
|
|
|
214
214
|
@pytest.mark.asyncio
|
|
215
215
|
async def test_eth_modify_transaction(
|
|
216
216
|
self,
|
|
217
|
-
async_w3: "AsyncWeb3",
|
|
217
|
+
async_w3: "AsyncWeb3[Any]",
|
|
218
218
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
219
219
|
) -> None:
|
|
220
220
|
txn_params: TxParams = {
|
|
@@ -252,7 +252,7 @@ class AsyncEthModuleTest:
|
|
|
252
252
|
@pytest.mark.asyncio
|
|
253
253
|
async def test_async_eth_sign_transaction(
|
|
254
254
|
self,
|
|
255
|
-
async_w3: "AsyncWeb3",
|
|
255
|
+
async_w3: "AsyncWeb3[Any]",
|
|
256
256
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
257
257
|
) -> None:
|
|
258
258
|
txn_params: TxParams = {
|
|
@@ -279,9 +279,9 @@ class AsyncEthModuleTest:
|
|
|
279
279
|
@pytest.mark.asyncio
|
|
280
280
|
async def test_eth_sign_typed_data(
|
|
281
281
|
self,
|
|
282
|
-
async_w3: "AsyncWeb3",
|
|
282
|
+
async_w3: "AsyncWeb3[Any]",
|
|
283
283
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
284
|
-
async_skip_if_testrpc: Callable[["AsyncWeb3"], None],
|
|
284
|
+
async_skip_if_testrpc: Callable[["AsyncWeb3[Any]"], None],
|
|
285
285
|
) -> None:
|
|
286
286
|
validJSONMessage = """
|
|
287
287
|
{
|
|
@@ -333,9 +333,9 @@ class AsyncEthModuleTest:
|
|
|
333
333
|
@pytest.mark.asyncio
|
|
334
334
|
async def test_invalid_eth_sign_typed_data(
|
|
335
335
|
self,
|
|
336
|
-
async_w3: "AsyncWeb3",
|
|
336
|
+
async_w3: "AsyncWeb3[Any]",
|
|
337
337
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
338
|
-
async_skip_if_testrpc: Callable[["AsyncWeb3"], None],
|
|
338
|
+
async_skip_if_testrpc: Callable[["AsyncWeb3[Any]"], None],
|
|
339
339
|
) -> None:
|
|
340
340
|
async_skip_if_testrpc(async_w3)
|
|
341
341
|
invalid_typed_message = """
|
|
@@ -388,7 +388,7 @@ class AsyncEthModuleTest:
|
|
|
388
388
|
|
|
389
389
|
@pytest.mark.asyncio
|
|
390
390
|
async def test_async_eth_sign_transaction_legacy(
|
|
391
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
391
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
392
392
|
) -> None:
|
|
393
393
|
txn_params: TxParams = {
|
|
394
394
|
"from": async_keyfile_account_address,
|
|
@@ -409,7 +409,7 @@ class AsyncEthModuleTest:
|
|
|
409
409
|
|
|
410
410
|
@pytest.mark.asyncio
|
|
411
411
|
async def test_async_eth_sign_transaction_hex_fees(
|
|
412
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
412
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
413
413
|
) -> None:
|
|
414
414
|
txn_params: TxParams = {
|
|
415
415
|
"from": async_keyfile_account_address,
|
|
@@ -434,7 +434,7 @@ class AsyncEthModuleTest:
|
|
|
434
434
|
|
|
435
435
|
@pytest.mark.asyncio
|
|
436
436
|
async def test_async_eth_sign_transaction_ens_names(
|
|
437
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
437
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
438
438
|
) -> None:
|
|
439
439
|
with ens_addresses(
|
|
440
440
|
async_w3, {"unlocked-account.eth": async_keyfile_account_address}
|
|
@@ -464,7 +464,7 @@ class AsyncEthModuleTest:
|
|
|
464
464
|
@pytest.mark.asyncio
|
|
465
465
|
async def test_eth_send_transaction(
|
|
466
466
|
self,
|
|
467
|
-
async_w3: "AsyncWeb3",
|
|
467
|
+
async_w3: "AsyncWeb3[Any]",
|
|
468
468
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
469
469
|
) -> None:
|
|
470
470
|
txn_params: TxParams = {
|
|
@@ -490,7 +490,7 @@ class AsyncEthModuleTest:
|
|
|
490
490
|
@pytest.mark.asyncio
|
|
491
491
|
async def test_eth_send_transaction_default_fees(
|
|
492
492
|
self,
|
|
493
|
-
async_w3: "AsyncWeb3",
|
|
493
|
+
async_w3: "AsyncWeb3[Any]",
|
|
494
494
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
495
495
|
) -> None:
|
|
496
496
|
txn_params: TxParams = {
|
|
@@ -514,7 +514,7 @@ class AsyncEthModuleTest:
|
|
|
514
514
|
@pytest.mark.asyncio
|
|
515
515
|
async def test_eth_send_transaction_hex_fees(
|
|
516
516
|
self,
|
|
517
|
-
async_w3: "AsyncWeb3",
|
|
517
|
+
async_w3: "AsyncWeb3[Any]",
|
|
518
518
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
519
519
|
) -> None:
|
|
520
520
|
txn_params: TxParams = {
|
|
@@ -538,7 +538,7 @@ class AsyncEthModuleTest:
|
|
|
538
538
|
@pytest.mark.asyncio
|
|
539
539
|
async def test_eth_send_transaction_no_gas(
|
|
540
540
|
self,
|
|
541
|
-
async_w3: "AsyncWeb3",
|
|
541
|
+
async_w3: "AsyncWeb3[Any]",
|
|
542
542
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
543
543
|
) -> None:
|
|
544
544
|
txn_params: TxParams = {
|
|
@@ -559,7 +559,7 @@ class AsyncEthModuleTest:
|
|
|
559
559
|
@pytest.mark.asyncio
|
|
560
560
|
async def test_eth_send_transaction_with_gas_price(
|
|
561
561
|
self,
|
|
562
|
-
async_w3: "AsyncWeb3",
|
|
562
|
+
async_w3: "AsyncWeb3[Any]",
|
|
563
563
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
564
564
|
) -> None:
|
|
565
565
|
txn_params: TxParams = {
|
|
@@ -577,7 +577,7 @@ class AsyncEthModuleTest:
|
|
|
577
577
|
@pytest.mark.asyncio
|
|
578
578
|
async def test_eth_send_transaction_no_priority_fee(
|
|
579
579
|
self,
|
|
580
|
-
async_w3: "AsyncWeb3",
|
|
580
|
+
async_w3: "AsyncWeb3[Any]",
|
|
581
581
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
582
582
|
) -> None:
|
|
583
583
|
txn_params: TxParams = {
|
|
@@ -595,7 +595,7 @@ class AsyncEthModuleTest:
|
|
|
595
595
|
@pytest.mark.asyncio
|
|
596
596
|
async def test_eth_send_transaction_no_max_fee(
|
|
597
597
|
self,
|
|
598
|
-
async_w3: "AsyncWeb3",
|
|
598
|
+
async_w3: "AsyncWeb3[Any]",
|
|
599
599
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
600
600
|
) -> None:
|
|
601
601
|
maxPriorityFeePerGas = async_w3.to_wei(2, "gwei")
|
|
@@ -617,7 +617,7 @@ class AsyncEthModuleTest:
|
|
|
617
617
|
@pytest.mark.asyncio
|
|
618
618
|
async def test_eth_send_transaction_max_fee_less_than_tip(
|
|
619
619
|
self,
|
|
620
|
-
async_w3: "AsyncWeb3",
|
|
620
|
+
async_w3: "AsyncWeb3[Any]",
|
|
621
621
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
622
622
|
) -> None:
|
|
623
623
|
txn_params: TxParams = {
|
|
@@ -636,7 +636,7 @@ class AsyncEthModuleTest:
|
|
|
636
636
|
@pytest.mark.asyncio
|
|
637
637
|
async def test_validation_middleware_chain_id_mismatch(
|
|
638
638
|
self,
|
|
639
|
-
async_w3: "AsyncWeb3",
|
|
639
|
+
async_w3: "AsyncWeb3[Any]",
|
|
640
640
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
641
641
|
) -> None:
|
|
642
642
|
wrong_chain_id = 1234567890
|
|
@@ -660,7 +660,7 @@ class AsyncEthModuleTest:
|
|
|
660
660
|
|
|
661
661
|
@pytest.mark.asyncio
|
|
662
662
|
async def test_ExtraDataToPOAMiddleware(
|
|
663
|
-
self, async_w3: "AsyncWeb3", request_mocker: Type[RequestMocker]
|
|
663
|
+
self, async_w3: "AsyncWeb3[Any]", request_mocker: Type[RequestMocker]
|
|
664
664
|
) -> None:
|
|
665
665
|
async_w3.middleware_onion.inject(ExtraDataToPOAMiddleware, "poa", layer=0)
|
|
666
666
|
extra_data = f"0x{'ff' * 33}"
|
|
@@ -679,7 +679,7 @@ class AsyncEthModuleTest:
|
|
|
679
679
|
|
|
680
680
|
@pytest.mark.asyncio
|
|
681
681
|
async def test_async_eth_send_raw_transaction(
|
|
682
|
-
self, async_w3: "AsyncWeb3", keyfile_account_pkey: HexStr
|
|
682
|
+
self, async_w3: "AsyncWeb3[Any]", keyfile_account_pkey: HexStr
|
|
683
683
|
) -> None:
|
|
684
684
|
keyfile_account = async_w3.eth.account.from_key(keyfile_account_pkey)
|
|
685
685
|
txn = {
|
|
@@ -699,7 +699,7 @@ class AsyncEthModuleTest:
|
|
|
699
699
|
|
|
700
700
|
@pytest.mark.asyncio
|
|
701
701
|
async def test_async_sign_and_send_raw_middleware(
|
|
702
|
-
self, async_w3: "AsyncWeb3", keyfile_account_pkey: HexStr
|
|
702
|
+
self, async_w3: "AsyncWeb3[Any]", keyfile_account_pkey: HexStr
|
|
703
703
|
) -> None:
|
|
704
704
|
keyfile_account = async_w3.eth.account.from_key(keyfile_account_pkey)
|
|
705
705
|
txn: TxParams = {
|
|
@@ -720,7 +720,7 @@ class AsyncEthModuleTest:
|
|
|
720
720
|
@pytest.mark.asyncio
|
|
721
721
|
async def test_async_sign_authorization_send_raw_and_send_set_code_transactions(
|
|
722
722
|
self,
|
|
723
|
-
async_w3: "AsyncWeb3",
|
|
723
|
+
async_w3: "AsyncWeb3[Any]",
|
|
724
724
|
keyfile_account_pkey: HexStr,
|
|
725
725
|
async_math_contract: "AsyncContract",
|
|
726
726
|
) -> None:
|
|
@@ -805,7 +805,7 @@ class AsyncEthModuleTest:
|
|
|
805
805
|
@pytest.mark.asyncio
|
|
806
806
|
async def test_GasPriceStrategyMiddleware(
|
|
807
807
|
self,
|
|
808
|
-
async_w3: "AsyncWeb3",
|
|
808
|
+
async_w3: "AsyncWeb3[Any]",
|
|
809
809
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
810
810
|
) -> None:
|
|
811
811
|
txn_params: TxParams = {
|
|
@@ -830,7 +830,7 @@ class AsyncEthModuleTest:
|
|
|
830
830
|
@pytest.mark.asyncio
|
|
831
831
|
async def test_gas_price_strategy_middleware_hex_value(
|
|
832
832
|
self,
|
|
833
|
-
async_w3: "AsyncWeb3",
|
|
833
|
+
async_w3: "AsyncWeb3[Any]",
|
|
834
834
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
835
835
|
) -> None:
|
|
836
836
|
txn_params: TxParams = {
|
|
@@ -858,7 +858,7 @@ class AsyncEthModuleTest:
|
|
|
858
858
|
)
|
|
859
859
|
async def test_gas_price_from_strategy_bypassed_for_dynamic_fee_txn(
|
|
860
860
|
self,
|
|
861
|
-
async_w3: "AsyncWeb3",
|
|
861
|
+
async_w3: "AsyncWeb3[Any]",
|
|
862
862
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
863
863
|
max_fee: Wei,
|
|
864
864
|
) -> None:
|
|
@@ -895,7 +895,7 @@ class AsyncEthModuleTest:
|
|
|
895
895
|
@pytest.mark.asyncio
|
|
896
896
|
async def test_gas_price_from_strategy_bypassed_for_dynamic_fee_txn_no_tip(
|
|
897
897
|
self,
|
|
898
|
-
async_w3: "AsyncWeb3",
|
|
898
|
+
async_w3: "AsyncWeb3[Any]",
|
|
899
899
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
900
900
|
) -> None:
|
|
901
901
|
txn_params: TxParams = {
|
|
@@ -921,7 +921,7 @@ class AsyncEthModuleTest:
|
|
|
921
921
|
@pytest.mark.asyncio
|
|
922
922
|
async def test_eth_estimate_gas(
|
|
923
923
|
self,
|
|
924
|
-
async_w3: "AsyncWeb3",
|
|
924
|
+
async_w3: "AsyncWeb3[Any]",
|
|
925
925
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
926
926
|
) -> None:
|
|
927
927
|
gas_estimate = await async_w3.eth.estimate_gas(
|
|
@@ -956,7 +956,7 @@ class AsyncEthModuleTest:
|
|
|
956
956
|
)
|
|
957
957
|
async def test_eth_estimate_gas_with_override_param_type_check(
|
|
958
958
|
self,
|
|
959
|
-
async_w3: "AsyncWeb3",
|
|
959
|
+
async_w3: "AsyncWeb3[Any]",
|
|
960
960
|
async_math_contract: "AsyncContract",
|
|
961
961
|
params: StateOverrideParams,
|
|
962
962
|
) -> None:
|
|
@@ -969,7 +969,7 @@ class AsyncEthModuleTest:
|
|
|
969
969
|
)
|
|
970
970
|
|
|
971
971
|
@pytest.mark.asyncio
|
|
972
|
-
async def test_eth_fee_history(self, async_w3: "AsyncWeb3") -> None:
|
|
972
|
+
async def test_eth_fee_history(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
973
973
|
fee_history = await async_w3.eth.fee_history(1, "latest", [50])
|
|
974
974
|
assert is_list_like(fee_history["baseFeePerGas"])
|
|
975
975
|
assert is_list_like(fee_history["gasUsedRatio"])
|
|
@@ -981,7 +981,7 @@ class AsyncEthModuleTest:
|
|
|
981
981
|
|
|
982
982
|
@pytest.mark.asyncio
|
|
983
983
|
async def test_eth_fee_history_with_integer(
|
|
984
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
984
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
985
985
|
) -> None:
|
|
986
986
|
fee_history = await async_w3.eth.fee_history(
|
|
987
987
|
1, async_empty_block["number"], [50]
|
|
@@ -996,7 +996,7 @@ class AsyncEthModuleTest:
|
|
|
996
996
|
|
|
997
997
|
@pytest.mark.asyncio
|
|
998
998
|
async def test_eth_fee_history_no_reward_percentiles(
|
|
999
|
-
self, async_w3: "AsyncWeb3"
|
|
999
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
1000
1000
|
) -> None:
|
|
1001
1001
|
fee_history = await async_w3.eth.fee_history(1, "latest")
|
|
1002
1002
|
assert is_list_like(fee_history["baseFeePerGas"])
|
|
@@ -1005,13 +1005,13 @@ class AsyncEthModuleTest:
|
|
|
1005
1005
|
assert fee_history["oldestBlock"] >= 0
|
|
1006
1006
|
|
|
1007
1007
|
@pytest.mark.asyncio
|
|
1008
|
-
async def test_eth_max_priority_fee(self, async_w3: "AsyncWeb3") -> None:
|
|
1008
|
+
async def test_eth_max_priority_fee(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1009
1009
|
max_priority_fee = await async_w3.eth.max_priority_fee
|
|
1010
1010
|
assert is_integer(max_priority_fee)
|
|
1011
1011
|
|
|
1012
1012
|
@pytest.mark.asyncio
|
|
1013
1013
|
async def test_eth_max_priority_fee_with_fee_history_calculation(
|
|
1014
|
-
self, async_w3: "AsyncWeb3", request_mocker: Type[RequestMocker]
|
|
1014
|
+
self, async_w3: "AsyncWeb3[Any]", request_mocker: Type[RequestMocker]
|
|
1015
1015
|
) -> None:
|
|
1016
1016
|
async with request_mocker(
|
|
1017
1017
|
async_w3,
|
|
@@ -1031,52 +1031,54 @@ class AsyncEthModuleTest:
|
|
|
1031
1031
|
|
|
1032
1032
|
@pytest.mark.asyncio
|
|
1033
1033
|
async def test_eth_getBlockByHash(
|
|
1034
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1034
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1035
1035
|
) -> None:
|
|
1036
1036
|
block = await async_w3.eth.get_block(async_empty_block["hash"])
|
|
1037
1037
|
assert block["hash"] == async_empty_block["hash"]
|
|
1038
1038
|
|
|
1039
1039
|
@pytest.mark.asyncio
|
|
1040
|
-
async def test_eth_getBlockByHash_not_found(
|
|
1040
|
+
async def test_eth_getBlockByHash_not_found(
|
|
1041
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
1042
|
+
) -> None:
|
|
1041
1043
|
with pytest.raises(BlockNotFound):
|
|
1042
1044
|
await async_w3.eth.get_block(UNKNOWN_HASH)
|
|
1043
1045
|
|
|
1044
1046
|
@pytest.mark.asyncio
|
|
1045
|
-
async def test_eth_getBlockByHash_pending(self, async_w3: "AsyncWeb3") -> None:
|
|
1047
|
+
async def test_eth_getBlockByHash_pending(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1046
1048
|
block = await async_w3.eth.get_block("pending")
|
|
1047
1049
|
assert block["hash"] is None
|
|
1048
1050
|
|
|
1049
1051
|
@pytest.mark.asyncio
|
|
1050
1052
|
async def test_eth_getBlockByNumber_with_integer(
|
|
1051
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1053
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1052
1054
|
) -> None:
|
|
1053
1055
|
block = await async_w3.eth.get_block(async_empty_block["number"])
|
|
1054
1056
|
assert block["number"] == async_empty_block["number"]
|
|
1055
1057
|
|
|
1056
1058
|
@pytest.mark.asyncio
|
|
1057
1059
|
async def test_eth_getBlockByNumber_latest(
|
|
1058
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1060
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1059
1061
|
) -> None:
|
|
1060
1062
|
block = await async_w3.eth.get_block("latest")
|
|
1061
1063
|
assert block["hash"] is not None
|
|
1062
1064
|
|
|
1063
1065
|
@pytest.mark.asyncio
|
|
1064
1066
|
async def test_eth_getBlockByNumber_not_found(
|
|
1065
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1067
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1066
1068
|
) -> None:
|
|
1067
1069
|
with pytest.raises(BlockNotFound):
|
|
1068
1070
|
await async_w3.eth.get_block(BlockNumber(12345))
|
|
1069
1071
|
|
|
1070
1072
|
@pytest.mark.asyncio
|
|
1071
1073
|
async def test_eth_getBlockByNumber_pending(
|
|
1072
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1074
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1073
1075
|
) -> None:
|
|
1074
1076
|
block = await async_w3.eth.get_block("pending")
|
|
1075
1077
|
assert block["hash"] is None
|
|
1076
1078
|
|
|
1077
1079
|
@pytest.mark.asyncio
|
|
1078
1080
|
async def test_eth_getBlockByNumber_earliest(
|
|
1079
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1081
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1080
1082
|
) -> None:
|
|
1081
1083
|
genesis_block = await async_w3.eth.get_block(BlockNumber(0))
|
|
1082
1084
|
block = await async_w3.eth.get_block("earliest")
|
|
@@ -1085,7 +1087,7 @@ class AsyncEthModuleTest:
|
|
|
1085
1087
|
|
|
1086
1088
|
@pytest.mark.asyncio
|
|
1087
1089
|
async def test_eth_getBlockByNumber_safe(
|
|
1088
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1090
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1089
1091
|
) -> None:
|
|
1090
1092
|
block = await async_w3.eth.get_block("safe")
|
|
1091
1093
|
assert block is not None
|
|
@@ -1093,7 +1095,7 @@ class AsyncEthModuleTest:
|
|
|
1093
1095
|
|
|
1094
1096
|
@pytest.mark.asyncio
|
|
1095
1097
|
async def test_eth_getBlockByNumber_finalized(
|
|
1096
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1098
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1097
1099
|
) -> None:
|
|
1098
1100
|
block = await async_w3.eth.get_block("finalized")
|
|
1099
1101
|
assert block is not None
|
|
@@ -1101,40 +1103,42 @@ class AsyncEthModuleTest:
|
|
|
1101
1103
|
|
|
1102
1104
|
@pytest.mark.asyncio
|
|
1103
1105
|
async def test_eth_getBlockReceipts_hash(
|
|
1104
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1106
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1105
1107
|
) -> None:
|
|
1106
1108
|
receipts = await async_w3.eth.get_block_receipts(async_empty_block["hash"])
|
|
1107
1109
|
assert isinstance(receipts, list)
|
|
1108
1110
|
|
|
1109
1111
|
@pytest.mark.asyncio
|
|
1110
|
-
async def test_eth_getBlockReceipts_not_found(
|
|
1112
|
+
async def test_eth_getBlockReceipts_not_found(
|
|
1113
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
1114
|
+
) -> None:
|
|
1111
1115
|
with pytest.raises(BlockNotFound):
|
|
1112
1116
|
await async_w3.eth.get_block_receipts(UNKNOWN_HASH)
|
|
1113
1117
|
|
|
1114
1118
|
@pytest.mark.asyncio
|
|
1115
1119
|
async def test_eth_getBlockReceipts_with_integer(
|
|
1116
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1120
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1117
1121
|
) -> None:
|
|
1118
1122
|
receipts = await async_w3.eth.get_block_receipts(async_empty_block["number"])
|
|
1119
1123
|
assert isinstance(receipts, list)
|
|
1120
1124
|
|
|
1121
1125
|
@pytest.mark.asyncio
|
|
1122
1126
|
async def test_eth_getBlockReceipts_safe(
|
|
1123
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1127
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1124
1128
|
) -> None:
|
|
1125
1129
|
receipts = await async_w3.eth.get_block_receipts("safe")
|
|
1126
1130
|
assert isinstance(receipts, list)
|
|
1127
1131
|
|
|
1128
1132
|
@pytest.mark.asyncio
|
|
1129
1133
|
async def test_eth_getBlockReceipts_finalized(
|
|
1130
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
1134
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
1131
1135
|
) -> None:
|
|
1132
1136
|
receipts = await async_w3.eth.get_block_receipts("finalized")
|
|
1133
1137
|
assert isinstance(receipts, list)
|
|
1134
1138
|
|
|
1135
1139
|
@pytest.mark.asyncio
|
|
1136
1140
|
async def test_eth_get_block_by_number_full_transactions(
|
|
1137
|
-
self, async_w3: "AsyncWeb3", async_block_with_txn: BlockData
|
|
1141
|
+
self, async_w3: "AsyncWeb3[Any]", async_block_with_txn: BlockData
|
|
1138
1142
|
) -> None:
|
|
1139
1143
|
block = await async_w3.eth.get_block(async_block_with_txn["number"], True)
|
|
1140
1144
|
transaction = cast(TxData, block["transactions"][0])
|
|
@@ -1142,14 +1146,14 @@ class AsyncEthModuleTest:
|
|
|
1142
1146
|
|
|
1143
1147
|
@pytest.mark.asyncio
|
|
1144
1148
|
async def test_eth_get_raw_transaction(
|
|
1145
|
-
self, async_w3: "AsyncWeb3", mined_txn_hash: HexStr
|
|
1149
|
+
self, async_w3: "AsyncWeb3[Any]", mined_txn_hash: HexStr
|
|
1146
1150
|
) -> None:
|
|
1147
1151
|
raw_transaction = await async_w3.eth.get_raw_transaction(mined_txn_hash)
|
|
1148
1152
|
assert is_bytes(raw_transaction)
|
|
1149
1153
|
|
|
1150
1154
|
@pytest.mark.asyncio
|
|
1151
1155
|
async def test_eth_get_raw_transaction_raises_error(
|
|
1152
|
-
self, async_w3: "AsyncWeb3"
|
|
1156
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
1153
1157
|
) -> None:
|
|
1154
1158
|
with pytest.raises(
|
|
1155
1159
|
TransactionNotFound, match=f"Transaction with hash: '{UNKNOWN_HASH}'"
|
|
@@ -1159,7 +1163,7 @@ class AsyncEthModuleTest:
|
|
|
1159
1163
|
@pytest.mark.asyncio
|
|
1160
1164
|
async def test_eth_get_raw_transaction_by_block(
|
|
1161
1165
|
self,
|
|
1162
|
-
async_w3: "AsyncWeb3",
|
|
1166
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1163
1167
|
async_block_with_txn: BlockData,
|
|
1164
1168
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
1165
1169
|
) -> None:
|
|
@@ -1200,7 +1204,9 @@ class AsyncEthModuleTest:
|
|
|
1200
1204
|
@pytest.mark.asyncio
|
|
1201
1205
|
@pytest.mark.parametrize("unknown_block_num_or_hash", (1234567899999, UNKNOWN_HASH))
|
|
1202
1206
|
async def test_eth_get_raw_transaction_by_block_raises_error(
|
|
1203
|
-
self,
|
|
1207
|
+
self,
|
|
1208
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1209
|
+
unknown_block_num_or_hash: Union[int, HexBytes],
|
|
1204
1210
|
) -> None:
|
|
1205
1211
|
with pytest.raises(
|
|
1206
1212
|
TransactionNotFound,
|
|
@@ -1216,7 +1222,7 @@ class AsyncEthModuleTest:
|
|
|
1216
1222
|
|
|
1217
1223
|
@pytest.mark.asyncio
|
|
1218
1224
|
async def test_eth_get_raw_transaction_by_block_raises_error_block_identifier(
|
|
1219
|
-
self, async_w3: "AsyncWeb3"
|
|
1225
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
1220
1226
|
) -> None:
|
|
1221
1227
|
unknown_identifier = "unknown"
|
|
1222
1228
|
with pytest.raises(
|
|
@@ -1230,7 +1236,7 @@ class AsyncEthModuleTest:
|
|
|
1230
1236
|
await async_w3.eth.get_raw_transaction_by_block(unknown_identifier, 0) # type: ignore # noqa: E501
|
|
1231
1237
|
|
|
1232
1238
|
@pytest.mark.asyncio
|
|
1233
|
-
async def test_eth_get_balance(self, async_w3: "AsyncWeb3") -> None:
|
|
1239
|
+
async def test_eth_get_balance(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1234
1240
|
accounts = await async_w3.eth.accounts
|
|
1235
1241
|
account = accounts[0]
|
|
1236
1242
|
|
|
@@ -1246,7 +1252,7 @@ class AsyncEthModuleTest:
|
|
|
1246
1252
|
|
|
1247
1253
|
@pytest.mark.asyncio
|
|
1248
1254
|
async def test_eth_get_code(
|
|
1249
|
-
self, async_w3: "AsyncWeb3", async_math_contract_address: ChecksumAddress
|
|
1255
|
+
self, async_w3: "AsyncWeb3[Any]", async_math_contract_address: ChecksumAddress
|
|
1250
1256
|
) -> None:
|
|
1251
1257
|
code = await async_w3.eth.get_code(async_math_contract_address)
|
|
1252
1258
|
assert isinstance(code, HexBytes)
|
|
@@ -1255,7 +1261,7 @@ class AsyncEthModuleTest:
|
|
|
1255
1261
|
@pytest.mark.asyncio
|
|
1256
1262
|
async def test_eth_get_code_invalid_address(
|
|
1257
1263
|
self,
|
|
1258
|
-
async_w3: "AsyncWeb3",
|
|
1264
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1259
1265
|
async_math_contract: "AsyncContract",
|
|
1260
1266
|
) -> None:
|
|
1261
1267
|
with pytest.raises(InvalidAddress):
|
|
@@ -1265,7 +1271,7 @@ class AsyncEthModuleTest:
|
|
|
1265
1271
|
|
|
1266
1272
|
@pytest.mark.asyncio
|
|
1267
1273
|
async def test_eth_get_code_with_block_identifier(
|
|
1268
|
-
self, async_w3: "AsyncWeb3", async_emitter_contract: "AsyncContract"
|
|
1274
|
+
self, async_w3: "AsyncWeb3[Any]", async_emitter_contract: "AsyncContract"
|
|
1269
1275
|
) -> None:
|
|
1270
1276
|
block_id = await async_w3.eth.block_number
|
|
1271
1277
|
code = await async_w3.eth.get_code(async_emitter_contract.address, block_id)
|
|
@@ -1275,7 +1281,7 @@ class AsyncEthModuleTest:
|
|
|
1275
1281
|
@pytest.mark.asyncio
|
|
1276
1282
|
async def test_eth_create_access_list(
|
|
1277
1283
|
self,
|
|
1278
|
-
async_w3: "AsyncWeb3",
|
|
1284
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1279
1285
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
1280
1286
|
async_math_contract: "AsyncContract",
|
|
1281
1287
|
) -> None:
|
|
@@ -1305,7 +1311,7 @@ class AsyncEthModuleTest:
|
|
|
1305
1311
|
@pytest.mark.asyncio
|
|
1306
1312
|
async def test_eth_get_transaction_count(
|
|
1307
1313
|
self,
|
|
1308
|
-
async_w3: "AsyncWeb3",
|
|
1314
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1309
1315
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
1310
1316
|
) -> None:
|
|
1311
1317
|
transaction_count = await async_w3.eth.get_transaction_count(
|
|
@@ -1316,7 +1322,7 @@ class AsyncEthModuleTest:
|
|
|
1316
1322
|
|
|
1317
1323
|
@pytest.mark.asyncio
|
|
1318
1324
|
async def test_eth_call(
|
|
1319
|
-
self, async_w3: "AsyncWeb3", async_math_contract: "AsyncContract"
|
|
1325
|
+
self, async_w3: "AsyncWeb3[Any]", async_math_contract: "AsyncContract"
|
|
1320
1326
|
) -> None:
|
|
1321
1327
|
accounts = await async_w3.eth.accounts
|
|
1322
1328
|
account = accounts[0]
|
|
@@ -1334,7 +1340,7 @@ class AsyncEthModuleTest:
|
|
|
1334
1340
|
@pytest.mark.asyncio
|
|
1335
1341
|
async def test_eth_call_with_override_code(
|
|
1336
1342
|
self,
|
|
1337
|
-
async_w3: "AsyncWeb3",
|
|
1343
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1338
1344
|
async_revert_contract: "AsyncContract",
|
|
1339
1345
|
) -> None:
|
|
1340
1346
|
accounts = await async_w3.eth.accounts
|
|
@@ -1391,7 +1397,7 @@ class AsyncEthModuleTest:
|
|
|
1391
1397
|
)
|
|
1392
1398
|
async def test_eth_call_with_override_param_type_check(
|
|
1393
1399
|
self,
|
|
1394
|
-
async_w3: "AsyncWeb3",
|
|
1400
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1395
1401
|
async_math_contract: "AsyncContract",
|
|
1396
1402
|
params: StateOverrideParams,
|
|
1397
1403
|
) -> None:
|
|
@@ -1405,7 +1411,7 @@ class AsyncEthModuleTest:
|
|
|
1405
1411
|
|
|
1406
1412
|
@pytest.mark.asyncio
|
|
1407
1413
|
async def test_eth_call_with_0_result(
|
|
1408
|
-
self, async_w3: "AsyncWeb3", async_math_contract: "AsyncContract"
|
|
1414
|
+
self, async_w3: "AsyncWeb3[Any]", async_math_contract: "AsyncContract"
|
|
1409
1415
|
) -> None:
|
|
1410
1416
|
accounts = await async_w3.eth.accounts
|
|
1411
1417
|
txn_params = async_math_contract._prepare_transaction(
|
|
@@ -1421,7 +1427,7 @@ class AsyncEthModuleTest:
|
|
|
1421
1427
|
@pytest.mark.asyncio
|
|
1422
1428
|
async def test_eth_call_revert_with_msg(
|
|
1423
1429
|
self,
|
|
1424
|
-
async_w3: "AsyncWeb3",
|
|
1430
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1425
1431
|
async_revert_contract: "AsyncContract",
|
|
1426
1432
|
async_keyfile_account_address: ChecksumAddress,
|
|
1427
1433
|
) -> None:
|
|
@@ -1440,7 +1446,7 @@ class AsyncEthModuleTest:
|
|
|
1440
1446
|
@pytest.mark.asyncio
|
|
1441
1447
|
async def test_eth_call_revert_without_msg(
|
|
1442
1448
|
self,
|
|
1443
|
-
async_w3: "AsyncWeb3",
|
|
1449
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1444
1450
|
async_revert_contract: "AsyncContract",
|
|
1445
1451
|
async_keyfile_account_address: ChecksumAddress,
|
|
1446
1452
|
) -> None:
|
|
@@ -1457,7 +1463,7 @@ class AsyncEthModuleTest:
|
|
|
1457
1463
|
@pytest.mark.asyncio
|
|
1458
1464
|
async def test_eth_call_revert_custom_error_with_msg(
|
|
1459
1465
|
self,
|
|
1460
|
-
async_w3: "AsyncWeb3",
|
|
1466
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1461
1467
|
async_revert_contract: "AsyncContract",
|
|
1462
1468
|
async_keyfile_account_address: ChecksumAddress,
|
|
1463
1469
|
) -> None:
|
|
@@ -1478,7 +1484,7 @@ class AsyncEthModuleTest:
|
|
|
1478
1484
|
@pytest.mark.asyncio
|
|
1479
1485
|
async def test_eth_call_revert_custom_error_without_msg(
|
|
1480
1486
|
self,
|
|
1481
|
-
async_w3: "AsyncWeb3",
|
|
1487
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1482
1488
|
async_revert_contract: "AsyncContract",
|
|
1483
1489
|
async_keyfile_account_address: ChecksumAddress,
|
|
1484
1490
|
) -> None:
|
|
@@ -1510,7 +1516,7 @@ class AsyncEthModuleTest:
|
|
|
1510
1516
|
@pytest.mark.asyncio
|
|
1511
1517
|
async def test_contract_panic_errors(
|
|
1512
1518
|
self,
|
|
1513
|
-
async_w3: "AsyncWeb3",
|
|
1519
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1514
1520
|
async_panic_errors_contract: "AsyncContract",
|
|
1515
1521
|
panic_error: str,
|
|
1516
1522
|
params: List[Any],
|
|
@@ -1527,7 +1533,7 @@ class AsyncEthModuleTest:
|
|
|
1527
1533
|
@pytest.mark.asyncio
|
|
1528
1534
|
async def test_eth_call_offchain_lookup(
|
|
1529
1535
|
self,
|
|
1530
|
-
async_w3: "AsyncWeb3",
|
|
1536
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1531
1537
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1532
1538
|
async_keyfile_account_address: ChecksumAddress,
|
|
1533
1539
|
monkeypatch: "MonkeyPatch",
|
|
@@ -1553,7 +1559,7 @@ class AsyncEthModuleTest:
|
|
|
1553
1559
|
@pytest.mark.asyncio
|
|
1554
1560
|
async def test_eth_call_offchain_lookup_raises_when_ccip_read_is_disabled(
|
|
1555
1561
|
self,
|
|
1556
|
-
async_w3: "AsyncWeb3",
|
|
1562
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1557
1563
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1558
1564
|
) -> None:
|
|
1559
1565
|
return_data = (
|
|
@@ -1591,7 +1597,7 @@ class AsyncEthModuleTest:
|
|
|
1591
1597
|
@pytest.mark.asyncio
|
|
1592
1598
|
async def test_eth_call_offchain_lookup_call_flag_overrides_provider_flag(
|
|
1593
1599
|
self,
|
|
1594
|
-
async_w3: "AsyncWeb3",
|
|
1600
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1595
1601
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1596
1602
|
async_keyfile_account_address: ChecksumAddress,
|
|
1597
1603
|
monkeypatch: "MonkeyPatch",
|
|
@@ -1619,7 +1625,7 @@ class AsyncEthModuleTest:
|
|
|
1619
1625
|
@pytest.mark.parametrize("max_redirects", range(-1, 4))
|
|
1620
1626
|
async def test_eth_call_offchain_lookup_raises_if_max_redirects_is_less_than_4(
|
|
1621
1627
|
self,
|
|
1622
|
-
async_w3: "AsyncWeb3",
|
|
1628
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1623
1629
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1624
1630
|
max_redirects: int,
|
|
1625
1631
|
) -> None:
|
|
@@ -1636,7 +1642,7 @@ class AsyncEthModuleTest:
|
|
|
1636
1642
|
@pytest.mark.asyncio
|
|
1637
1643
|
async def test_eth_call_offchain_lookup_raises_for_improperly_formatted_rest_request_response( # noqa: E501
|
|
1638
1644
|
self,
|
|
1639
|
-
async_w3: "AsyncWeb3",
|
|
1645
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1640
1646
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1641
1647
|
async_keyfile_account_address: ChecksumAddress,
|
|
1642
1648
|
monkeypatch: "MonkeyPatch",
|
|
@@ -1660,7 +1666,7 @@ class AsyncEthModuleTest:
|
|
|
1660
1666
|
@pytest.mark.parametrize("status_code_non_4xx_error", [100, 300, 500, 600])
|
|
1661
1667
|
async def test_eth_call_offchain_lookup_tries_next_url_for_non_4xx_error_status_and_tests_POST( # noqa: E501
|
|
1662
1668
|
self,
|
|
1663
|
-
async_w3: "AsyncWeb3",
|
|
1669
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1664
1670
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1665
1671
|
async_keyfile_account_address: ChecksumAddress,
|
|
1666
1672
|
monkeypatch: "MonkeyPatch",
|
|
@@ -1698,7 +1704,7 @@ class AsyncEthModuleTest:
|
|
|
1698
1704
|
@pytest.mark.asyncio
|
|
1699
1705
|
async def test_eth_call_offchain_lookup_calls_raise_for_status_for_4xx_status_code(
|
|
1700
1706
|
self,
|
|
1701
|
-
async_w3: "AsyncWeb3",
|
|
1707
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1702
1708
|
async_offchain_lookup_contract: "AsyncContract",
|
|
1703
1709
|
async_keyfile_account_address: ChecksumAddress,
|
|
1704
1710
|
monkeypatch: "MonkeyPatch",
|
|
@@ -1749,7 +1755,7 @@ class AsyncEthModuleTest:
|
|
|
1749
1755
|
await async_offchain_lookup_contract.caller().continuousOffchainLookup() # noqa: E501 type: ignore
|
|
1750
1756
|
|
|
1751
1757
|
@pytest.mark.asyncio
|
|
1752
|
-
async def test_eth_simulate_v1(self, async_w3: "AsyncWeb3") -> None:
|
|
1758
|
+
async def test_eth_simulate_v1(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1753
1759
|
simulate_result = await async_w3.eth.simulate_v1(
|
|
1754
1760
|
{
|
|
1755
1761
|
"blockStateCalls": [
|
|
@@ -1795,7 +1801,7 @@ class AsyncEthModuleTest:
|
|
|
1795
1801
|
assert call_entry["gasUsed"] == int("0x5208", 16)
|
|
1796
1802
|
|
|
1797
1803
|
@pytest.mark.asyncio
|
|
1798
|
-
async def test_async_eth_chain_id(self, async_w3: "AsyncWeb3") -> None:
|
|
1804
|
+
async def test_async_eth_chain_id(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1799
1805
|
chain_id = await async_w3.eth.chain_id
|
|
1800
1806
|
# chain id value from geth fixture genesis file
|
|
1801
1807
|
assert chain_id == 131277322940537
|
|
@@ -1803,7 +1809,7 @@ class AsyncEthModuleTest:
|
|
|
1803
1809
|
@pytest.mark.asyncio
|
|
1804
1810
|
async def test_async_eth_get_transaction_receipt_mined(
|
|
1805
1811
|
self,
|
|
1806
|
-
async_w3: "AsyncWeb3",
|
|
1812
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1807
1813
|
async_block_with_txn: BlockData,
|
|
1808
1814
|
mined_txn_hash: HexStr,
|
|
1809
1815
|
) -> None:
|
|
@@ -1824,7 +1830,7 @@ class AsyncEthModuleTest:
|
|
|
1824
1830
|
@pytest.mark.asyncio
|
|
1825
1831
|
async def test_async_eth_get_transaction_receipt_unmined(
|
|
1826
1832
|
self,
|
|
1827
|
-
async_w3: "AsyncWeb3",
|
|
1833
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1828
1834
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
1829
1835
|
) -> None:
|
|
1830
1836
|
txn_hash = await async_w3.eth.send_transaction(
|
|
@@ -1843,7 +1849,7 @@ class AsyncEthModuleTest:
|
|
|
1843
1849
|
@pytest.mark.asyncio
|
|
1844
1850
|
async def test_async_eth_get_transaction_receipt_with_log_entry(
|
|
1845
1851
|
self,
|
|
1846
|
-
async_w3: "AsyncWeb3",
|
|
1852
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1847
1853
|
async_block_with_txn_with_log: BlockData,
|
|
1848
1854
|
async_emitter_contract: "AsyncContract",
|
|
1849
1855
|
txn_hash_with_log: HexStr,
|
|
@@ -1868,7 +1874,7 @@ class AsyncEthModuleTest:
|
|
|
1868
1874
|
@pytest.mark.asyncio
|
|
1869
1875
|
async def test_async_eth_wait_for_transaction_receipt_mined(
|
|
1870
1876
|
self,
|
|
1871
|
-
async_w3: "AsyncWeb3",
|
|
1877
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1872
1878
|
async_block_with_txn: BlockData,
|
|
1873
1879
|
mined_txn_hash: HexStr,
|
|
1874
1880
|
) -> None:
|
|
@@ -1893,7 +1899,7 @@ class AsyncEthModuleTest:
|
|
|
1893
1899
|
)
|
|
1894
1900
|
async def test_async_eth_wait_for_transaction_receipt_unmined(
|
|
1895
1901
|
self,
|
|
1896
|
-
async_w3: "AsyncWeb3",
|
|
1902
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1897
1903
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
1898
1904
|
) -> None:
|
|
1899
1905
|
txn_hash = await async_w3.eth.send_transaction(
|
|
@@ -1916,7 +1922,7 @@ class AsyncEthModuleTest:
|
|
|
1916
1922
|
@pytest.mark.asyncio
|
|
1917
1923
|
async def test_async_eth_wait_for_transaction_receipt_with_log_entry(
|
|
1918
1924
|
self,
|
|
1919
|
-
async_w3: "AsyncWeb3",
|
|
1925
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1920
1926
|
async_block_with_txn_with_log: BlockData,
|
|
1921
1927
|
async_emitter_contract: "AsyncContract",
|
|
1922
1928
|
txn_hash_with_log: HexStr,
|
|
@@ -1939,21 +1945,21 @@ class AsyncEthModuleTest:
|
|
|
1939
1945
|
assert log_entry["transactionHash"] == HexBytes(txn_hash_with_log)
|
|
1940
1946
|
|
|
1941
1947
|
@pytest.mark.asyncio
|
|
1942
|
-
async def test_async_eth_accounts(self, async_w3: "AsyncWeb3") -> None:
|
|
1948
|
+
async def test_async_eth_accounts(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1943
1949
|
accounts = await async_w3.eth.accounts
|
|
1944
1950
|
assert is_list_like(accounts)
|
|
1945
1951
|
assert len(accounts) != 0
|
|
1946
1952
|
assert all(is_checksum_address(account) for account in accounts)
|
|
1947
1953
|
|
|
1948
1954
|
@pytest.mark.asyncio
|
|
1949
|
-
async def test_async_eth_blob_base_fee(self, async_w3: "AsyncWeb3") -> None:
|
|
1955
|
+
async def test_async_eth_blob_base_fee(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
1950
1956
|
blob_base_fee = await async_w3.eth.blob_base_fee
|
|
1951
1957
|
assert is_integer(blob_base_fee)
|
|
1952
1958
|
assert blob_base_fee >= 0
|
|
1953
1959
|
|
|
1954
1960
|
@pytest.mark.asyncio
|
|
1955
1961
|
async def test_async_eth_get_logs_without_logs(
|
|
1956
|
-
self, async_w3: "AsyncWeb3", async_block_with_txn_with_log: BlockData
|
|
1962
|
+
self, async_w3: "AsyncWeb3[Any]", async_block_with_txn_with_log: BlockData
|
|
1957
1963
|
) -> None:
|
|
1958
1964
|
# Test with block range
|
|
1959
1965
|
|
|
@@ -1995,7 +2001,7 @@ class AsyncEthModuleTest:
|
|
|
1995
2001
|
@pytest.mark.asyncio
|
|
1996
2002
|
async def test_async_eth_get_logs_with_logs(
|
|
1997
2003
|
self,
|
|
1998
|
-
async_w3: "AsyncWeb3",
|
|
2004
|
+
async_w3: "AsyncWeb3[Any]",
|
|
1999
2005
|
async_block_with_txn_with_log: BlockData,
|
|
2000
2006
|
async_emitter_contract_address: ChecksumAddress,
|
|
2001
2007
|
txn_hash_with_log: HexStr,
|
|
@@ -2045,7 +2051,7 @@ class AsyncEthModuleTest:
|
|
|
2045
2051
|
@pytest.mark.asyncio
|
|
2046
2052
|
async def test_async_eth_get_logs_with_logs_topic_args(
|
|
2047
2053
|
self,
|
|
2048
|
-
async_w3: "AsyncWeb3",
|
|
2054
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2049
2055
|
async_block_with_txn_with_log: BlockData,
|
|
2050
2056
|
async_emitter_contract_address: ChecksumAddress,
|
|
2051
2057
|
txn_hash_with_log: HexStr,
|
|
@@ -2090,7 +2096,7 @@ class AsyncEthModuleTest:
|
|
|
2090
2096
|
|
|
2091
2097
|
@pytest.mark.asyncio
|
|
2092
2098
|
async def test_async_eth_get_logs_with_logs_none_topic_args(
|
|
2093
|
-
self, async_w3: "AsyncWeb3"
|
|
2099
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
2094
2100
|
) -> None:
|
|
2095
2101
|
# Test with None overflowing
|
|
2096
2102
|
filter_params: FilterParams = {
|
|
@@ -2101,7 +2107,7 @@ class AsyncEthModuleTest:
|
|
|
2101
2107
|
assert len(result) == 0
|
|
2102
2108
|
|
|
2103
2109
|
@pytest.mark.asyncio
|
|
2104
|
-
async def test_async_eth_syncing(self, async_w3: "AsyncWeb3") -> None:
|
|
2110
|
+
async def test_async_eth_syncing(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
2105
2111
|
syncing = await async_w3.eth.syncing
|
|
2106
2112
|
|
|
2107
2113
|
assert is_boolean(syncing) or is_dict(syncing)
|
|
@@ -2120,7 +2126,7 @@ class AsyncEthModuleTest:
|
|
|
2120
2126
|
|
|
2121
2127
|
@pytest.mark.asyncio
|
|
2122
2128
|
async def test_async_eth_get_storage_at(
|
|
2123
|
-
self, async_w3: "AsyncWeb3", async_storage_contract: "AsyncContract"
|
|
2129
|
+
self, async_w3: "AsyncWeb3[Any]", async_storage_contract: "AsyncContract"
|
|
2124
2130
|
) -> None:
|
|
2125
2131
|
async_storage_contract_address = async_storage_contract.address
|
|
2126
2132
|
|
|
@@ -2147,7 +2153,7 @@ class AsyncEthModuleTest:
|
|
|
2147
2153
|
|
|
2148
2154
|
@pytest.mark.asyncio
|
|
2149
2155
|
async def test_async_eth_get_storage_at_ens_name(
|
|
2150
|
-
self, async_w3: "AsyncWeb3", async_storage_contract: "AsyncContract"
|
|
2156
|
+
self, async_w3: "AsyncWeb3[Any]", async_storage_contract: "AsyncContract"
|
|
2151
2157
|
) -> None:
|
|
2152
2158
|
with ens_addresses(async_w3, {"storage.eth": async_storage_contract.address}):
|
|
2153
2159
|
storage = await async_w3.eth.get_storage_at(ENS("storage.eth"), 1)
|
|
@@ -2155,7 +2161,7 @@ class AsyncEthModuleTest:
|
|
|
2155
2161
|
|
|
2156
2162
|
@pytest.mark.asyncio
|
|
2157
2163
|
async def test_async_eth_get_storage_at_invalid_address(
|
|
2158
|
-
self, async_w3: "AsyncWeb3"
|
|
2164
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
2159
2165
|
) -> None:
|
|
2160
2166
|
accounts = await async_w3.eth.accounts
|
|
2161
2167
|
with pytest.raises(InvalidAddress):
|
|
@@ -2165,7 +2171,7 @@ class AsyncEthModuleTest:
|
|
|
2165
2171
|
|
|
2166
2172
|
def test_async_provider_default_account(
|
|
2167
2173
|
self,
|
|
2168
|
-
async_w3: "AsyncWeb3",
|
|
2174
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2169
2175
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2170
2176
|
) -> None:
|
|
2171
2177
|
current_default_account = async_w3.eth.default_account
|
|
@@ -2180,7 +2186,7 @@ class AsyncEthModuleTest:
|
|
|
2180
2186
|
|
|
2181
2187
|
def test_async_provider_default_block(
|
|
2182
2188
|
self,
|
|
2183
|
-
async_w3: "AsyncWeb3",
|
|
2189
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2184
2190
|
) -> None:
|
|
2185
2191
|
# check defaults to 'latest'
|
|
2186
2192
|
default_block = async_w3.eth.default_block
|
|
@@ -2196,7 +2202,7 @@ class AsyncEthModuleTest:
|
|
|
2196
2202
|
|
|
2197
2203
|
@pytest.mark.asyncio
|
|
2198
2204
|
async def test_eth_getBlockTransactionCountByHash_async_empty_block(
|
|
2199
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
2205
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
2200
2206
|
) -> None:
|
|
2201
2207
|
transaction_count = await async_w3.eth.get_block_transaction_count(
|
|
2202
2208
|
async_empty_block["hash"]
|
|
@@ -2207,7 +2213,7 @@ class AsyncEthModuleTest:
|
|
|
2207
2213
|
|
|
2208
2214
|
@pytest.mark.asyncio
|
|
2209
2215
|
async def test_eth_getBlockTransactionCountByNumber_async_empty_block(
|
|
2210
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
2216
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
2211
2217
|
) -> None:
|
|
2212
2218
|
transaction_count = await async_w3.eth.get_block_transaction_count(
|
|
2213
2219
|
async_empty_block["number"]
|
|
@@ -2218,7 +2224,7 @@ class AsyncEthModuleTest:
|
|
|
2218
2224
|
|
|
2219
2225
|
@pytest.mark.asyncio
|
|
2220
2226
|
async def test_eth_getBlockTransactionCountByHash_block_with_txn(
|
|
2221
|
-
self, async_w3: "AsyncWeb3", async_block_with_txn: BlockData
|
|
2227
|
+
self, async_w3: "AsyncWeb3[Any]", async_block_with_txn: BlockData
|
|
2222
2228
|
) -> None:
|
|
2223
2229
|
transaction_count = await async_w3.eth.get_block_transaction_count(
|
|
2224
2230
|
async_block_with_txn["hash"]
|
|
@@ -2229,7 +2235,7 @@ class AsyncEthModuleTest:
|
|
|
2229
2235
|
|
|
2230
2236
|
@pytest.mark.asyncio
|
|
2231
2237
|
async def test_eth_getUncleCountByBlockHash(
|
|
2232
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
2238
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
2233
2239
|
) -> None:
|
|
2234
2240
|
with pytest.warns(
|
|
2235
2241
|
DeprecationWarning,
|
|
@@ -2243,7 +2249,7 @@ class AsyncEthModuleTest:
|
|
|
2243
2249
|
|
|
2244
2250
|
@pytest.mark.asyncio
|
|
2245
2251
|
async def test_eth_getUncleCountByBlockNumber(
|
|
2246
|
-
self, async_w3: "AsyncWeb3", async_empty_block: BlockData
|
|
2252
|
+
self, async_w3: "AsyncWeb3[Any]", async_empty_block: BlockData
|
|
2247
2253
|
) -> None:
|
|
2248
2254
|
with pytest.warns(
|
|
2249
2255
|
DeprecationWarning,
|
|
@@ -2259,7 +2265,7 @@ class AsyncEthModuleTest:
|
|
|
2259
2265
|
|
|
2260
2266
|
@pytest.mark.asyncio
|
|
2261
2267
|
async def test_eth_getBlockTransactionCountByNumber_block_with_txn(
|
|
2262
|
-
self, async_w3: "AsyncWeb3", async_block_with_txn: BlockData
|
|
2268
|
+
self, async_w3: "AsyncWeb3[Any]", async_block_with_txn: BlockData
|
|
2263
2269
|
) -> None:
|
|
2264
2270
|
transaction_count = await async_w3.eth.get_block_transaction_count(
|
|
2265
2271
|
async_block_with_txn["number"]
|
|
@@ -2271,7 +2277,7 @@ class AsyncEthModuleTest:
|
|
|
2271
2277
|
@pytest.mark.asyncio
|
|
2272
2278
|
async def test_async_eth_sign(
|
|
2273
2279
|
self,
|
|
2274
|
-
async_w3: "AsyncWeb3",
|
|
2280
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2275
2281
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2276
2282
|
) -> None:
|
|
2277
2283
|
signature = await async_w3.eth.sign(
|
|
@@ -2311,7 +2317,7 @@ class AsyncEthModuleTest:
|
|
|
2311
2317
|
@pytest.mark.asyncio
|
|
2312
2318
|
async def test_async_eth_sign_ens_names(
|
|
2313
2319
|
self,
|
|
2314
|
-
async_w3: "AsyncWeb3",
|
|
2320
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2315
2321
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2316
2322
|
) -> None:
|
|
2317
2323
|
with ens_addresses(
|
|
@@ -2326,7 +2332,7 @@ class AsyncEthModuleTest:
|
|
|
2326
2332
|
@pytest.mark.asyncio
|
|
2327
2333
|
async def test_async_eth_replace_transaction_legacy(
|
|
2328
2334
|
self,
|
|
2329
|
-
async_w3: "AsyncWeb3",
|
|
2335
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2330
2336
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2331
2337
|
) -> None:
|
|
2332
2338
|
txn_params: TxParams = {
|
|
@@ -2355,7 +2361,7 @@ class AsyncEthModuleTest:
|
|
|
2355
2361
|
@pytest.mark.asyncio
|
|
2356
2362
|
async def test_async_eth_replace_transaction(
|
|
2357
2363
|
self,
|
|
2358
|
-
async_w3: "AsyncWeb3",
|
|
2364
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2359
2365
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2360
2366
|
) -> None:
|
|
2361
2367
|
two_gwei_in_wei = async_w3.to_wei(2, "gwei")
|
|
@@ -2391,7 +2397,7 @@ class AsyncEthModuleTest:
|
|
|
2391
2397
|
@pytest.mark.asyncio
|
|
2392
2398
|
async def test_async_eth_replace_transaction_underpriced(
|
|
2393
2399
|
self,
|
|
2394
|
-
async_w3: "AsyncWeb3",
|
|
2400
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2395
2401
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2396
2402
|
) -> None:
|
|
2397
2403
|
# Note: `underpriced transaction` error is only consistent with
|
|
@@ -2417,7 +2423,7 @@ class AsyncEthModuleTest:
|
|
|
2417
2423
|
@pytest.mark.asyncio
|
|
2418
2424
|
async def test_async_eth_replace_transaction_non_existing_transaction(
|
|
2419
2425
|
self,
|
|
2420
|
-
async_w3: "AsyncWeb3",
|
|
2426
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2421
2427
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2422
2428
|
) -> None:
|
|
2423
2429
|
txn_params: TxParams = {
|
|
@@ -2439,7 +2445,7 @@ class AsyncEthModuleTest:
|
|
|
2439
2445
|
@pytest.mark.asyncio
|
|
2440
2446
|
async def test_async_eth_replace_transaction_already_mined(
|
|
2441
2447
|
self,
|
|
2442
|
-
async_w3: "AsyncWeb3",
|
|
2448
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2443
2449
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2444
2450
|
) -> None:
|
|
2445
2451
|
txn_params: TxParams = {
|
|
@@ -2460,7 +2466,7 @@ class AsyncEthModuleTest:
|
|
|
2460
2466
|
|
|
2461
2467
|
@pytest.mark.asyncio
|
|
2462
2468
|
async def test_async_eth_replace_transaction_incorrect_nonce(
|
|
2463
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
2469
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
2464
2470
|
) -> None:
|
|
2465
2471
|
txn_params: TxParams = {
|
|
2466
2472
|
"from": async_keyfile_account_address,
|
|
@@ -2482,7 +2488,7 @@ class AsyncEthModuleTest:
|
|
|
2482
2488
|
@pytest.mark.asyncio
|
|
2483
2489
|
async def test_async_eth_replace_transaction_gas_price_too_low(
|
|
2484
2490
|
self,
|
|
2485
|
-
async_w3: "AsyncWeb3",
|
|
2491
|
+
async_w3: "AsyncWeb3[Any]",
|
|
2486
2492
|
async_keyfile_account_address_dual_type: ChecksumAddress,
|
|
2487
2493
|
) -> None:
|
|
2488
2494
|
txn_params: TxParams = {
|
|
@@ -2500,7 +2506,7 @@ class AsyncEthModuleTest:
|
|
|
2500
2506
|
|
|
2501
2507
|
@pytest.mark.asyncio
|
|
2502
2508
|
async def test_async_eth_replace_transaction_gas_price_defaulting_minimum(
|
|
2503
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
2509
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
2504
2510
|
) -> None:
|
|
2505
2511
|
gas_price = async_w3.to_wei(1, "gwei")
|
|
2506
2512
|
|
|
@@ -2523,7 +2529,7 @@ class AsyncEthModuleTest:
|
|
|
2523
2529
|
|
|
2524
2530
|
@pytest.mark.asyncio
|
|
2525
2531
|
async def test_async_eth_replace_transaction_gas_price_defaulting_strategy_higher(
|
|
2526
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
2532
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
2527
2533
|
) -> None:
|
|
2528
2534
|
txn_params: TxParams = {
|
|
2529
2535
|
"from": async_keyfile_account_address,
|
|
@@ -2536,7 +2542,9 @@ class AsyncEthModuleTest:
|
|
|
2536
2542
|
|
|
2537
2543
|
two_gwei_in_wei = async_w3.to_wei(2, "gwei")
|
|
2538
2544
|
|
|
2539
|
-
def higher_gas_price_strategy(
|
|
2545
|
+
def higher_gas_price_strategy(
|
|
2546
|
+
_async_w3: "AsyncWeb3[Any]", _txn: TxParams
|
|
2547
|
+
) -> Wei:
|
|
2540
2548
|
return two_gwei_in_wei
|
|
2541
2549
|
|
|
2542
2550
|
async_w3.eth.set_gas_price_strategy(higher_gas_price_strategy)
|
|
@@ -2551,7 +2559,7 @@ class AsyncEthModuleTest:
|
|
|
2551
2559
|
|
|
2552
2560
|
@pytest.mark.asyncio
|
|
2553
2561
|
async def test_async_eth_replace_transaction_gas_price_defaulting_strategy_lower(
|
|
2554
|
-
self, async_w3: "AsyncWeb3", async_keyfile_account_address: ChecksumAddress
|
|
2562
|
+
self, async_w3: "AsyncWeb3[Any]", async_keyfile_account_address: ChecksumAddress
|
|
2555
2563
|
) -> None:
|
|
2556
2564
|
gas_price = async_w3.to_wei(2, "gwei")
|
|
2557
2565
|
txn_params: TxParams = {
|
|
@@ -2563,7 +2571,7 @@ class AsyncEthModuleTest:
|
|
|
2563
2571
|
}
|
|
2564
2572
|
txn_hash = await async_w3.eth.send_transaction(txn_params)
|
|
2565
2573
|
|
|
2566
|
-
def lower_gas_price_strategy(async_w3: "AsyncWeb3", txn: TxParams) -> Wei:
|
|
2574
|
+
def lower_gas_price_strategy(async_w3: "AsyncWeb3[Any]", txn: TxParams) -> Wei:
|
|
2567
2575
|
return async_w3.to_wei(1, "gwei")
|
|
2568
2576
|
|
|
2569
2577
|
async_w3.eth.set_gas_price_strategy(lower_gas_price_strategy)
|
|
@@ -2576,7 +2584,7 @@ class AsyncEthModuleTest:
|
|
|
2576
2584
|
async_w3.eth.set_gas_price_strategy(None) # reset strategy
|
|
2577
2585
|
|
|
2578
2586
|
@pytest.mark.asyncio
|
|
2579
|
-
async def test_async_eth_new_filter(self, async_w3: "AsyncWeb3") -> None:
|
|
2587
|
+
async def test_async_eth_new_filter(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
2580
2588
|
filter = await async_w3.eth.filter({})
|
|
2581
2589
|
|
|
2582
2590
|
changes = await async_w3.eth.get_filter_changes(filter.filter_id)
|
|
@@ -2591,7 +2599,7 @@ class AsyncEthModuleTest:
|
|
|
2591
2599
|
assert result is True
|
|
2592
2600
|
|
|
2593
2601
|
@pytest.mark.asyncio
|
|
2594
|
-
async def test_async_eth_new_block_filter(self, async_w3: "AsyncWeb3") -> None:
|
|
2602
|
+
async def test_async_eth_new_block_filter(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
2595
2603
|
filter = await async_w3.eth.filter("latest")
|
|
2596
2604
|
assert is_string(filter.filter_id)
|
|
2597
2605
|
|
|
@@ -2603,7 +2611,7 @@ class AsyncEthModuleTest:
|
|
|
2603
2611
|
|
|
2604
2612
|
@pytest.mark.asyncio
|
|
2605
2613
|
async def test_async_eth_new_pending_transaction_filter(
|
|
2606
|
-
self, async_w3: "AsyncWeb3"
|
|
2614
|
+
self, async_w3: "AsyncWeb3[Any]"
|
|
2607
2615
|
) -> None:
|
|
2608
2616
|
filter = await async_w3.eth.filter("pending")
|
|
2609
2617
|
assert is_string(filter.filter_id)
|
|
@@ -2616,7 +2624,7 @@ class AsyncEthModuleTest:
|
|
|
2616
2624
|
assert result is True
|
|
2617
2625
|
|
|
2618
2626
|
@pytest.mark.asyncio
|
|
2619
|
-
async def test_async_eth_uninstall_filter(self, async_w3: "AsyncWeb3") -> None:
|
|
2627
|
+
async def test_async_eth_uninstall_filter(self, async_w3: "AsyncWeb3[Any]") -> None:
|
|
2620
2628
|
filter = await async_w3.eth.filter({})
|
|
2621
2629
|
assert is_string(filter.filter_id)
|
|
2622
2630
|
|