bitcoinjs-lib/test/networks.js

23 lines
544 B
JavaScript
Raw Normal View History

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')
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]
2015-03-16 12:35:49 +11:00
it(extb58 + ' auto-detects ' + f.network, function () {
2015-05-07 11:29:20 +10:00
assert.strictEqual(HDNode.fromBase58(extb58).keyPair.network, network)
})
2014-06-17 14:48:06 +08:00
})
})
})