From 0f34f54888f680bfbe7a29ac278636d7178a99bb Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sat, 14 Sep 2019 19:48:38 +0200 Subject: rpc: fix regression in gettransaction PR 16866 renamed the 'decode' argument in gettransaction to 'verbose' to make it more consistent with other RPC calls like getrawtransaction. However, it seems it inadvertently overloaded the 'details' fields when 'verbose' is passed. The result is that the original 'details' fields are no longer returned, which seems to be a breaking API change. This PR takes the simplest path to restoring the 'details' fields by renaming them from 'details' back to 'decoded', while leaving the 'verbose' argument for API consistency. It also addresses [this comment](https://github.com/bitcoin/bitcoin/pull/16185#discussion_r320740413) to mention that the 'decoded' field is identical to decoderawtransaction. Update the RPC help, functional test, and release note. --- test/functional/wallet_basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional') diff --git a/test/functional/wallet_basic.py b/test/functional/wallet_basic.py index 4c3fe3078b..40ad9081ae 100755 --- a/test/functional/wallet_basic.py +++ b/test/functional/wallet_basic.py @@ -499,10 +499,10 @@ class WalletTest(BitcoinTestFramework): self.nodes[0].setlabel(change, 'foobar') assert_equal(self.nodes[0].getaddressinfo(change)['ischange'], False) - # Test "verbose" field value in gettransaction response + # Test "decoded" field value in gettransaction `verbose` response. self.log.info("Testing verbose gettransaction...") tx = self.nodes[0].gettransaction(txid=txid, verbose=True) - assert_equal(tx["details"], self.nodes[0].decoderawtransaction(tx["hex"])) + assert_equal(tx["decoded"], self.nodes[0].decoderawtransaction(tx["hex"])) if __name__ == '__main__': -- cgit v1.2.3