Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ const isNullData = (pops) => {
pops[0].opcode.value == OP_RETURN &&
(isSmallInt(pops[1].opcode.value) ||
pops[1].opcode.value <= OP_PUSHDATA4) &&
pops[1].data.length <= MaxDataCarrierSize
(pops[1].data ? pops[1].data.length : 0) <= MaxDataCarrierSize
);
};

Expand Down
17 changes: 17 additions & 0 deletions test/data/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,23 @@ export const MAINNET_scriptDataTest = [
// reqSigs: 1,
// // class: MultiSigTy,
// },
{
// OP_0 has no data.
name: "nulldata OP_RETURN OP_0",
script: [0x6a, 0x00],
expected: { "address": null, "requiredSig": 0, "scriptClass": 0, "asm": "OP_RETURN OP_0" }
},
{
// OP_1 to OP_16 have no data.
name: "nulldata OP_RETURN OP_1",
script: [0x6a, 0x51],
expected: { "address": null, "requiredSig": 0, "scriptClass": 0, "asm": "OP_RETURN OP_1" }
},
{
name: "nulldata OP_RETURN OP_16",
script: [0x6a, 0x60],
expected: { "address": null, "requiredSig": 0, "scriptClass": 0, "asm": "OP_RETURN OP_16" }
},
{
name: "empty script",
script: [],
Expand Down
Loading