diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js index 02beae5d2..ae1f46d20 100644 --- a/cmd/cmd_controller.js +++ b/cmd/cmd_controller.js @@ -291,9 +291,7 @@ class EmbarkController { engine.startService("namingSystem"); engine.startService("console"); engine.startService("pluginCommand"); - engine.events.on('check:backOnline:Ethereum', function () { - callback(); - }); + engine.events.on('check:backOnline:Ethereum', () => callback()); }, function ipcConnect(callback) { // Do specific work in case we are connected to a socket: diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index 3931e7817..e01f2f9cb 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -29,8 +29,12 @@ const DEFAULT_ENS_CONTRACTS_CONFIG = { } }; +const MAINNET_ID = '1'; +const ROPSTEN_ID = '3'; +const RINKEBY_ID = '4'; + const ENS_CONTRACTS_CONFIG = { - "1": { + [MAINNET_ID]: { "contracts": { "ENSRegistry": { "address": "0x314159265dd8dbb310642f98f50c066173c1259b", @@ -44,7 +48,7 @@ const ENS_CONTRACTS_CONFIG = { } } }, - "3": { + [ROPSTEN_ID]: { "contracts": { "ENSRegistry": { "address": "0x112234455c3a32fd11230c42e7bccd4a84e02010", @@ -58,7 +62,7 @@ const ENS_CONTRACTS_CONFIG = { } } }, - "4": { + [RINKEBY_ID]: { "contracts": { "ENSRegistry": { "address": "0xe7410170f87102DF0055eB195163A03B7F2Bff4A", @@ -143,9 +147,9 @@ class ENS { } self.events.request('blockchain:networkId', (networkId) => { - const isKnownNetworks = Object.keys(ENS_CONTRACTS_CONFIG).includes(networkId); + const isKnownNetwork = Object.keys(ENS_CONTRACTS_CONFIG).includes(networkId); const shouldRegisterSubdomain = self.registration && self.registration.subdomains && Object.keys(self.registration.subdomains).length; - if (isKnownNetworks || !shouldRegisterSubdomain) { + if (isKnownNetwork || !shouldRegisterSubdomain) { return cb(); } self.registerConfigDomains(config, cb);