diff --git a/lib/contracts/contract_deployer.js b/lib/contracts/contract_deployer.js index 04dc7e40..3c817e65 100644 --- a/lib/contracts/contract_deployer.js +++ b/lib/contracts/contract_deployer.js @@ -10,7 +10,6 @@ class ContractDeployer { this.logger = options.logger; this.events = options.events; this.plugins = options.plugins; - this.gasLimit = options.gasLimit; self.events.setCommandHandler('deploy:contract', (contract, cb) => { self.checkAndDeployContract(contract, null, cb); diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index ff70183b..d40aa13c 100644 --- a/lib/contracts/deploy_manager.js +++ b/lib/contracts/deploy_manager.js @@ -18,6 +18,10 @@ class DeployManager { this.deployOnlyOnConfig = false; this.onlyCompile = options.onlyCompile !== undefined ? options.onlyCompile : false; + this.events.setCommandHandler('deploy:setGasLimit', (gasLimit) => { + self.gasLimit = gasLimit; + }); + this.events.setCommandHandler('deploy:contracts', (cb) => { self.deployContracts(cb); }); diff --git a/lib/tests/test.js b/lib/tests/test.js index 060fe34f..6241441e 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -119,8 +119,7 @@ class Test { trackContracts: false //ipcRole: 'client' // disabled for now due to issues with ipc file }); - this.engine.deployManager.gasLimit = 6000000; - this.engine.contractsManager.gasLimit = 6000000; + this.events.request('deploy:setGasLimit', 6000000); } init(callback) {