Conversation
Do not report a P2SH wrapper for asset and restricted asset scripts in decodescript. Preserve the existing wrapper address for ordinary script types and cover both cases in the functional test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
decodescriptadds ap2shfield for every decoded output except analready-typed
scripthash. Asset scripts are not redeem scripts, so reportinga P2SH wrapper for
new_asset,transfer_asset,reissue_asset, andrestricted asset data is misleading.
Approach
Recognize all asset output types before adding the derived
p2shfield. Keepthe existing behavior for ordinary script types, including the P2SH-derived
address for a normal P2PKH script.
Tests
git diff --checkpython3 -m py_compile test/functional/rpc_decodescript.pyrpc_decodescript.pyto assert that asset and owner scripts omitp2sh, while ordinary P2PKH scripts still include it.no configured/build
ravend; CI/authorized PC build is the required gate.Risk and exclusions
This changes only the presentation of the
decodescriptRPC result. It doesnot change script classification, validation, consensus, address generation,
or asset serialization.
Fixes #388