diff --git a/lib/modules/gasEstimator/index.js b/lib/modules/gasEstimator/index.js index 65d7c956f..2bad5a2c2 100644 --- a/lib/modules/gasEstimator/index.js +++ b/lib/modules/gasEstimator/index.js @@ -51,9 +51,9 @@ class GasEstimator { } else if (_.isEqual(variance[0], variance[1]) && _.isEqual(variance[1], variance[2])) { gasMap[name] = variance[0]; } else { + // get average let sum = _.reduce(variance, function(memo, num) { return memo + num; }, 0); - let average = sum / variance.length; - gasMap[name] = average; + gasMap[name] = sum / variance.length; } return gasCb(null, name, abiMethod.type); });