From 1b55af3cb7f0c5e82f14c7a6d7f39bcf90fd392a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 26 Jul 2018 14:50:38 -0400 Subject: [PATCH] conflict in embark js --- lib/modules/ens/index.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index dbef23bc7..79f051ac2 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -1,6 +1,7 @@ const fs = require('../../core/fs.js'); const utils = require('../../utils/utils.js'); const namehash = require('eth-ens-namehash'); +const async = require('async'); class ENS { constructor(embark, _options) { @@ -14,11 +15,24 @@ class ENS { this.addENSToEmbarkJS(); this.configureContracts(); - self.embark.registerActionForEvent("contracts:deploy:afterAll", (cb) => { - self.events.request('contracts:contract', "ENSRegistry", (contract) => { + self.embark.registerActionForEvent("contracts:deploy:afterAll", (cb) => { + async.parallel([ + function getENSRegistry(paraCb) { + self.events.request('contracts:contract', "ENSRegistry", (contract) => { + paraCb(null, contract); + }); + }, + function getRegistrar(paraCb) { + self.events.request('contracts:contract', "FIFSRegistrar", (contract) => { + paraCb(null, contract); + }); + } + ], (err, results) => { let config = { - abi: contract.abiDefinition, - address: contract.deployedAddress + registryAbi: results[0].abiDefinition, + registryAddress: results[0].deployedAddress, + registrarAbi: results[1].abiDefinition, + registrarAddress: results[1].deployedAddress }; self.addSetProvider(config); cb();