Merge pull request #5113 from ethereum/compilerstack-datagas

Use GasEstimator::dataGas in CompilerStack
This commit is contained in:
chriseth 2018-10-01 13:20:38 +02:00 committed by GitHub
commit 5ae32b24a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);