aboutsummaryrefslogtreecommitdiffstats
path: root/solc
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-04-07 02:55:46 +0800
committerchriseth <c@ethdev.com>2016-04-07 02:56:00 +0800
commitf227050c203fd0da70fcefbbecc922fd16045aa6 (patch)
tree40ad7d2e00f051368349bdfc017a0d4b455d8313 /solc
parent193b1c940ce3e21d52e2cbdd253c1d7cb820fa06 (diff)
downloaddexon-solidity-f227050c203fd0da70fcefbbecc922fd16045aa6.tar.gz
dexon-solidity-f227050c203fd0da70fcefbbecc922fd16045aa6.tar.zst
dexon-solidity-f227050c203fd0da70fcefbbecc922fd16045aa6.zip
Make solidity independent from ethcore.
Diffstat (limited to 'solc')
-rw-r--r--solc/CommandLineInterface.cpp6
-rw-r--r--solc/jsonCompiler.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index d82a2442..7f7655f2 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -35,6 +35,7 @@
#include <libdevcore/CommonData.h>
#include <libdevcore/CommonIO.h>
#include <libevmasm/Instruction.h>
+#include <libevmasm/GasMeter.h>
#include <libsolidity/interface/Version.h>
#include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h>
@@ -240,7 +241,6 @@ void CommandLineInterface::handleMeta(DocumentationType _type, string const& _co
void CommandLineInterface::handleGasEstimation(string const& _contract)
{
- eth::EVMSchedule schedule; // TODO: make it relevant to the SealEngine/EnvInfo.
using Gas = GasEstimator::GasConsumption;
if (!m_compiler->assemblyItems(_contract) && !m_compiler->runtimeAssemblyItems(_contract))
return;
@@ -250,8 +250,8 @@ void CommandLineInterface::handleGasEstimation(string const& _contract)
Gas gas = GasEstimator::functionalEstimation(*items);
u256 bytecodeSize(m_compiler->runtimeObject(_contract).bytecode.size());
cout << "construction:" << endl;
- cout << " " << gas << " + " << (bytecodeSize * schedule.createDataGas) << " = ";
- gas += bytecodeSize * schedule.createDataGas;
+ cout << " " << gas << " + " << (bytecodeSize * eth::GasCosts::createDataGas) << " = ";
+ gas += bytecodeSize * eth::GasCosts::createDataGas;
cout << gas << endl;
}
if (eth::AssemblyItems const* items = m_compiler->runtimeAssemblyItems(_contract))
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp
index 1c20d695..eaf83705 100644
--- a/solc/jsonCompiler.cpp
+++ b/solc/jsonCompiler.cpp
@@ -28,6 +28,7 @@
#include <libdevcore/CommonData.h>
#include <libdevcore/CommonIO.h>
#include <libevmasm/Instruction.h>
+#include <libevmasm/GasMeter.h>
#include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h>
#include <libsolidity/ast/ASTPrinter.h>
@@ -77,7 +78,6 @@ Json::Value gasToJson(GasEstimator::GasConsumption const& _gas)
Json::Value estimateGas(CompilerStack const& _compiler, string const& _contract)
{
- eth::EVMSchedule schedule;
Json::Value gasEstimates(Json::objectValue);
using Gas = GasEstimator::GasConsumption;
if (!_compiler.assemblyItems(_contract) && !_compiler.runtimeAssemblyItems(_contract))
@@ -88,7 +88,7 @@ Json::Value estimateGas(CompilerStack const& _compiler, string const& _contract)
u256 bytecodeSize(_compiler.runtimeObject(_contract).bytecode.size());
Json::Value creationGas(Json::arrayValue);
creationGas[0] = gasToJson(gas);
- creationGas[1] = gasToJson(bytecodeSize * schedule.createDataGas);
+ creationGas[1] = gasToJson(bytecodeSize * eth::GasCosts::createDataGas);
gasEstimates["creation"] = creationGas;
}
if (eth::AssemblyItems const* items = _compiler.runtimeAssemblyItems(_contract))