From 7e12f80edaa6829c8ba9741f6035536ca255fec8 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 28 Sep 2018 15:06:58 +0100 Subject: [PATCH] Address PR feedback --- cmd/cmd_controller.js | 4 +--- lib/modules/ens/index.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/cmd_controller.js b/cmd/cmd_controller.js index 315eec006..66f29b832 100644 --- a/cmd/cmd_controller.js +++ b/cmd/cmd_controller.js @@ -286,9 +286,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);