mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-20 01:18:52 +00:00
rebase fixes
This commit is contained in:
parent
3d965a42b5
commit
4e881cd291
@ -49,7 +49,37 @@ class DeployManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.logger.info(__("deploying contracts"));
|
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 {
|
try {
|
||||||
async.auto(contractDeploys, 1, function(_err, _results) {
|
async.auto(contractDeploys, 1, function(_err, _results) {
|
||||||
@ -71,9 +101,7 @@ class DeployManager {
|
|||||||
done(__('Error deploying'));
|
done(__('Error deploying'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.logger.info(__("finished deploying contracts"));
|
]);
|
||||||
done(err);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user