tests: test non-standard pathway for classifyInput
This commit is contained in:
parent
ddb24ee615
commit
f3138dcb68
2 changed files with 17 additions and 0 deletions
4
test/fixtures/scripts.json
vendored
4
test/fixtures/scripts.json
vendored
|
@ -95,6 +95,10 @@
|
||||||
{
|
{
|
||||||
"description": "multisig output : non-canonical pubKey (bad length)",
|
"description": "multisig output : non-canonical pubKey (bad length)",
|
||||||
"scriptPubKey": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ffff OP_1 OP_CHECKMULTISIG"
|
"scriptPubKey": "OP_1 0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ffff OP_1 OP_CHECKMULTISIG"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "pubKeyHash input : extraneous data",
|
||||||
|
"scriptSig": "304402207515cf147d201f411092e6be5a64a6006f9308fad7b2a8fdaab22cd86ce764c202200974b8aca7bf51dbf54150d3884e1ae04f675637b926ec33bf75939446f6ca2801 02359c6e3f04cefbf089cf1d6670dc47c3fb4df68e2bad1fa5a369f9ce4b42bbd1 ffffffff"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"multisig": [
|
"multisig": [
|
||||||
|
|
|
@ -19,6 +19,17 @@ describe('Scripts', function() {
|
||||||
assert.equal(type, f.type)
|
assert.equal(type, f.type)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
fixtures.invalid.classify.forEach(function(f) {
|
||||||
|
if (!f.scriptSig) return
|
||||||
|
|
||||||
|
it('returns nonstandard for ' + f.description, function() {
|
||||||
|
var script = Script.fromASM(f.scriptSig)
|
||||||
|
var type = scripts.classifyInput(script)
|
||||||
|
|
||||||
|
assert.equal(type, 'nonstandard')
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('classifyOutput', function() {
|
describe('classifyOutput', function() {
|
||||||
|
@ -34,6 +45,8 @@ describe('Scripts', function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
fixtures.invalid.classify.forEach(function(f) {
|
fixtures.invalid.classify.forEach(function(f) {
|
||||||
|
if (!f.scriptPubKey) return
|
||||||
|
|
||||||
it('returns nonstandard for ' + f.description, function() {
|
it('returns nonstandard for ' + f.description, function() {
|
||||||
var script = Script.fromASM(f.scriptPubKey)
|
var script = Script.fromASM(f.scriptPubKey)
|
||||||
var type = scripts.classifyOutput(script)
|
var type = scripts.classifyOutput(script)
|
||||||
|
|
Loading…
Add table
Reference in a new issue