From 485057095558a33d3b5434e77f7608e986a58d1d Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 17 Jun 2014 00:16:48 +1000 Subject: [PATCH] Transaction: remove untestable assert Also changes the fromBuffer sanity test to use a clearer message that is taken from the fixtures. --- src/transaction.js | 3 +-- test/transaction.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/transaction.js b/src/transaction.js index f061c77..d80966b 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -144,7 +144,6 @@ Transaction.prototype.toBuffer = function () { }) writeUInt32(this.locktime) - assert.equal(offset, buffer.length, 'Invalid transaction object') return buffer } @@ -286,7 +285,7 @@ Transaction.fromBuffer = function(buffer) { } tx.locktime = readUInt32() - assert.equal(offset, buffer.length, 'Invalid transaction') + assert.equal(offset, buffer.length, 'Transaction has unexpected data') return tx } diff --git a/test/transaction.js b/test/transaction.js index a7e08c1..6ac97f3 100644 --- a/test/transaction.js +++ b/test/transaction.js @@ -36,7 +36,7 @@ describe('Transaction', function() { it('throws on ' + f.exception, function() { assert.throws(function() { Transaction.fromHex(f.hex) - }, /Invalid transaction/) + }, new RegExp(f.exception)) }) }) })