diff --git a/src/ecpubkey.js b/src/ecpubkey.js index 026be2b..db4c07c 100644 --- a/src/ecpubkey.js +++ b/src/ecpubkey.js @@ -10,10 +10,10 @@ var sec = require('./sec') var ecparams = sec('secp256k1') function ECPubKey(Q, compressed) { - assert(Q instanceof ECPointFp, 'Q must be an ECPointFP') + assert(Q instanceof ECPointFp, 'Expected ECPointFP, got ' + Q) if (compressed == undefined) compressed = true - assert.strictEqual(typeof compressed, 'boolean', 'Invalid compression flag') + assert.strictEqual(typeof compressed, 'boolean', 'Expected boolean, got ' + compressed) this.compressed = compressed this.Q = Q diff --git a/src/script.js b/src/script.js index 8ee030b..cce5189 100644 --- a/src/script.js +++ b/src/script.js @@ -247,7 +247,7 @@ Script.prototype.writeOp = function(opcode) { Script.prototype.writeBytes = function(data) { // FIXME: Script module doesn't support buffers yet if (Buffer.isBuffer(data)) data = Array.prototype.slice.call(data); - assert(Array.isArray(data), "Expected a byte array. Got " + data) + assert(Array.isArray(data), 'Expected a byte array, got ' + data) if (data.length < opcodes.OP_PUSHDATA1) { this.buffer.push(data.length) @@ -305,7 +305,7 @@ Script.createP2SHScriptPubKey = function(hash) { // m [pubKeys ...] n OP_CHECKMULTISIG Script.createMultisigScriptPubKey = function(m, pubKeys) { - assert(Array.isArray(pubKeys), 'Expected Array, got: ' + pubKeys) + assert(Array.isArray(pubKeys), 'Expected Array, got ' + pubKeys) assert(pubKeys.length >= m, 'Not enough pubKeys provided') var script = new Script() var n = pubKeys.length @@ -369,7 +369,7 @@ Script.prototype.clone = function() { } Script.fromChunks = function(chunks) { - assert(Array.isArray(chunks), 'Expected Array, got: ' + chunks) + assert(Array.isArray(chunks), 'Expected Array, got ' + chunks) var bufferSize = chunks.reduce(function(accum, chunk) { var chunkSize = 1