tests: test autodetect in networks, fixed networks in HDNode

This commit is contained in:
Daniel Cousens 2015-03-16 11:26:16 +11:00
parent 9e631ceebf
commit 57856a0a25
2 changed files with 6 additions and 2 deletions

View file

@ -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)
})
})

View file

@ -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)
})
})
})