From e95efbfc545e3937232be75e7721365928738690 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/embarkjs.js | 2 ++ test_apps/test_app/test/ens_spec.js | 18 ++++++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/modules/ens/embarkjs.js b/lib/modules/ens/embarkjs.js index 4b8a11213..8cd72d19f 100644 --- a/lib/modules/ens/embarkjs.js +++ b/lib/modules/ens/embarkjs.js @@ -153,6 +153,8 @@ __embarkENS.setProvider = function (config) { self.registration = config.registration; self.env = config.env; EmbarkJS.onReady(() => { + self.registration = config.registration; + web3.eth.net.getId() .then((id) => { const registryAddress = self.registryAddresses[id] || config.registryAddress; diff --git a/test_apps/test_app/test/ens_spec.js b/test_apps/test_app/test/ens_spec.js index 7c564734f..200f2634f 100644 --- a/test_apps/test_app/test/ens_spec.js +++ b/test_apps/test_app/test/ens_spec.js @@ -17,28 +17,22 @@ config({ "args": ["$ENSRegistry", rootNode], "onDeploy": [ `ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => { - ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send(); - Resolver.methods.setAddr('${rootNode}', '${address}').send().then(() => { - global.ensTestReady = true; - }); - });` + ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send(); + Resolver.methods.setAddr('${rootNode}', '${address}').send(); + })` ] } } }); contract("ENS", function () { - this.timeout(1000); + this.timeout(0); before(function (done) { // Wait for onDeploy to finish - const wait = setInterval(() => { - if (!global.ensTestReady) { - return; - } - clearInterval(wait); + setTimeout(function () { done(); - }, 50); + }, 500); }); it("should have registered embark.eth", async function () {