The gasEstimates objects must always be present in the jsonCompiler even if empty (backwards compat)

This commit is contained in:
Alex Beregszaszi 2017-04-11 10:01:24 +01:00
parent 3fbb48bd46
commit fe4fccaaf2

View File

@ -70,8 +70,10 @@ Json::Value estimateGas(CompilerStack const& _compiler, string const& _contract)
creation[1] = estimates["creation"]["codeDepositCost"];
output["creation"] = creation;
}
output["external"] = estimates["external"];
output["internal"] = estimates["internal"];
else
output["creation"] = Json::objectValue;
output["external"] = estimates.get("external", Json::objectValue);
output["internal"] = estimates.get("internal", Json::objectValue);
return output;
}