Fix tests, address commentary from @braydonf.

This commit is contained in:
Eric Martindale 2015-03-24 17:57:39 -04:00
parent a7d75cb25b
commit c759401373
2 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ function addNetwork(data) {
}); });
_.each(_.values(network), function(value) { _.each(_.values(network), function(value) {
if (value && !_.isObject(value)) { if (!_.isUndefined(value) && !_.isObject(value)) {
networkMaps[value] = network; networkMaps[value] = network;
} }
}); });

View File

@ -20,7 +20,7 @@ describe('Networks', function() {
pubkeyhash: 0x10, pubkeyhash: 0x10,
privatekey: 0x90, privatekey: 0x90,
scripthash: 0x08, scripthash: 0x08,
xpubkey: 0x0278b20e, xpubkey: 0x0278b20e,
xprivkey: 0x0278ade4, xprivkey: 0x0278ade4,
networkMagic: 0xe7beb4d4, networkMagic: 0xe7beb4d4,
port: 20001, port: 20001,
@ -47,7 +47,7 @@ describe('Networks', function() {
pubkeyhash: 0x13, pubkeyhash: 0x13,
privatekey: 0x93, privatekey: 0x93,
scripthash: 0x11, scripthash: 0x11,
xpubkey: 0x0278b20f, xpubkey: 0x0278b20f,
xprivkey: 0x0278ade5, xprivkey: 0x0278ade5,
networkMagic: 0xe7beb4d5, networkMagic: 0xe7beb4d5,
port: 20008, port: 20008,
@ -57,7 +57,7 @@ describe('Networks', function() {
}; };
networks.add(custom); networks.add(custom);
var network = networks.get(undefined); var network = networks.get(undefined);
should.not.exist( network ); should.not.exist(network);
}); });
var constants = ['name', 'alias', 'pubkeyhash', 'scripthash', 'xpubkey', 'xprivkey']; var constants = ['name', 'alias', 'pubkeyhash', 'scripthash', 'xpubkey', 'xprivkey'];