Repository navigation
gettransaction: add an argument to decode the transaction - #16185
Conversation
promag
left a comment
There was a problem hiding this comment.
Concept ACK, please include tests and a release note.
7894189 to
0622d5b
Compare
|
@promag thank you for the review. I added the changes and will include the tests and release note soon. |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
Since there was no functional test for the |
b351a12 to
9759da2
Compare
|
Moved the test to |
9759da2 to
676b504
Compare
8ccc657 to
7cf832a
Compare
8e78c0b to
91f15c8
Compare
|
Rebased. |
769a0ea to
5f96ab3
Compare
|
Some minor corrections according to last review. |
promag
left a comment
There was a problem hiding this comment.
You could use 0b6ba66#diff-0f596a69ccfb4d07c007cd6fc993898dR50 (not yet in master) to do:
assert_no_key('decoded', self.nodes[0].gettransaction(txid, decode=False))5f96ab3 to
5c28a1f
Compare
|
Rebased. |
No that's a Travis error : |
This adds a new boolean parameter 'decode' to the gettransaction call, which, if set to true, add a 'decoded' field to the result containing the decoded transaction
50d0174 to
9965940
Compare
9965940 doc: Add release note for the new gettransaction argument (darosior) b8b3f04 tests: Add a new functional test for gettransaction (darosior) 7f3bb24 gettransaction: add an argument to decode the transaction (darosior) Pull request description: This PR adds a new parameter to the `gettransaction` call : `decode`. If set to `true`, it will add a new `decoded` field to the response. This mimics the behavior of `getrawtransaction`'s `verbose` argument to avoid using 2 calls if we want to decode a wallet transaction (`gettransaction` then `decoderawtransaction`). Fix #16181 . ACKs for top commit: meshcollider: re-utACK 9965940 Tree-SHA512: bcb6b4bd252b3488d6afc77659c499c2ad99fd58661eb24b6a2e17014c74f22e47fde70e00fedb4f4754915786622ad02483b2cf2c4dea0ab0eb4ac8276dbeee
| " ,...\n" | ||
| " ],\n" | ||
| " \"hex\" : \"data\" (string) Raw data for transaction\n" | ||
| " \"decoded\" : transaction (json object) Optional, the decoded transaction\n" |
There was a problem hiding this comment.
Should mention that the field is identical to decoderawtransaction?
|
Sorry for the post-merge review comment, but would it make sense to call the new parameter If so, we should make that change before v0.19 to avoid an API change. |
This seems like a good idea. You could open a one-line PR and add the milestone to get more feedback. |
|
+1 for API consistency. |
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](bitcoin#16185 (comment)) to mention that the 'decoded' field is identical to decoderawtransaction. Update the RPC help, functional test, and release note.
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
This adds a new boolean parameter 'decode' to the gettransaction call, which, if set to true, add a 'decoded' field to the result containing the decoded transaction Github-Pull: bitcoin#16185 Rebased-From: 7f3bb24
Github-Pull: bitcoin#16185 Rebased-From: b8b3f04
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](bitcoin#16185 (comment)) to mention that the 'decoded' field is identical to decoderawtransaction. Update the RPC help, functional test, and release note. Github-Pull: bitcoin#16873 Rebased-From: 0f34f54
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](bitcoin/bitcoin#16185 (comment)) to mention that the 'decoded' field is identical to decoderawtransaction. Update the RPC help, functional test, and release note.
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](bitcoin#16185 (comment)) to mention that the 'decoded' field is identical to decoderawtransaction. Update the RPC help, functional test, and release note.
…ansaction Summary: This adds a new boolean parameter 'decode' to the gettransaction call, which, if set to true, add a 'decoded' field to the result containing the decoded transaction bitcoin/bitcoin@7f3bb24 --- Partial backport of Core [[bitcoin/bitcoin#16185 | PR16185]] Test Plan: ninja check check-functional Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7370
Summary: bitcoin/bitcoin@b8b3f04 --- Depends on D7370 Partial backport of Core [[bitcoin/bitcoin#16185 | PR16185]] Test Plan: test_runner.py wallet_basic Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D7371
… argument Summary: bitcoin/bitcoin@9965940 --- Depends on D7371 Concludes backport of Core [[bitcoin/bitcoin#16185 | PR16185]] Test Plan: read release notes Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7372
This PR adds a new parameter to the
gettransactioncall :decode. If set totrue, it will add a newdecodedfield to the response. This mimics the behavior ofgetrawtransaction'sverboseargument to avoid using 2 calls if we want to decode a wallet transaction (gettransactionthendecoderawtransaction).Fix #16181 .