From ee651df635d4c340821b74e070415e0a521c729a Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Sat, 23 May 2015 20:28:33 -0400 Subject: [PATCH] Added test for null input for transaction.verify() --- test/transaction/transaction.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/transaction/transaction.js b/test/transaction/transaction.js index 673a52f..77ae014 100644 --- a/test/transaction/transaction.js +++ b/test/transaction/transaction.js @@ -520,6 +520,23 @@ describe('Transaction', function() { }); + it('not if has null input (and not coinbase)', function() { + + var tx = new Transaction() + .from({ + 'txId': testPrevTx, + 'outputIndex': 0, + 'script': testScript, + 'satoshis': testAmount + }).to('mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc', testAmount - 10000); + + tx.isCoinbase = sinon.stub().returns(false); + tx.inputs[0].isNull = sinon.stub().returns(true); + var verify = tx.verify(); + verify.should.equal('transaction input 0 has null input'); + + }); + }); describe('to and from JSON', function() {