Page MenuHomePhabricator

test: get and decode tx with a single `gettransaction` RPC call
ClosedPublic

Authored by Fabien on Nov 23 2022, 13:06.

Details

Summary
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']

Backport of core#23287.

Test Plan
ninja check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable