remove contracts manager dependency from deploy manager

This commit is contained in:
Iuri Matias 2018-05-30 07:01:22 -04:00
parent 1d782c0e53
commit 45f7767313
3 changed files with 9 additions and 5 deletions

View File

@ -34,6 +34,13 @@ class ContractsManager {
cb(self.getContract(contractName));
});
self.events.setCommandHandler("contracts:build", (configOnly, cb) => {
self.deployOnlyOnConfig = configOnly; // temporary, should refactor
self.build(() => {
cb();
});
});
self.events.on("deploy:contract:error", (_contract) => {
self.events.emit('contractsState', self.contractsState());
});
@ -45,6 +52,7 @@ class ContractsManager {
self.events.on("deploy:contract:undeployed", (_contract) => {
self.events.emit('contractsState', self.contractsState());
});
}
build(done) {

View File

@ -10,7 +10,6 @@ class DeployManager {
this.events = options.events;
this.plugins = options.plugins;
this.blockchain = options.blockchain;
this.contractsManager = options.contractsManager;
this.gasLimit = false;
this.fatalErrors = false;
this.deployOnlyOnConfig = false;
@ -63,8 +62,7 @@ class DeployManager {
async.waterfall([
function buildContracts(callback) {
self.contractsManager.deployOnlyOnConfig = self.deployOnlyOnConfig; // temporary, should refactor
self.contractsManager.build(() => {
self.events.request("contracts:build", self.deployOnlyOnConfig, (cb) => {
callback();
});
},

View File

@ -234,12 +234,10 @@ class Engine {
this.deployManager = new DeployManager({
blockchain: this.blockchain,
trackContracts: options.trackContracts,
config: this.config,
logger: this.logger,
plugins: this.plugins,
events: this.events,
contractsManager: this.contractsManager,
onlyCompile: options.onlyCompile
});