Use GasEstimator::dataGas in CompilerStack

This commit is contained in:
Alex Beregszaszi 2018-09-19 12:57:50 +01:00
parent f36dee1067
commit d71cc66dde

View File

@ -988,8 +988,7 @@ Json::Value CompilerStack::gasEstimates(string const& _contractName) const
if (eth::AssemblyItems const* items = assemblyItems(_contractName)) if (eth::AssemblyItems const* items = assemblyItems(_contractName))
{ {
Gas executionGas = gasEstimator.functionalEstimation(*items); Gas executionGas = gasEstimator.functionalEstimation(*items);
u256 bytecodeSize(runtimeObject(_contractName).bytecode.size()); Gas codeDepositGas{eth::GasMeter::dataGas(runtimeObject(_contractName).bytecode, false)};
Gas codeDepositGas = bytecodeSize * eth::GasCosts::createDataGas;
Json::Value creation(Json::objectValue); Json::Value creation(Json::objectValue);
creation["codeDepositCost"] = gasToJson(codeDepositGas); creation["codeDepositCost"] = gasToJson(codeDepositGas);