tests: test autodetect in networks, fixed networks in HDNode
This commit is contained in:
parent
9e631ceebf
commit
57856a0a25
2 changed files with 6 additions and 2 deletions
|
@ -144,17 +144,21 @@ describe('HDNode', function () {
|
||||||
describe('fromBase58', function () {
|
describe('fromBase58', function () {
|
||||||
fixtures.valid.forEach(function (f) {
|
fixtures.valid.forEach(function (f) {
|
||||||
it('imports ' + f.master.base58 + ' (public) correctly', function () {
|
it('imports ' + f.master.base58 + ' (public) correctly', function () {
|
||||||
|
var network = networks[f.network]
|
||||||
var hd = HDNode.fromBase58(f.master.base58)
|
var hd = HDNode.fromBase58(f.master.base58)
|
||||||
|
|
||||||
assert.equal(hd.toBase58(), f.master.base58)
|
assert.equal(hd.toBase58(), f.master.base58)
|
||||||
|
assert.equal(hd.network, network)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
fixtures.valid.forEach(function (f) {
|
fixtures.valid.forEach(function (f) {
|
||||||
it('imports ' + f.master.base58Priv + ' (private) correctly', function () {
|
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.toBase58(), f.master.base58Priv)
|
||||||
|
assert.equal(hd.network, network)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ describe('networks', function () {
|
||||||
var extb58 = f.bip32[name]
|
var extb58 = f.bip32[name]
|
||||||
|
|
||||||
it('resolves ' + extb58 + ' to ' + f.network, function () {
|
it('resolves ' + extb58 + ' to ' + f.network, function () {
|
||||||
assert.equal(HDNode.fromBase58(extb58, network).network, network)
|
assert.equal(HDNode.fromBase58(extb58).network, network)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue