fix possible double callback
This commit is contained in:
parent
faaefd349c
commit
cb8fd1cf31
|
@ -133,8 +133,7 @@ class DeployManager {
|
|||
return callback(new Error("error running afterDeploy"));
|
||||
}
|
||||
|
||||
// TODO: convert to for to avoid repeated callback
|
||||
for(let cmd of onDeployCode) {
|
||||
async.each(onDeployCode, (cmd, eachCb) => {
|
||||
self.logger.info("executing: " + cmd);
|
||||
try {
|
||||
RunCode.doEval(cmd, web3);
|
||||
|
@ -142,11 +141,14 @@ class DeployManager {
|
|||
if (e.message.indexOf("invalid opcode") >= 0) {
|
||||
self.logger.error('the transaction was rejected; this usually happens due to a throw or a require, it can also happen due to an invalid operation');
|
||||
}
|
||||
return callback(new Error(e));
|
||||
return eachCb(new Error(e));
|
||||
}
|
||||
}
|
||||
eachCb();
|
||||
}, (err) => {
|
||||
callback(err, contractsManager);
|
||||
});
|
||||
|
||||
|
||||
callback(null, contractsManager);
|
||||
}
|
||||
], function (err, result) {
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in New Issue