Skip to content

RPC: Omit P2SH for asset scripts - #1296

Open
Tabakkui wants to merge 1 commit into
RavenProject:developfrom
Tabakkui:fix/issue-388-asset-decodescript
Open

Tabakkui wants to merge 1 commit into
RavenProject:developfrom
Tabakkui:fix/issue-388-asset-decodescript

Conversation

@Tabakkui

Copy link
Copy Markdown

Problem

decodescript adds a p2sh field for every decoded output except an
already-typed scripthash. Asset scripts are not redeem scripts, so reporting
a P2SH wrapper for new_asset, transfer_asset, reissue_asset, and
restricted asset data is misleading.

Approach

Recognize all asset output types before adding the derived p2sh field. Keep
the existing behavior for ordinary script types, including the P2SH-derived
address for a normal P2PKH script.

Tests

  • git diff --check
  • python3 -m py_compile test/functional/rpc_decodescript.py
  • Updated rpc_decodescript.py to assert that asset and owner scripts omit
    p2sh, while ordinary P2PKH scripts still include it.
  • Full functional execution was not run locally because this Pi checkout has
    no configured/build ravend; CI/authorized PC build is the required gate.

Risk and exclusions

This changes only the presentation of the decodescript RPC result. It does
not change script classification, validation, consensus, address generation,
or asset serialization.

Fixes #388

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant