From eae1638b32ccd1dc64071fed7dc101ab491d5099 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Tue, 10 Feb 2015 18:48:07 -0300 Subject: [PATCH] add coverage --- test/transaction/transaction.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/transaction/transaction.js b/test/transaction/transaction.js index dccd7b0..68648e1 100644 --- a/test/transaction/transaction.js +++ b/test/transaction/transaction.js @@ -120,6 +120,8 @@ describe('Transaction', function() { script: Script.buildPublicKeyHashOut(fromAddress).toString(), satoshis: 100000 }; + var weirdUtxoWith100000Satoshis = JSON.parse(JSON.stringify(simpleUtxoWith100000Satoshis)); + weirdUtxoWith100000Satoshis.script = new Script().add('OP_TRUE'); var toAddress = 'mrU9pEmAx26HcbKVrABvgL7AwA5fjNFoDc'; var changeAddress = 'mgBCJAsvzgT2qNNeXsoECg2uPKrUsZ76up'; var changeAddressP2SH = '2N7T3TAetJrSCruQ39aNrJvYLhG1LJosujf'; @@ -488,6 +490,12 @@ describe('Transaction', function() { }).to.throw(errors.Transaction.NLockTimeOutOfRange); }); }); + it('handles weird output', function() { + var transaction = new Transaction() + .from(weirdUtxoWith100000Satoshis) + .to(toAddress, 50000); + should.exist(transaction); + }); }); var tx_empty_hex = '01000000000000000000';