aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/GasMeter.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-01 19:06:36 +0800
committerchriseth <chris@ethereum.org>2018-03-05 18:36:33 +0800
commit6ec4517929e8c0eca022f4771ba217db5d80beed (patch)
treeece2e275ee9bb190d33e05cef5cc549b21abf8e3 /test/libsolidity/GasMeter.cpp
parent5a54cd5c708227ad6982b06de7b799ece5065917 (diff)
downloaddexon-solidity-6ec4517929e8c0eca022f4771ba217db5d80beed.tar.gz
dexon-solidity-6ec4517929e8c0eca022f4771ba217db5d80beed.tar.zst
dexon-solidity-6ec4517929e8c0eca022f4771ba217db5d80beed.zip
Use EVM version in gas meter and optimizer.
Diffstat (limited to 'test/libsolidity/GasMeter.cpp')
-rw-r--r--test/libsolidity/GasMeter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index 105a0398..fd2017f9 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -56,7 +56,7 @@ public:
ASTNode const& sourceUnit = m_compiler.ast("");
BOOST_REQUIRE(items != nullptr);
m_gasCosts = GasEstimator::breakToStatementLevel(
- GasEstimator::structuralEstimation(*items, vector<ASTNode const*>({&sourceUnit})),
+ GasEstimator(dev::test::Options::get().evmVersion()).structuralEstimation(*items, vector<ASTNode const*>({&sourceUnit})),
{&sourceUnit}
);
}
@@ -65,7 +65,7 @@ public:
{
compileAndRun(_sourceCode);
auto state = make_shared<KnownState>();
- PathGasMeter meter(*m_compiler.assemblyItems(m_compiler.lastContractName()));
+ PathGasMeter meter(*m_compiler.assemblyItems(m_compiler.lastContractName()), dev::test::Options::get().evmVersion());
GasMeter::GasConsumption gas = meter.estimateMax(0, state);
u256 bytecodeSize(m_compiler.runtimeObject(m_compiler.lastContractName()).bytecode.size());
// costs for deployment
@@ -74,7 +74,7 @@ public:
gas += gasForTransaction(m_compiler.object(m_compiler.lastContractName()).bytecode, true);
BOOST_REQUIRE(!gas.isInfinite);
- BOOST_CHECK(gas.value == m_gasUsed);
+ BOOST_CHECK_EQUAL(gas.value, m_gasUsed);
}
/// Compares the gas computed by PathGasMeter for the given signature (but unknown arguments)
@@ -91,12 +91,12 @@ public:
gas = max(gas, gasForTransaction(hash.asBytes() + arguments, false));
}
- gas += GasEstimator::functionalEstimation(
+ gas += GasEstimator(dev::test::Options::get().evmVersion()).functionalEstimation(
*m_compiler.runtimeAssemblyItems(m_compiler.lastContractName()),
_sig
);
BOOST_REQUIRE(!gas.isInfinite);
- BOOST_CHECK(gas.value == m_gasUsed);
+ BOOST_CHECK_EQUAL(gas.value, m_gasUsed);
}
static GasMeter::GasConsumption gasForTransaction(bytes const& _data, bool _isCreation)