Skip to content

Commit

Permalink
fix(ens/logger): add ens contracts to contract manager before deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jrainville committed Mar 5, 2019
1 parent 58ab76d commit d80641c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/embark/src/lib/modules/contracts_manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class ContractsManager {
cb(self.compileError, self.listContracts());
});

self.events.setCommandHandler('contracts:add', (contract) => {
this.contracts[contract.className] = contract;
});

self.events.setCommandHandler('contracts:all', (cb) => {
cb(self.compileError, self.contracts);
});
Expand Down
3 changes: 3 additions & 0 deletions packages/embark/src/lib/modules/ens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,14 @@ class ENS {
});
},
function registry(next) {
self.events.request('contracts:add', self.ensConfig.ENSRegistry);
self.events.request('deploy:contract', self.ensConfig.ENSRegistry, (err, _receipt) => {
return next(err);
});
},
function resolver(next) {
self.ensConfig.Resolver.args = [self.ensConfig.ENSRegistry.deployedAddress];
self.events.request('contracts:add', self.ensConfig.Resolver);
self.events.request('deploy:contract', self.ensConfig.Resolver, (err, _receipt) => {
return next(err);
});
Expand All @@ -446,6 +448,7 @@ class ENS {
const contract = self.ensConfig.FIFSRegistrar;
contract.args = [registryAddress, rootNode];

self.events.request('contracts:add', contract);
self.events.request('deploy:contract', contract, (err, _receipt) => {
return next(err);
});
Expand Down

0 comments on commit d80641c

Please sign in to comment.