-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: creditOutputs
in AssetLock tx json output should be an array of objects, not debug strings
#6229
fix: creditOutputs
in AssetLock tx json output should be an array of objects, not debug strings
#6229
Conversation
ae9bb25
to
ba78bd2
Compare
Thank you @UdjinM6! |
ba78bd2
to
e54fe42
Compare
This is a breaking change, also not a fix really but a feat I guess? As such, can't merge in pre-v22, cannot backport we could merge in e54fe42 earlier ofc |
In no other places (in RPC) txouts are shown like that. The data is incomplete so you could get the same |
src/evo/assetlocktx.h
Outdated
@@ -9,6 +9,7 @@ | |||
#include <primitives/transaction.h> | |||
#include <gsl/pointers.h> | |||
|
|||
#include <core_io.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add here a forward declaration of ScriptPubKeyToUniv or do something else?
To avoid:
"core_io -> evo/assetlocktx -> core_io"
Is it truly inherently broken? I see no reason why platform for example (or anyone else) couldn't be using / relying on it as it right now. Can you explain further how/why it is incomplete / inherently broken? |
pls see PR description, tl;dr: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK b330318
But it's still a breaking change @UdjinM6, platform could be parsing the amount component |
It doesn't look like a breaking change for Drive, since it uses only I herby temporarily release you from your obligation to block all PRs which result in breaking changes in minor versions. This temporary release shall only be for the PR 6229. I herby solemnly swear to release you from all potential blame arising from any issues related to platform as a result of merging this PR. |
@UdjinM6 I think with release notes documenting this change, I can merge it for 21.2 |
90e6410
to
9876c2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 9876c2d
Good thing these messages have an edit log @shumkov 😂
|
…should be an array of objects, not debug strings 9876c2d docs: add partial release notes (UdjinM6) b330318 refactor: drop circular dependency (UdjinM6) e54fe42 refactor: use `key_to_p2pkh_script` in more places (UdjinM6) 3ed6246 test: check `creditOutputs` format (UdjinM6) ba0e645 fix: `creditOutputs` in AssetLock tx json output should be an array of objects, not debug strings (UdjinM6) Pull request description: ## Issue being fixed or feature implemented Txout-s in `creditOutputs` for AssetLock txes should be shown the way txout-s are shown in other places. We should not be using debug strings there. Example: `getrawtransaction 50757f651f335e22c5a810bd05c1e5aac0d95b132f6454e2a72683f88e3983f3 1` develop: ``` "assetLockTx": { "version": 1, "creditOutputs": [ "CTxOut(nValue=0.01000000, scriptPubKey=76a914cdfca4ae1cf2333056659a2c)" ] }, ``` This PR: ``` "assetLockTx": { "version": 1, "creditOutputs": [ { "value": 0.01000000, "valueSat": 1000000, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 cdfca4ae1cf2333056659a2c8dc656f36d228402 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914cdfca4ae1cf2333056659a2c8dc656f36d22840288ac", "address": "yf6c2VSpWGXUgmjQSHRpfEcTPsbqN4oL4c", "type": "pubkeyhash" } } ] }, ``` kudos to @coolaj86 for finding the issue ## What was done? Change `CAssetLockPayload::ToJson()` output to be closer to [`TxToUniv()`](https://github.com/dashpay/dash/blob/develop/src/core_write.cpp#L262-L272) NOTE: `refactor: use key_to_p2pkh_script in more places` commit is a bit unrelated but I decided to add it anyway to make it easier to follow assetlock creation vs getrawtransaction rpc check. ## How Has This Been Tested? Try example above, run tests ## Breaking Changes RPC output is different for AssetLock txes ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK 9876c2d Tree-SHA512: 158c98ac9e4979bb29c4f54cb1b71806f22aaec92218d92cd2b2e9b9f74df721563e7a6c5f517ea358ac74659fa79f51d1b683002a1cdceb1b8ee80f8fd79375
d627a6e chore: bump version to 21.1.1 (pasta) 5f9700c docs: release notes for v21.1.1 (pasta) 1c00726 Merge #6277: chore: add builder key for kittywhiskers (pasta) a2bc0f1 Merge #6290: chore: update pasta gpg key to reflect new subkeys (pasta) 167608c Merge #6338: ci: attest results of guix builds (pasta) 6fb4e49 Merge #6197: ci: always build guix, save artifacts (pasta) c0ca93c Merge #6340: fix: make 6336 compile in v21.1.x branch, using older CHECK_NONFATAL functionality (pasta) bb96df4 Merge #6336: fix: rpc getblock and getblockstats for blocks with withdrawal transactions (asset unlock) (pasta) 8e70262 Merge #6131: feat: make a support of Qt app to show Platform transfer Tx (pasta) 80ed279 Merge #6328: backport: bitcoin#30131, bitcoin#23258, bitcoin#30504 - fix bild for Ubuntu 24.10 + clang (pasta) bd772fb Merge #6229: fix: `creditOutputs` in AssetLock tx json output should be an array of objects, not debug strings (pasta) 9bf39a9 Merge #6222: fix: adjust payee predictions after mn_rr activation, add tests (pasta) 87bebfc Merge #6219: fix: correct is_snapshot_cs in VerifyDB (pasta) a4e6b8a Merge #6208: fix: persist coinjoin denoms options from gui over restarts (pasta) Pull request description: ## Issue being fixed or feature implemented See commits, backports, release notes, version bump ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: knst: utACK d627a6e kwvg: ACK d627a6e UdjinM6: utACK d627a6e ogabrielides: utACK d627a6e Tree-SHA512: cde7e40760e16e9f48da8149c3742d18a34029b057405e4d55b87110da96acbcd19b47280451dd7b5ad1ccfc91fde655452cf5f0f0d1e01a41b4c685337c64b8
Issue being fixed or feature implemented
Txout-s in
creditOutputs
for AssetLock txes should be shown the way txout-s are shown in other places. We should not be using debug strings there.Example:
getrawtransaction 50757f651f335e22c5a810bd05c1e5aac0d95b132f6454e2a72683f88e3983f3 1
develop:
This PR:
kudos to @coolaj86 for finding the issue
What was done?
Change
CAssetLockPayload::ToJson()
output to be closer toTxToUniv()
NOTE:
refactor: use key_to_p2pkh_script in more places
commit is a bit unrelated but I decided to add it anyway to make it easier to follow assetlock creation vs getrawtransaction rpc check.How Has This Been Tested?
Try example above, run tests
Breaking Changes
RPC output is different for AssetLock txes
Checklist: