Previously ScriptToAsmStr
returned hex-encoded values, except if data length was <= 4 bytes, in which case it displayed using decimal encoding.
Fix the ASM representation by specifying an unambiguous encoding:
- Drop
OP_
prefix from all opcodes - For non-minimal pushes prefix with the opcode and enclose pushed hex value in angle brackets
PUSHDATA1<0100>
- For minimal pushes:
- If > 5 bytes display pushed hex value enclosed in angle brackets
<...>
- If <= 5 bytes:
- If minimally-encoded display pushed value in decimal without angle brackets
42
- If not minimally-encoded display pushed hex value enclosed in angle brackets
<4200>
- If minimally-encoded display pushed value in decimal without angle brackets
- Display undecodable bytes using
UNDECODABLE(...)
- If > 5 bytes display pushed hex value enclosed in angle brackets
This should permit unambiguous decoding in the future.