diff --git a/src/scripts.js b/src/scripts.js index e58ce99..52824cd 100644 --- a/src/scripts.js +++ b/src/scripts.js @@ -65,8 +65,8 @@ function isPubKeyOutput(script) { function isScriptHashInput(script, allowIncomplete) { if (script.chunks.length < 2) return false - var lastChunk = script.chunks[script.chunks.length - 1] + var lastChunk = script.chunks[script.chunks.length - 1] if (!Buffer.isBuffer(lastChunk)) return false var scriptSig = Script.fromChunks(script.chunks.slice(0, -1)) diff --git a/test/transaction_builder.js b/test/transaction_builder.js index 83ee604..cf14df6 100644 --- a/test/transaction_builder.js +++ b/test/transaction_builder.js @@ -164,7 +164,7 @@ describe('TransactionBuilder', function() { }) fixtures.invalid.build.forEach(function(f) { - describe('for ' + f.description, function() { + describe('for ' + (f.description || f.exception), function() { beforeEach(function() { if (f.txHex) { var tx = Transaction.fromHex(f.txHex) @@ -175,7 +175,7 @@ describe('TransactionBuilder', function() { } }) - it('throws on ' + f.exception, function() { + it('throws', function() { assert.throws(function() { txb.build() }, new RegExp(f.exception))