convert to average
Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
parent
d2b89f88f9
commit
c5a39649b9
|
@ -51,7 +51,9 @@ class GasEstimator {
|
||||||
} else if (_.isEqual(variance[0], variance[1]) && _.isEqual(variance[1], variance[2])) {
|
} else if (_.isEqual(variance[0], variance[1]) && _.isEqual(variance[1], variance[2])) {
|
||||||
gasMap[name] = variance[0];
|
gasMap[name] = variance[0];
|
||||||
} else {
|
} else {
|
||||||
gasMap[name] = 'infinite';
|
let sum = _.reduce(variance, function(memo, num) { return memo + num; }, 0);
|
||||||
|
let average = sum / variance.length;
|
||||||
|
gasMap[name] = average;
|
||||||
}
|
}
|
||||||
return gasCb(null, name, abiMethod.type);
|
return gasCb(null, name, abiMethod.type);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue