emit contractsDeployed event only

This commit is contained in:
Iuri Matias 2018-05-30 06:56:51 -04:00
parent 68e6782f49
commit 1d782c0e53
2 changed files with 4 additions and 8 deletions

View File

@ -1,9 +1,5 @@
let async = require('async');
// TODO: remove contractsManager dependency
// * use events
// * in the engine use the instance instead
class DeployManager {
constructor(options) {
const self = this;
@ -76,7 +72,7 @@ class DeployManager {
// TODO: shouldn't be necessary
function checkCompileOnly(callback){
if(self.onlyCompile){
self.events.emit('contractsDeployed', self.contractsManager);
self.events.emit('contractsDeployed');
return done();
}
return callback();
@ -101,7 +97,7 @@ class DeployManager {
function deployAllContracts(callback) {
self.deployAll(function (err) {
if (!err) {
self.events.emit('contractsDeployed', self.contractsManager);
self.events.emit('contractsDeployed');
}
if (err && self.fatalErrors) {
return callback(err);

View File

@ -189,8 +189,8 @@ class Engine {
generateCode(tasks[tasks.length - 1].contractsManager);
self.events.once('outputDone', callback);
});
const addToCargo = function (contractsManager) {
cargo.push({contractsManager});
const addToCargo = function () {
cargo.push({contractsManager: self.contractsManager});
};
this.events.on('contractsDeployed', addToCargo);