rebase fixes

This commit is contained in:
Iuri Matias 2018-09-29 21:13:55 -04:00 committed by Pascal Precht
parent 3d965a42b5
commit 4e881cd291
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D

View File

@ -49,7 +49,37 @@ class DeployManager {
}
self.logger.info(__("deploying contracts"));
self.events.emit("deploy:beforeAll");
async.waterfall([
function (next) {
self.plugins.emitAndRunActionsForEvent("deploy:beforeAll", next);
},
function () {
const contractDeploys = {};
const errors = [];
contracts.forEach(contract => {
function deploy(result, callback) {
if (typeof result === 'function') {
callback = result;
}
contract._gasLimit = self.gasLimit;
self.events.request('deploy:contract', contract, (err) => {
if (err) {
contract.error = err.message || err;
self.logger.error(err.message || err);
errors.push(err);
}
callback();
});
}
const className = contract.className;
if (!contractDependencies[className] || contractDependencies[className].length === 0) {
contractDeploys[className] = deploy;
return;
}
contractDeploys[className] = cloneDeep(contractDependencies[className]);
contractDeploys[className].push(deploy);
});
try {
async.auto(contractDeploys, 1, function(_err, _results) {
@ -71,9 +101,7 @@ class DeployManager {
done(__('Error deploying'));
}
}
self.logger.info(__("finished deploying contracts"));
done(err);
});
]);
});
});
}