aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_basic.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-10-15 16:11:30 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-10-17 18:10:36 +0200
commit130ee481082d2612d452d7d69131ade935b225b5 (patch)
treecf8b9712d1f12dbf57781e7dd5a159b8a58a5992 /test/functional/wallet_basic.py
parent4dbba3bac70f78e764910f357c875c09569a8fc4 (diff)
downloadbitcoin-130ee481082d2612d452d7d69131ade935b225b5.tar.xz
test: get and decode tx with a single `gettransaction` RPC call
Rather than subsequently calling `gettransaction` and `decoderawtransaction` to get the decoded information for a specific tx-id, we can simply use the verbose version of `gettransaction`, which returns this in a 'decoded' key. I.e. node.decoderawtransaction(node.gettransaction(txid)['hex']) can be replaced by: node.gettransaction(txid=txid, verbose=True)['decoded']
Diffstat (limited to 'test/functional/wallet_basic.py')
-rwxr-xr-xtest/functional/wallet_basic.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py
index 599e506f98..92da54d97c 100755
--- a/test/functional/wallet_basic.py
+++ b/test/functional/wallet_basic.py
@@ -666,7 +666,7 @@ class WalletTest(BitcoinTestFramework):
self.generate(self.nodes[0], 1)
destination = self.nodes[1].getnewaddress()
txid = self.nodes[0].sendtoaddress(destination, 0.123)
- tx = self.nodes[0].decoderawtransaction(self.nodes[0].gettransaction(txid)['hex'])
+ tx = self.nodes[0].gettransaction(txid=txid, verbose=True)['decoded']
output_addresses = [vout['scriptPubKey']['address'] for vout in tx["vout"]]
assert len(output_addresses) > 1
for address in output_addresses: