Implement CompilerStack.lastContractName()

This commit is contained in:
Alex Beregszaszi
2017-10-18 23:54:32 +01:00
parent 039cc25b1f
commit 2ce35b77be
7 changed files with 30 additions and 21 deletions
+2 -2
View File
@@ -952,9 +952,9 @@ void CommandLineInterface::handleAst(string const& _argStr)
asts.push_back(&m_compiler->ast(sourceCode.first));
map<ASTNode const*, eth::GasMeter::GasConsumption> gasCosts;
// FIXME: shouldn't this be done for every contract?
if (m_compiler->runtimeAssemblyItems(""))
if (m_compiler->runtimeAssemblyItems(m_compiler->lastContractName()))
gasCosts = GasEstimator::breakToStatementLevel(
GasEstimator::structuralEstimation(*m_compiler->runtimeAssemblyItems(""), asts),
GasEstimator::structuralEstimation(*m_compiler->runtimeAssemblyItems(m_compiler->lastContractName()), asts),
asts
);