Page MenuHomePhabricator

[explorer] Display decoded scripts in tx details
ClosedPublic

Authored by osoftware on Apr 12 2023, 11:27.

Details

Reviewers
tobias_ruck
Fabien
Group Reviewers
Restricted Project
Restricted Owners Package(Owns No Changed Paths)
Commits
rABC2a754ac7331b: [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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable