From 1d782c0e53b39565094b36061c30b7c784619dac Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 30 May 2018 06:56:51 -0400 Subject: [PATCH] emit contractsDeployed event only --- lib/contracts/deploy_manager.js | 8 ++------ lib/core/engine.js | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index d9055e875..d4eb4830d 100644 --- a/lib/contracts/deploy_manager.js +++ b/lib/contracts/deploy_manager.js @@ -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); diff --git a/lib/core/engine.js b/lib/core/engine.js index 71383aac0..012bfcf14 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -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);