2015-03-16 12:35:49 +11:00
|
|
|
/* global describe, it */
|
2015-02-23 10:36:57 +11:00
|
|
|
|
2014-06-17 14:48:06 +08:00
|
|
|
var assert = require('assert')
|
|
|
|
var networks = require('../src/networks')
|
2014-11-27 17:10:26 +11:00
|
|
|
|
|
|
|
var HDNode = require('../src/hdnode')
|
2014-06-17 14:48:06 +08:00
|
|
|
|
2014-06-18 17:27:36 +10:00
|
|
|
var fixtures = require('./fixtures/network')
|
|
|
|
|
2015-02-23 10:36:57 +11:00
|
|
|
describe('networks', function () {
|
2015-03-16 12:35:49 +11:00
|
|
|
fixtures.forEach(function (f) {
|
|
|
|
var network = networks[f.network]
|
2014-06-17 14:48:06 +08:00
|
|
|
|
2015-03-16 12:35:49 +11:00
|
|
|
Object.keys(f.bip32).forEach(function (name) {
|
|
|
|
var extb58 = f.bip32[name]
|
2014-06-17 23:35:40 +08:00
|
|
|
|
2015-03-16 12:35:49 +11:00
|
|
|
it(extb58 + ' auto-detects ' + f.network, function () {
|
2015-03-02 16:48:36 +11:00
|
|
|
assert.equal(HDNode.fromBase58(extb58).keyPair.network, network)
|
2014-06-17 16:23:09 +08:00
|
|
|
})
|
2014-06-17 14:48:06 +08:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|