Skip to content

Commit 1d656a7

Browse files
schwartzmankclowes
andcommitted
Update replace_transaction and modify_transaction docs (#2058)
replace_transaction() and modify_transaction() were listed as returning strings, when in fact they return HexBytes. * Added a full tx hash, and added arguments back to modify_tx docs Co-authored-by: kclowes <kclowes@users.noreply.github.com>
1 parent 1417eb8 commit 1d656a7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/web3.eth.rst

+7-6
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ The following methods are available on the ``web3.eth`` namespace.
893893
and ``maxPriorityFeePerGas``. These will likely be default values and may result in an
894894
unsuccessful replacement of the pending transaction.
895895

896-
This method returns the transaction hash of the replacement transaction.
896+
This method returns the transaction hash of the replacement transaction as a HexBytes object.
897897

898898
.. code-block:: python
899899
@@ -902,12 +902,13 @@ The following methods are available on the ``web3.eth`` namespace.
902902
'from': web3.eth.coinbase,
903903
'value': 1000
904904
})
905-
'0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
905+
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
906906
>>> web3.eth.replace_transaction('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331', {
907907
'to': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
908908
'from': web3.eth.coinbase,
909909
'value': 2000
910910
})
911+
HexBytes('0x4177e670ec6431606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1528989')
911912
912913
.. py:method:: Eth.replaceTransaction(transaction_hash, new_transaction)
913914
@@ -927,7 +928,7 @@ The following methods are available on the ``web3.eth`` namespace.
927928

928929
The same validation and defaulting rules of :meth:`~web3.eth.Eth.replace_transaction` apply.
929930

930-
This method returns the transaction hash of the newly modified transaction.
931+
This method returns the transaction hash of the newly modified transaction as a HexBytes object.
931932

932933
.. code-block:: python
933934
@@ -936,9 +937,9 @@ The following methods are available on the ``web3.eth`` namespace.
936937
'from': web3.eth.coinbase,
937938
'value': 1000
938939
})
939-
'0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331'
940-
>>> web3.eth.modify_transaction
941-
('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331', value=2000)
940+
HexBytes('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331')
941+
>>> web3.eth.modify_transaction(('0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331', value=2000)
942+
HexBytes('0xec6434e6701771606e55d6b4ca35a1a6b75ee3d73315145a921026d15299d05')
942943
943944
.. py:method:: Eth.modifyTransaction(transaction_hash, **transaction_params)
944945

0 commit comments

Comments
 (0)