more patchy mcpatchface

Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-06-12 12:54:41 -05:00
parent 3ede75ce50
commit 41f77793f4
1 changed files with 5 additions and 8 deletions

View File

@ -25,21 +25,18 @@ class GasEstimator {
if (abiMethod.type === "constructor") {
// already provided for us
gasMap['constructor'] = contract.gasEstimates.creation.totalCost.toString();
gasCb(null);
gasCb();
} else if (abiMethod.type === "fallback") {
gasMap['fallback'] = contract.gasEstimates.external[""].toString();
gasCb(null);
gasCb();
} else if (abiMethod.inputs === null || abiMethod.inputs === undefined || abiMethod.inputs.length === 0) {
// just run it and register it
contractObj.methods[name]
.apply(contractObj.methods[name], [])
.estimateGas((err, gasAmount) => {
if (err) {
return gasCb(err);
} else {
gasMap[name] = gasAmount;
gasCb(null, gasAmount, name);
}
if (err) return gasCb(err);
gasMap[name] = gasAmount;
gasCb();
});
} else {
// async concatenate all the fuzz values and their gas cost outputs and check for equality