scripts: enforce pubKeys as type ECPubKey
This commit is contained in:
parent
e42c497a3c
commit
0524ced984
@ -185,7 +185,7 @@ function scriptHashOutput(hash) {
|
|||||||
|
|
||||||
// m [pubKeys ...] n OP_CHECKMULTISIG
|
// m [pubKeys ...] n OP_CHECKMULTISIG
|
||||||
function multisigOutput(m, pubKeys) {
|
function multisigOutput(m, pubKeys) {
|
||||||
typeForce('Array', pubKeys)
|
typeForce(['ECPubKey'], pubKeys)
|
||||||
|
|
||||||
assert(pubKeys.length >= m, 'Not enough pubKeys provided')
|
assert(pubKeys.length >= m, 'Not enough pubKeys provided')
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,7 @@ describe('Scripts', function() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
fixtures.invalid.multisigOutput.forEach(function(f) {
|
fixtures.invalid.multisigOutput.forEach(function(f) {
|
||||||
var pubKeys = f.pubKeys.map(function(p) { return new Buffer(p, 'hex') })
|
var pubKeys = f.pubKeys.map(ECPubKey.fromHex)
|
||||||
|
|
||||||
it('throws on ' + f.exception, function() {
|
it('throws on ' + f.exception, function() {
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user