From c5252fc509ac5dfb9e79248a5bbfabced42f8763 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 16 Jun 2014 15:44:27 +1000 Subject: [PATCH] Transaction: amend confusing exception message --- src/transaction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transaction.js b/src/transaction.js index 51cfd00..65c0a59 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -37,13 +37,13 @@ Transaction.prototype.addInput = function(tx, index) { if (typeof tx === 'string') { hash = new Buffer(tx, 'hex') - assert.equal(hash.length, 32, 'Invalid TX hash') + assert.equal(hash.length, 32, 'Expected Transaction or string, got ' + tx) // TxHash hex is big-endian, we need little-endian Array.prototype.reverse.call(hash) } else { - assert(tx instanceof Transaction, 'Expected Transaction, got ' + tx) + assert(tx instanceof Transaction, 'Expected Transaction or string, got ' + tx) hash = crypto.hash256(tx.toBuffer()) }