From 04684b74f1868e93eb49d8360e33c21503d6b603 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 1 Apr 2014 15:52:40 +1100 Subject: [PATCH] Some cosmetic fixes --- src/hdwallet.js | 4 +++- test/wallet.js | 44 ++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/hdwallet.js b/src/hdwallet.js index b47d4a9..6f18dda 100644 --- a/src/hdwallet.js +++ b/src/hdwallet.js @@ -81,9 +81,11 @@ HDWallet.fromBytes = function(input) { for(var name in Network) { var network = Network[name] + for(var t in network.hdVersions) { if (versionWord != network.hdVersions[t]) continue - type = t + + type = t hd.network = name } } diff --git a/test/wallet.js b/test/wallet.js index 5bcd7c0..c4fe9c1 100644 --- a/test/wallet.js +++ b/test/wallet.js @@ -395,23 +395,23 @@ describe('Wallet', function() { // set up 3 utxo utxo = [ { - "hash": fakeTxHash(1), - "outputIndex": 0, - "address" : address1, - "value": 400000 // not enough for value - }, - { - "hash": fakeTxHash(2), - "outputIndex": 1, - "address" : address1, - "value": 500000 // enough for only value - }, - { - "hash": fakeTxHash(3), - "outputIndex": 0, - "address" : address2, - "value": 520000 // enough for value and fee - } + "hash": fakeTxHash(1), + "outputIndex": 0, + "address" : address1, + "value": 400000 // not enough for value + }, + { + "hash": fakeTxHash(2), + "outputIndex": 1, + "address" : address1, + "value": 500000 // enough for only value + }, + { + "hash": fakeTxHash(3), + "outputIndex": 0, + "address" : address2, + "value": 520000 // enough for value and fee + } ] wallet.setUnspentOutputs(utxo) }) @@ -445,11 +445,11 @@ describe('Wallet', function() { it('ignores spent outputs', function(){ utxo.push( { - "hash": fakeTxHash(4), - "outputIndex": 0, - "address" : address2, - "value": 530000 // enough but spent before createTx - } + "hash": fakeTxHash(4), + "outputIndex": 0, + "address" : address2, + "value": 530000 // enough but spent before createTx + } ) wallet.setUnspentOutputs(utxo) wallet.outputs[fakeTxHash(4) + ":" + 0].spend = fakeTxHash(5) + ":" + 0