fix(ens/logger): add ens contracts to contract manager before deploy

This commit is contained in:
Jonathan Rainville 2019-02-25 15:15:34 -05:00
parent 58ab76d2ca
commit d80641c4e1
2 changed files with 7 additions and 0 deletions

View File

@ -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);
});

View File

@ -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);
});
@ -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);
});