Merge pull request #108 from dcousens/cosmetics

Some cosmetic fixes
This commit is contained in:
Wei Lu 2014-04-01 12:56:13 +08:00
commit 4f578dd5c1
2 changed files with 25 additions and 23 deletions

View file

@ -81,9 +81,11 @@ HDWallet.fromBytes = function(input) {
for(var name in Network) { for(var name in Network) {
var network = Network[name] var network = Network[name]
for(var t in network.hdVersions) { for(var t in network.hdVersions) {
if (versionWord != network.hdVersions[t]) continue if (versionWord != network.hdVersions[t]) continue
type = t
type = t
hd.network = name hd.network = name
} }
} }

View file

@ -395,23 +395,23 @@ describe('Wallet', function() {
// set up 3 utxo // set up 3 utxo
utxo = [ utxo = [
{ {
"hash": fakeTxHash(1), "hash": fakeTxHash(1),
"outputIndex": 0, "outputIndex": 0,
"address" : address1, "address" : address1,
"value": 400000 // not enough for value "value": 400000 // not enough for value
}, },
{ {
"hash": fakeTxHash(2), "hash": fakeTxHash(2),
"outputIndex": 1, "outputIndex": 1,
"address" : address1, "address" : address1,
"value": 500000 // enough for only value "value": 500000 // enough for only value
}, },
{ {
"hash": fakeTxHash(3), "hash": fakeTxHash(3),
"outputIndex": 0, "outputIndex": 0,
"address" : address2, "address" : address2,
"value": 520000 // enough for value and fee "value": 520000 // enough for value and fee
} }
] ]
wallet.setUnspentOutputs(utxo) wallet.setUnspentOutputs(utxo)
}) })
@ -445,11 +445,11 @@ describe('Wallet', function() {
it('ignores spent outputs', function(){ it('ignores spent outputs', function(){
utxo.push( utxo.push(
{ {
"hash": fakeTxHash(4), "hash": fakeTxHash(4),
"outputIndex": 0, "outputIndex": 0,
"address" : address2, "address" : address2,
"value": 530000 // enough but spent before createTx "value": 530000 // enough but spent before createTx
} }
) )
wallet.setUnspentOutputs(utxo) wallet.setUnspentOutputs(utxo)
wallet.outputs[fakeTxHash(4) + ":" + 0].spend = fakeTxHash(5) + ":" + 0 wallet.outputs[fakeTxHash(4) + ":" + 0].spend = fakeTxHash(5) + ":" + 0