fix(@embark/cockpit): fix gas estimation

This commit is contained in:
Andre Medeiros 2019-01-22 09:57:08 -05:00 committed by Iuri Matias
parent 1d459e45b1
commit 43fed4f3e5

View File

@ -1,4 +1,3 @@
/*global web3*/
const async = require('async');
const ContractFuzzer = require('./fuzzer.js');
@ -13,6 +12,7 @@ class GasEstimator {
estimateGas(contractName, cb) {
const self = this;
let gasMap = {};
self.events.request('blockchain:object', ({ web3 }) => {
self.events.request('contracts:contract', contractName, (contract) => {
let fuzzMap = self.fuzzer.generateFuzz(3, contract);
let contractObj = new web3.eth.Contract(contract.abiDefinition, contract.deployedAddress);
@ -71,6 +71,7 @@ class GasEstimator {
}
);
});
});
}
}