From 69dfd3204d696f9764fa5a81ff4df18132be6553 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 8 Sep 2014 23:21:16 +1000 Subject: [PATCH 1/2] Wallet: add missing variable wallet --- test/wallet.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/wallet.js b/test/wallet.js index 4e49ca8..6ae9ea9 100644 --- a/test/wallet.js +++ b/test/wallet.js @@ -273,6 +273,7 @@ describe('Wallet', function() { describe('setUnspentOutputs', function() { var utxo var expectedOutputKey + var wallet beforeEach(function() { utxo = { From c3f88693864f9fa67d00e8f9c4120763161404d6 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 8 Sep 2014 23:27:01 +1000 Subject: [PATCH 2/2] tests: Wallet test was not comprehensive --- test/wallet.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/wallet.js b/test/wallet.js index 6ae9ea9..dd23587 100644 --- a/test/wallet.js +++ b/test/wallet.js @@ -633,9 +633,11 @@ describe('Wallet', function() { }) it('skips change if it is not above dust threshold', function() { - var fee = 14570 - var tx = wallet.createTx(to, value) - assert.equal(tx.outs.length, 1) + var tx1 = wallet.createTx(to, value - 546) + assert.equal(tx1.outs.length, 1) + + var tx2 = wallet.createTx(to, value - 547) + assert.equal(tx2.outs.length, 2) }) }) })