Skip to content

wallet: Rename 'decode' argument in gettransaction method to 'verbose' - #16866

Merged
meshcollider merged 1 commit into
bitcoin:masterfrom
jnewbery:2019-09-change-gettransaction-arg-name
Sep 14, 2019
Merged

meshcollider merged 1 commit into
bitcoin:masterfrom
jnewbery:2019-09-change-gettransaction-arg-name

Conversation

@jnewbery

Copy link
Copy Markdown
Contributor

This makes the RPC method consistent with other RPC methods that have a
'verbose' option.

Change the name of the return object from 'decoded' to details.

Update help text.

This makes the RPC method consistent with other RPC methods that have a
'verbose' option.

Change the name of the return object from 'decoded' to details.

Update help text.
@jnewbery

Copy link
Copy Markdown
Contributor Author

Suggested here: #16185 (comment)

@ryanofsky @promag

Also addresses @MarcoFalke's comment here: #16185 (comment)

@jnewbery

Copy link
Copy Markdown
Contributor Author

I'm assigning this to 0.19 to avoid an API change for the new argument.

@jonatack

Copy link
Copy Markdown
Member

Concept ACK. Will review over this weekend.

@DrahtBot

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16365 (Log RPC parameters (arguments) if -debug=rpcparams by LarryRuane)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@meshcollider meshcollider left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK 7dee8f4

@promag

promag commented Sep 14, 2019

Copy link
Copy Markdown
Contributor

ACK 7dee8f4.

@fanquake fanquake changed the title [wallet] Rename 'decode' argument in gettransaction method to 'verbose' wallet: Rename 'decode' argument in gettransaction method to 'verbose' Sep 14, 2019

@NeedsAdjustment NeedsAdjustment left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rate these changes 5/5 stars. Keep up the good work developers!

@0xB10C 0xB10C left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7dee8f4: reviewed code

meshcollider added a commit that referenced this pull request Sep 14, 2019
…od to 'verbose'

7dee8f4 [wallet] Rename 'decode' argument in gettransaction method to 'verbose' (John Newbery)

Pull request description:

  This makes the RPC method consistent with other RPC methods that have a
  'verbose' option.

  Change the name of the return object from 'decoded' to details.

  Update help text.

ACKs for top commit:
  promag:
    ACK 7dee8f4.
  meshcollider:
    Code review ACK 7dee8f4
  0xB10C:
    ACK 7dee8f4: reviewed code

Tree-SHA512: a3a62265c8e6e914591f3b3b9f9dd4f42240dc8dab9cbac6ed8d8b8319b6cc847db2ad1689d5440c162e0698f31e39fc6b868ed918b2f62879d61b9865cae66b
@meshcollider
meshcollider merged commit 7dee8f4 into bitcoin:master Sep 14, 2019

@jonatack jonatack left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The possible issue here is that the new details section overloads and replaces the pre-existing details in the response, whereas before the decoded section did not remove the details. Seems like a breaking API change unless I'm misunderstanding the intention of this PR.

Will propose a change to address this.

@jnewbery
jnewbery deleted the 2019-09-change-gettransaction-arg-name branch September 14, 2019 23:07
@jnewbery

Copy link
Copy Markdown
Contributor Author

the new details section overloads and replaces the pre-existing details

oops. Good catch @jonatack ! That was a clumsy mistake.

meshcollider added a commit that referenced this pull request Sep 15, 2019
1b41c2c test: improve gettransaction test coverage (Jon Atack)
0f34f54 rpc: fix regression in gettransaction (Jon Atack)

Pull request description:

  Closes #16872.

  PR #16866 renamed the `decode` argument in gettransaction to `verbose` to make it more consistent with other RPC calls like getrawtransaction. However, it inadvertently overloaded the "details" field when `verbose` is passed. The result is that the original "details" field is no longer returned correctly, which seems to be a breaking API change.

  This PR:

  - takes the simplest path to restoring the "details" field by renaming the decoded one back to "decoded" while leaving the `verbose` argument for API consistency, which was the main intent of #16866,

  - addresses [this comment](#16185 (comment)) by mentioning in the RPC help that the new decoded field is equivalent to decoderawtransaction, and

  - updates the help, functional test, and release note.

  Reviewers, to test this manually, build and run `bitcoin-cli help gettransaction` and `bitcoin-cli gettransaction <wallet txid> false true`, and verify that the command returns both `details` and `decoded` fields.

ACKs for top commit:
  jnewbery:
    tACK 1b41c2c

Tree-SHA512: 287edd5db7ed58fe8b548975aba58628bd45ed708b28f40174f10a35a455d89f796fbf27430aa881fc376f47aabda8803f74d4d100683bd86577a02279091cf3
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Sep 21, 2019
This makes the RPC method consistent with other RPC methods that have a
'verbose' option.

Change the name of the return object from 'decoded' to details.

Update help text.

Github-Pull: bitcoin#16866
Rebased-From: 7dee8f4
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Sep 7, 2020
…ethod to 'verbose'

Summary:
[wallet] Rename 'decode' argument in gettransaction method to 'verbose' (John Newbery)

Pull request description:

  This makes the RPC method consistent with other RPC methods that have a
  'verbose' option.

  Change the name of the return object from 'decoded' to details.

  Update help text.

---

Backport of Core [[bitcoin/bitcoin#16866 | PR16866]] and [[bitcoin/bitcoin#16873 | PR16873]] (required to unbreak [[bitcoin/bitcoin#16866 | PR16866]])

Test Plan:
  ninja check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7378
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants