From 130ee481082d2612d452d7d69131ade935b225b5 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Fri, 15 Oct 2021 16:11:30 +0200 Subject: 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'] --- test/functional/wallet_address_types.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/functional/wallet_address_types.py') diff --git a/test/functional/wallet_address_types.py b/test/functional/wallet_address_types.py index bdee22e62b..7a448e8590 100755 --- a/test/functional/wallet_address_types.py +++ b/test/functional/wallet_address_types.py @@ -204,8 +204,7 @@ class AddressTypeTest(BitcoinTestFramework): def test_change_output_type(self, node_sender, destinations, expected_type): txid = self.nodes[node_sender].sendmany(dummy="", amounts=dict.fromkeys(destinations, 0.001)) - raw_tx = self.nodes[node_sender].getrawtransaction(txid) - tx = self.nodes[node_sender].decoderawtransaction(raw_tx) + tx = self.nodes[node_sender].gettransaction(txid=txid, verbose=True)['decoded'] # Make sure the transaction has change: assert_equal(len(tx["vout"]), len(destinations) + 1) -- cgit v1.2.3