set gas limit through event

This commit is contained in:
Iuri Matias 2018-07-27 12:44:08 -04:00
parent 89a0729002
commit 499a3b5609
3 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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);
});

View File

@ -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) {