From 6a3b6bde76545fc801f57300f914411dad6d56c2 Mon Sep 17 00:00:00 2001 From: codenlighten Date: Thu, 17 Sep 2026 12:19:37 -0400 Subject: [PATCH] Test against @smartledger/bsv 9.11.2 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. --- package-lock.json | 8 ++++---- package.json | 2 +- test/unit.test.js | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf822e0..77da53a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "scriptmin": "bin/scriptmin.js" }, "devDependencies": { - "@smartledger/bsv": "^9.11.1" + "@smartledger/bsv": "^9.11.2" }, "engines": { "node": ">=20.19" @@ -64,9 +64,9 @@ } }, "node_modules/@smartledger/bsv": { - "version": "9.11.1", - "resolved": "https://registry.npmjs.org/@smartledger/bsv/-/bsv-9.11.1.tgz", - "integrity": "sha512-l7rB+UaHft9camYLqhMStL6ox9jeEPkSFyMNW16OIMjrm4BvDkskv9UrF9KhJXLM0XKbeO1H/ASYWUPGhEKWQA==", + "version": "9.11.2", + "resolved": "https://registry.npmjs.org/@smartledger/bsv/-/bsv-9.11.2.tgz", + "integrity": "sha512-4DOM4Q0QKWxbTMf98hw08JBJIolKop0UDFWv0AKfiRQ2wdcr/HM1en+DJI2NFeTjLCwuKG0r2OUNcBS/Q92ZEA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 105666a..11de7f1 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,6 @@ "@smartledger/bsv": "^9.10.1" }, "devDependencies": { - "@smartledger/bsv": "^9.11.1" + "@smartledger/bsv": "^9.11.2" } } diff --git a/test/unit.test.js b/test/unit.test.js index 3d132a5..2a8585e 100644 --- a/test/unit.test.js +++ b/test/unit.test.js @@ -201,6 +201,8 @@ test('ASM output reads back byte for byte, or is refused', () => { assert.throws(() => exactAsm(Buffer.from('4c03aabbcc51', 'hex')), /not minimally encoded/) // An unnamed opcode is written as its raw byte, 0xba. assert.strictEqual(exactAsm(Buffer.from('51ba6a05aabbccddee', 'hex')), 'OP_1 0xba OP_RETURN aabbccddee') + // An empty push in OP_RETURN data, as buildDataOut('') writes it (read back from bsv 9.11.2). + assert.strictEqual(exactAsm(Buffer.from('516a00020aff', 'hex')), 'OP_1 OP_RETURN 0 0aff') assert.throws(() => exactAsm(Buffer.from('516a05aabb', 'hex')), /truncated push/) assert.throws(() => exactAsm(Buffer.from('4c50' + 'ab'.repeat(80), 'hex')), /only data pushes/)