Browse Source

removed Networks.all and associated test

patch-2
Brandon Roberts 10 years ago
parent
commit
783c59d99e
  1. 12
      lib/networks.js
  2. 24
      test/networks.js

12
lib/networks.js

@ -18,15 +18,6 @@ Network.prototype.toString = function toString() {
return this.name;
};
/**
* @member Networks#all
* Retrieves all networks registered.
* @return Array
*/
function all() {
return networks;
}
/**
* @function
* @member Networks#get
@ -181,6 +172,5 @@ module.exports = {
livenet: livenet,
mainnet: livenet,
testnet: testnet,
get: get,
all: all
get: get
};

24
test/networks.js

@ -49,30 +49,6 @@ describe('Networks', function() {
should.equal(net, undefined);
});
it('can return custom networks', function() {
var custom = {
name: 'customnet',
alias: 'mynet',
pubkeyhash: 0x10,
privatekey: 0x90,
scripthash: 0x08,
xpubkey: 0x0278b20e,
xprivkey: 0x0278ade4,
networkMagic: 0xe7beb4d4,
port: 20001,
dnsSeeds: [
'localhost',
'mynet.localhost'
]
};
networks.add(custom);
customnet = networks.get('customnet');
var allNetworks = networks.all();
var customInOutput = allNetworks.indexOf(customnet) > -1;
should.equal(customInOutput, true);
networks.remove(customnet);
});
it('should not set a network map for an undefined value', function() {
var custom = {
name: 'somenet',

Loading…
Cancel
Save