mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-09 01:40:27 +02:00
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']
This commit is contained in:
@ -129,7 +129,7 @@ class WalletHDTest(BitcoinTestFramework):
|
||||
|
||||
# send a tx and make sure its using the internal chain for the changeoutput
|
||||
txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)
|
||||
outs = self.nodes[1].decoderawtransaction(self.nodes[1].gettransaction(txid)['hex'])['vout']
|
||||
outs = self.nodes[1].gettransaction(txid=txid, verbose=True)['decoded']['vout']
|
||||
keypath = ""
|
||||
for out in outs:
|
||||
if out['value'] != 1:
|
||||
|
Reference in New Issue
Block a user