Browse Source

tests: test autodetect in networks, fixed networks in HDNode

hk-custom-address
Daniel Cousens 10 years ago
parent
commit
57856a0a25
  1. 6
      test/hdnode.js
  2. 2
      test/network.js

6
test/hdnode.js

@ -144,17 +144,21 @@ describe('HDNode', function () {
describe('fromBase58', function () {
fixtures.valid.forEach(function (f) {
it('imports ' + f.master.base58 + ' (public) correctly', function () {
var network = networks[f.network]
var hd = HDNode.fromBase58(f.master.base58)
assert.equal(hd.toBase58(), f.master.base58)
assert.equal(hd.network, network)
})
})
fixtures.valid.forEach(function (f) {
it('imports ' + f.master.base58Priv + ' (private) correctly', function () {
var hd = HDNode.fromBase58(f.master.base58Priv)
var network = networks[f.network]
var hd = HDNode.fromBase58(f.master.base58Priv, network)
assert.equal(hd.toBase58(), f.master.base58Priv)
assert.equal(hd.network, network)
})
})

2
test/network.js

@ -27,7 +27,7 @@ describe('networks', function () {
var extb58 = f.bip32[name]
it('resolves ' + extb58 + ' to ' + f.network, function () {
assert.equal(HDNode.fromBase58(extb58, network).network, network)
assert.equal(HDNode.fromBase58(extb58).network, network)
})
})
})

Loading…
Cancel
Save