You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
'use strict';
|
|
|
|
var expect = require('chai').expect;
|
|
var should = require('chai').should();
|
|
var bitcore = require('..');
|
|
var networks = bitcore.Networks;
|
|
|
|
describe('Networks', function() {
|
|
|
|
it('should contain all Networks', function() {
|
|
should.exist(networks.livenet);
|
|
should.exist(networks.testnet);
|
|
should.exist(networks.defaultNetwork);
|
|
});
|
|
|
|
var constants = ['name', 'alias', 'pubkeyhash', 'scripthash', 'xpubkey', 'xprivkey'];
|
|
|
|
constants.forEach(function(key){
|
|
it('should have constant '+key+' for livenet and testnet', function(){
|
|
networks.testnet.hasOwnProperty(key).should.equal(true);
|
|
networks.livenet.hasOwnProperty(key).should.equal(true);
|
|
});
|
|
});
|
|
|
|
it('tests only for the specified key', function() {
|
|
expect(networks.get(0x6f, 'pubkeyhash')).to.equal(networks.testnet);
|
|
expect(networks.get(0x6f, 'privatekey')).to.equal(undefined);
|
|
});
|
|
|
|
it('converts to string using the "name" property', function() {
|
|
networks.livenet.toString().should.equal('livenet');
|
|
});
|
|
|
|
});
|
|
|