HomePhabricator

[explorer] Display decoded scripts in tx details

Description

[explorer] Display decoded scripts in tx details

Summary:
The bitcoinsuite dependency implements Display trait for scripts now.
Opcodes are displayed by their respective names.
PUSHDATA payloads are displayed either in hex with 0x prefix or as a quoted string given it's a valid UTF-8 string containing only alphanumeric characters in any language, whitespace, diacritics, symbols or emojis.
A 0x00 byte at the end of string is displayed as \0 (this is a special case for SLP tokens to look nice).

Test Plan:
Run unit tests in bitcoinsuite-core project.
Run explorer-exe, navigate to some transaction, switch to Advanced mode and see if Script Decoded fields show human-readable scripts.

Reviewers: #bitcoin_abc, tobias_ruck, Fabien, O1 Bitcoin ABC

Reviewed By: #bitcoin_abc, Fabien, O1 Bitcoin ABC

Subscribers: tobias_ruck

Differential Revision: https://reviews.bitcoinabc.org/D13682

Details

Provenance
Tendo <--global>Authored on Apr 12 2023, 09:39
osoftwarePushed on Apr 12 2023, 14:17
Reviewer
Restricted Project
Differential Revision
D13682: [explorer] Display decoded scripts in tx details
Parents
rABC29ae0eb2eae1: [CI] Fix the preview timeout potential failure
Branches
Unknown
Tags
Unknown