From bb9f058b15a271fdad7c1b9aeaf7f78b58b1dec9 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 25 Jul 2018 16:12:17 -0400 Subject: [PATCH] small cleanups --- lib/modules/ens/index.js | 6 ++++-- test_apps/test_app/test/ens_spec.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index 3bbbae49..ab661d5a 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -3,6 +3,8 @@ const utils = require('../../utils/utils.js'); const namehash = require('eth-ens-namehash'); const async = require('async'); +const reverseAddrSuffix = '.addr.reverse'; + class ENS { constructor(embark, _options) { this.logger = embark.logger; @@ -90,7 +92,7 @@ class ENS { async.each(Object.keys(self.registration.subdomains), (subDomainName, eachCb) => { const address = self.registration.subdomains[subDomainName]; - const reverseNode = utils.soliditySha3(address.toLowerCase().substr(2) + '.addr.reverse'); + const reverseNode = utils.soliditySha3(address.toLowerCase().substr(2) + reverseAddrSuffix); register(ens, registrar, resolver, defaultAccount, subDomainName, self.registration.rootDomain, reverseNode, address, self.logger, eachCb); }, cb); @@ -197,7 +199,7 @@ class ENS { "onDeploy": [ `ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => { ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send(); - var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '.addr.reverse'); + var reverseNode = web3.utils.soliditySha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '${reverseAddrSuffix}'); ENSRegistry.methods.setResolver(reverseNode, "$Resolver").send(); Resolver.methods.setAddr('${rootNode}', web3.eth.defaultAccount).send(); Resolver.methods.setName(reverseNode, '${this.registration.rootDomain}').send(); diff --git a/test_apps/test_app/test/ens_spec.js b/test_apps/test_app/test/ens_spec.js index 8dfc012d..200f2634 100644 --- a/test_apps/test_app/test/ens_spec.js +++ b/test_apps/test_app/test/ens_spec.js @@ -32,7 +32,7 @@ contract("ENS", function () { // Wait for onDeploy to finish setTimeout(function () { done(); - }, 100); + }, 500); }); it("should have registered embark.eth", async function () {