Skip to content

Commit

Permalink
apply same changes to async_eth
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed May 3, 2024
1 parent 46360ad commit 0dd913f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions web3/_utils/module_testing/eth_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def test_eth_modify_transaction_legacy(
txn_hash = await async_w3.eth.send_transaction(txn_params)

modified_txn_hash = await async_w3.eth.modify_transaction(
txn_hash, gasPrice=(cast(int, txn_params["gasPrice"]) * 2), value=2
txn_hash, gasPrice=(cast(Wei, txn_params["gasPrice"] * 2)), value=Wei(2)
)
modified_txn = await async_w3.eth.get_transaction(modified_txn_hash)

Expand Down Expand Up @@ -252,9 +252,9 @@ async def test_eth_modify_transaction(

modified_txn_hash = await async_w3.eth.modify_transaction(
txn_hash,
value=2,
maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"]) * 2),
maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"]) * 2),
value=Wei(2),
maxPriorityFeePerGas=(cast(Wei, txn_params["maxPriorityFeePerGas"] * 2)),
maxFeePerGas=(cast(Wei, txn_params["maxFeePerGas"] * 2)),
)
modified_txn = await async_w3.eth.get_transaction(modified_txn_hash)

Expand Down
5 changes: 4 additions & 1 deletion web3/eth/async_eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
from web3._utils.blocks import (
select_method_for_block_identifier,
)
from web3._utils.compat import (
Unpack,
)
from web3._utils.fee_utils import (
async_fee_history_priority_fee,
)
Expand Down Expand Up @@ -597,7 +600,7 @@ async def replace_transaction(
# todo: Update Any to stricter kwarg checking with TxParams
# https://github.com/python/mypy/issues/4441
async def modify_transaction(
self, transaction_hash: _Hash32, **transaction_params: Any
self, transaction_hash: _Hash32, **transaction_params: Unpack[TxParams]
) -> HexBytes:
assert_valid_transaction_params(cast(TxParams, transaction_params))

Expand Down

0 comments on commit 0dd913f

Please sign in to comment.