|
@ -149,19 +149,17 @@ describe('script', function () { |
|
|
if (!(inputFnName in fixtures.invalid)) return |
|
|
if (!(inputFnName in fixtures.invalid)) return |
|
|
|
|
|
|
|
|
fixtures.invalid[inputFnName].forEach(function (f) { |
|
|
fixtures.invalid[inputFnName].forEach(function (f) { |
|
|
if (inputFn && (f.scriptSig || f.scriptSigHex)) { |
|
|
it('returns false for ' + f.description + ' (' + (f.scriptSig || f.scriptSigHex) + ')', function () { |
|
|
it('returns false for ' + f.description + ' (' + (f.scriptSig || f.scriptSigHex) + ')', function () { |
|
|
var scriptSig |
|
|
var scriptSig |
|
|
|
|
|
|
|
|
|
|
|
if (f.scriptSig) { |
|
|
if (f.scriptSig) { |
|
|
scriptSig = bscript.fromASM(f.scriptSig) |
|
|
scriptSig = bscript.fromASM(f.scriptSig) |
|
|
} else { |
|
|
} else { |
|
|
scriptSig = bscript.fromHex(f.scriptSigHex) |
|
|
scriptSig = new Buffer(f.scriptSigHex, 'hex') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
assert.strictEqual(inputFn(scriptSig), false) |
|
|
assert.strictEqual(inputFn(scriptSig), false) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -181,13 +179,17 @@ describe('script', function () { |
|
|
if (!(outputFnName in fixtures.invalid)) return |
|
|
if (!(outputFnName in fixtures.invalid)) return |
|
|
|
|
|
|
|
|
fixtures.invalid[outputFnName].forEach(function (f) { |
|
|
fixtures.invalid[outputFnName].forEach(function (f) { |
|
|
if (outputFn && f.scriptPubKey) { |
|
|
it('returns false for ' + f.description + ' (' + (f.scriptPubKey || f.scriptPubKeyHex) + ')', function () { |
|
|
it('returns false for ' + f.description + ' (' + f.scriptPubKey + ')', function () { |
|
|
var scriptPubKey |
|
|
var scriptPubKey = bscript.fromASM(f.scriptPubKey) |
|
|
|
|
|
|
|
|
|
|
|
assert.strictEqual(outputFn(scriptPubKey), false) |
|
|
if (f.scriptPubKey) { |
|
|
}) |
|
|
scriptPubKey = bscript.fromASM(f.scriptPubKey) |
|
|
} |
|
|
} else { |
|
|
|
|
|
scriptPubKey = new Buffer(f.scriptPubKeyHex, 'hex') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
assert.strictEqual(outputFn(scriptPubKey), false) |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|