diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-22 04:49:58 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-19 06:54:32 +0800 |
commit | 2ce35b77becab2395dce218b106a7ce904a1b141 (patch) | |
tree | a495989b6c5eabeb1620bc71fef36fad252e6d6c /test/libsolidity/GasMeter.cpp | |
parent | 039cc25b1fd875e9f4cfd0f0649f2b4ed67640e1 (diff) | |
download | dexon-solidity-2ce35b77becab2395dce218b106a7ce904a1b141.tar.gz dexon-solidity-2ce35b77becab2395dce218b106a7ce904a1b141.tar.zst dexon-solidity-2ce35b77becab2395dce218b106a7ce904a1b141.zip |
Implement CompilerStack.lastContractName()
Diffstat (limited to 'test/libsolidity/GasMeter.cpp')
-rw-r--r-- | test/libsolidity/GasMeter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 83d24f6c..86e8201b 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -51,7 +51,7 @@ public: m_compiler.setOptimiserSettings(dev::test::Options::get().optimize); BOOST_REQUIRE_MESSAGE(m_compiler.compile(), "Compiling contract failed"); - AssemblyItems const* items = m_compiler.runtimeAssemblyItems(""); + AssemblyItems const* items = m_compiler.runtimeAssemblyItems(m_compiler.lastContractName()); ASTNode const& sourceUnit = m_compiler.ast(""); BOOST_REQUIRE(items != nullptr); m_gasCosts = GasEstimator::breakToStatementLevel( @@ -64,13 +64,13 @@ public: { compileAndRun(_sourceCode); auto state = make_shared<KnownState>(); - PathGasMeter meter(*m_compiler.assemblyItems("")); + PathGasMeter meter(*m_compiler.assemblyItems(m_compiler.lastContractName())); GasMeter::GasConsumption gas = meter.estimateMax(0, state); - u256 bytecodeSize(m_compiler.runtimeObject("").bytecode.size()); + u256 bytecodeSize(m_compiler.runtimeObject(m_compiler.lastContractName()).bytecode.size()); // costs for deployment gas += bytecodeSize * GasCosts::createDataGas; // costs for transaction - gas += gasForTransaction(m_compiler.object("").bytecode, true); + gas += gasForTransaction(m_compiler.object(m_compiler.lastContractName()).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(m_compiler.lastContractName()), _sig ); BOOST_REQUIRE(!gas.isInfinite); |