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