diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index d9055e87..d4eb4830 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 71383aac..012bfcf1 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);