We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc9b5ab commit 883d021Copy full SHA for 883d021
test/script.spec.ts
@@ -41,6 +41,21 @@ describe('script', () => {
41
});
42
43
44
+ describe('toASM', () => {
45
+ const OP_RETURN = bscript.OPS.OP_RETURN;
46
+ it('encodes empty buffer as OP_0', () => {
47
+ const chunks = [OP_RETURN, Buffer.from([])];
48
+ assert.strictEqual(bscript.toASM(chunks), 'OP_RETURN OP_0');
49
+ });
50
+
51
+ for (let i = 1; i <= 16; i++) {
52
+ it(`encodes one byte buffer [${i}] as OP_${i}`, () => {
53
+ const chunks = [OP_RETURN, Buffer.from([i])];
54
+ assert.strictEqual(bscript.toASM(chunks), 'OP_RETURN OP_' + i);
55
56
+ }
57
58
59
describe('fromASM/toASM (templates)', () => {
60
fixtures2.valid.forEach(f => {
61
if (f.inputHex) {
0 commit comments