aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2019-09-02 23:29:42 +1200
committerMeshCollider <dobsonsa68@gmail.com>2019-09-02 23:31:41 +1200
commit33f9750b1b86a705d092b0e1314ed15287c45239 (patch)
tree97b32216730e1f71d325d018660ba813d4a89cba /test
parent6519be605480fec95dcd814771038efcb1ad2abe (diff)
parent9965940e35c445ccded55510348af228ff22f0e9 (diff)
downloadbitcoin-33f9750b1b86a705d092b0e1314ed15287c45239.tar.xz
Merge #16185: gettransaction: add an argument to decode the transaction
9965940e35c445ccded55510348af228ff22f0e9 doc: Add release note for the new gettransaction argument (darosior) b8b3f0435a2837d3897e9e232ef6ca839ce74eb8 tests: Add a new functional test for gettransaction (darosior) 7f3bb247a811582d1aa4805d8e601c19808dc7ba gettransaction: add an argument to decode the transaction (darosior) Pull request description: This PR adds a new parameter to the `gettransaction` call : `decode`. If set to `true`, it will add a new `decoded` field to the response. This mimics the behavior of `getrawtransaction`'s `verbose` argument to avoid using 2 calls if we want to decode a wallet transaction (`gettransaction` then `decoderawtransaction`). Fix #16181 . ACKs for top commit: meshcollider: re-utACK 9965940e35c445ccded55510348af228ff22f0e9 Tree-SHA512: bcb6b4bd252b3488d6afc77659c499c2ad99fd58661eb24b6a2e17014c74f22e47fde70e00fedb4f4754915786622ad02483b2cf2c4dea0ab0eb4ac8276dbeee
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/wallet_basic.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py
index 34e84fcf55..74350649c7 100755
--- a/test/functional/wallet_basic.py
+++ b/test/functional/wallet_basic.py
@@ -499,6 +499,11 @@ class WalletTest(BitcoinTestFramework):
self.nodes[0].setlabel(change, 'foobar')
assert_equal(self.nodes[0].getaddressinfo(change)['ischange'], False)
+ # Test "decoded" field value in gettransaction response
+ self.log.info("Testing gettransaction decoding...")
+ tx = self.nodes[0].gettransaction(txid=txid, decode=True)
+ assert_equal(tx["decoded"], self.nodes[0].decoderawtransaction(tx["hex"]))
+
if __name__ == '__main__':
WalletTest().main()