aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/GasMeter.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-22 03:35:27 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-10-19 06:32:33 +0800
commit039cc25b1fd875e9f4cfd0f0649f2b4ed67640e1 (patch)
tree9ce832cfbff61de9911817bbfd4c09a833a61ca9 /test/libsolidity/GasMeter.cpp
parent7454a766b37951674095afdd0c8573713e2511a4 (diff)
downloaddexon-solidity-039cc25b1fd875e9f4cfd0f0649f2b4ed67640e1.tar.gz
dexon-solidity-039cc25b1fd875e9f4cfd0f0649f2b4ed67640e1.tar.zst
dexon-solidity-039cc25b1fd875e9f4cfd0f0649f2b4ed67640e1.zip
Always require a contract/sourceName in CompilerStack
Diffstat (limited to 'test/libsolidity/GasMeter.cpp')
-rw-r--r--test/libsolidity/GasMeter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp
index c2886f5b..83d24f6c 100644
--- a/test/libsolidity/GasMeter.cpp
+++ b/test/libsolidity/GasMeter.cpp
@@ -52,7 +52,7 @@ public:
BOOST_REQUIRE_MESSAGE(m_compiler.compile(), "Compiling contract failed");
AssemblyItems const* items = m_compiler.runtimeAssemblyItems("");
- ASTNode const& sourceUnit = m_compiler.ast();
+ ASTNode const& sourceUnit = m_compiler.ast("");
BOOST_REQUIRE(items != nullptr);
m_gasCosts = GasEstimator::breakToStatementLevel(
GasEstimator::structuralEstimation(*items, vector<ASTNode const*>({&sourceUnit})),
@@ -64,13 +64,13 @@ public:
{
compileAndRun(_sourceCode);
auto state = make_shared<KnownState>();
- PathGasMeter meter(*m_compiler.assemblyItems());
+ PathGasMeter meter(*m_compiler.assemblyItems(""));
GasMeter::GasConsumption gas = meter.estimateMax(0, state);
- u256 bytecodeSize(m_compiler.runtimeObject().bytecode.size());
+ u256 bytecodeSize(m_compiler.runtimeObject("").bytecode.size());
// costs for deployment
gas += bytecodeSize * GasCosts::createDataGas;
// costs for transaction
- gas += gasForTransaction(m_compiler.object().bytecode, true);
+ gas += gasForTransaction(m_compiler.object("").bytecode, true);
BOOST_REQUIRE(!gas.isInfinite);
BOOST_CHECK(gas.value == m_gasUsed);
@@ -91,7 +91,7 @@ public:
}
gas += GasEstimator::functionalEstimation(
- *m_compiler.runtimeAssemblyItems(),
+ *m_compiler.runtimeAssemblyItems(""),
_sig
);
BOOST_REQUIRE(!gas.isInfinite);
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE(non_overlapping_filtered_costs)
if (first->first->location().intersects(second->first->location()))
{
BOOST_CHECK_MESSAGE(false, "Source locations should not overlap!");
- auto scannerFromSource = [&](string const&) -> Scanner const& { return m_compiler.scanner(); };
+ auto scannerFromSource = [&](string const& _sourceName) -> Scanner const& { return m_compiler.scanner(_sourceName); };
SourceReferenceFormatter::printSourceLocation(cout, &first->first->location(), scannerFromSource);
SourceReferenceFormatter::printSourceLocation(cout, &second->first->location(), scannerFromSource);
}