Skip to content

Commit 18ad64d

Browse files
committed
apply same changes to async_eth
1 parent a069de7 commit 18ad64d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

web3/_utils/module_testing/eth_module.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ async def test_eth_modify_transaction_legacy(
220220
txn_hash = await async_w3.eth.send_transaction(txn_params)
221221

222222
modified_txn_hash = await async_w3.eth.modify_transaction(
223-
txn_hash, gasPrice=(cast(int, txn_params["gasPrice"]) * 2), value=2
223+
txn_hash, gasPrice=(cast(Wei, txn_params["gasPrice"] * 2)), value=Wei(2)
224224
)
225225
modified_txn = await async_w3.eth.get_transaction(modified_txn_hash)
226226

@@ -252,9 +252,9 @@ async def test_eth_modify_transaction(
252252

253253
modified_txn_hash = await async_w3.eth.modify_transaction(
254254
txn_hash,
255-
value=2,
256-
maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"]) * 2),
257-
maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"]) * 2),
255+
value=Wei(2),
256+
maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"] * 2)),
257+
maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"] * 2)),
258258
)
259259
modified_txn = await async_w3.eth.get_transaction(modified_txn_hash)
260260

web3/eth/async_eth.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
from web3._utils.blocks import (
3636
select_method_for_block_identifier,
3737
)
38+
from web3._utils.compat import (
39+
Unpack,
40+
)
3841
from web3._utils.fee_utils import (
3942
async_fee_history_priority_fee,
4043
)
@@ -594,10 +597,8 @@ async def replace_transaction(
594597
self.w3, current_transaction, new_transaction
595598
)
596599

597-
# todo: Update Any to stricter kwarg checking with TxParams
598-
# https://github.com/python/mypy/issues/4441
599600
async def modify_transaction(
600-
self, transaction_hash: _Hash32, **transaction_params: Any
601+
self, transaction_hash: _Hash32, **transaction_params: Unpack[TxParams]
601602
) -> HexBytes:
602603
assert_valid_transaction_params(cast(TxParams, transaction_params))
603604

0 commit comments

Comments
 (0)