Skip to content

Test against @smartledger/bsv 9.11.2 - #5

Merged
codenlighten merged 1 commit into
mainfrom
bsv-9.11.2
Sep 17, 2026
Merged

codenlighten merged 1 commit into
mainfrom
bsv-9.11.2

Conversation

@codenlighten

Copy link
Copy Markdown
Owner

Change

  • devDependency @smartledger/bsv ^9.11.1^9.11.2. The peer range stays ^9.10.1.
  • New unit test assertion: 516a00020affOP_1 OP_RETURN 0 0aff, which reads back byte for byte. That is OP_RETURN data with an empty push, the shape buildDataOut('') makes. With 9.11.1, toASM wrote nothing for the empty push, so exactAsm refused it.
  • npm test: 28/28 on 9.11.2.

Review of bsv 9.11.2 (codenlighten/smartledger-bsv#177)

The change is writer-only and matches its description. Checked with a round-trip fuzz against the npm packages. The fuzz covers:

  • every opcode after OP_1;
  • the empty script;
  • 4c00, 4d0000, 4e00000000, 00, 6a00 and 514c0051;
  • 30,000 generated scripts mixing empty and non-empty pushes of every encoding, unnamed opcodes and named opcodes.

ASM is expected to read back as the script with every push in its shortest encoding; toString exactly.

9.11.1 9.11.2
scripts (with an empty push) 29,312 (12,167) 29,306 (12,042)
toASMfromASM mismatches 12,167 0
toStringfromString mismatches 12,167 0
buildDataOut(''), buildDataOut(Buffer.alloc(0)), add(Buffer.alloc(0)), buildDataOut(['', 'ab']), both forms 8 wrong 0

In 9.11.1, exactly the scripts with an empty push failed, and in both forms.

9.11.2 writes an empty push in ASM as 0 instead of nothing, so OP_RETURN data
holding one (as buildDataOut('') makes) now reads back and exactAsm accepts it.
A unit test covers that case.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​smartledger/​bsv@​9.11.1 ⏵ 9.11.28110099 +196100

View full report

@codenlighten
codenlighten merged commit a6117e8 into main Sep 17, 2026
5 checks passed
@codenlighten
codenlighten deleted the bsv-9.11.2 branch September 17, 2026 16:26
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