bitcoinjs-lib/test/networks.js

23 lines
544 B
JavaScript
Raw Normal View History

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