From 0524ced98464c4643366f77042da1e8fe2a86af1 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 23 Dec 2014 15:30:14 +1100 Subject: [PATCH] scripts: enforce pubKeys as type ECPubKey --- src/scripts.js | 2 +- test/scripts.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts.js b/src/scripts.js index 33f51ca..606e14b 100644 --- a/src/scripts.js +++ b/src/scripts.js @@ -185,7 +185,7 @@ function scriptHashOutput(hash) { // m [pubKeys ...] n OP_CHECKMULTISIG function multisigOutput(m, pubKeys) { - typeForce('Array', pubKeys) + typeForce(['ECPubKey'], pubKeys) assert(pubKeys.length >= m, 'Not enough pubKeys provided') diff --git a/test/scripts.js b/test/scripts.js index 8405cd5..ac35a65 100644 --- a/test/scripts.js +++ b/test/scripts.js @@ -168,7 +168,7 @@ describe('Scripts', function() { }) 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() { assert.throws(function() {