conflict in embark js

This commit is contained in:
Jonathan Rainville 2018-07-26 14:50:38 -04:00 committed by Iuri Matias
parent 2d0f34f215
commit 1b55af3cb7
1 changed files with 18 additions and 4 deletions

View File

@ -1,6 +1,7 @@
const fs = require('../../core/fs.js'); const fs = require('../../core/fs.js');
const utils = require('../../utils/utils.js'); const utils = require('../../utils/utils.js');
const namehash = require('eth-ens-namehash'); const namehash = require('eth-ens-namehash');
const async = require('async');
class ENS { class ENS {
constructor(embark, _options) { constructor(embark, _options) {
@ -15,10 +16,23 @@ class ENS {
this.configureContracts(); this.configureContracts();
self.embark.registerActionForEvent("contracts:deploy:afterAll", (cb) => { self.embark.registerActionForEvent("contracts:deploy:afterAll", (cb) => {
async.parallel([
function getENSRegistry(paraCb) {
self.events.request('contracts:contract', "ENSRegistry", (contract) => { 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 = { let config = {
abi: contract.abiDefinition, registryAbi: results[0].abiDefinition,
address: contract.deployedAddress registryAddress: results[0].deployedAddress,
registrarAbi: results[1].abiDefinition,
registrarAddress: results[1].deployedAddress
}; };
self.addSetProvider(config); self.addSetProvider(config);
cb(); cb();