mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +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:
@@ -65,8 +65,7 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
||||
value = sent_value
|
||||
chain.append(txid)
|
||||
# We need the wtxids to check P2P announcements
|
||||
fulltx = self.nodes[0].getrawtransaction(txid)
|
||||
witnesstx = self.nodes[0].decoderawtransaction(fulltx, True)
|
||||
witnesstx = self.nodes[0].gettransaction(txid=txid, verbose=True)['decoded']
|
||||
witness_chain.append(witnesstx['hash'])
|
||||
|
||||
# Check that listunspent ancestor{count, size, fees} yield the correct results
|
||||
|
Reference in New Issue
Block a user