Transaction: remove untestable assert

Also changes the fromBuffer sanity test to use a clearer message that is
taken from the fixtures.
This commit is contained in:
Daniel Cousens 2014-06-17 00:16:48 +10:00
parent 1b1b550bd6
commit 4850570955
2 changed files with 2 additions and 3 deletions

View file

@ -144,7 +144,6 @@ Transaction.prototype.toBuffer = function () {
}) })
writeUInt32(this.locktime) writeUInt32(this.locktime)
assert.equal(offset, buffer.length, 'Invalid transaction object')
return buffer return buffer
} }
@ -286,7 +285,7 @@ Transaction.fromBuffer = function(buffer) {
} }
tx.locktime = readUInt32() tx.locktime = readUInt32()
assert.equal(offset, buffer.length, 'Invalid transaction') assert.equal(offset, buffer.length, 'Transaction has unexpected data')
return tx return tx
} }

View file

@ -36,7 +36,7 @@ describe('Transaction', function() {
it('throws on ' + f.exception, function() { it('throws on ' + f.exception, function() {
assert.throws(function() { assert.throws(function() {
Transaction.fromHex(f.hex) Transaction.fromHex(f.hex)
}, /Invalid transaction/) }, new RegExp(f.exception))
}) })
}) })
}) })