From 4bf3cbb09a42131dba27b080a4917f30284959d3 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 6 May 2017 18:02:56 +0100 Subject: Use CompilerStack.contractABI directly --- libsolidity/interface/CompilerStack.cpp | 7 ++++++- libsolidity/interface/StandardCompiler.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'libsolidity') diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 7887a2cb..1f235656 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -449,6 +449,11 @@ Json::Value const& CompilerStack::contractABI(string const& _contractName) const return metadata(_contractName, DocumentationType::ABIInterface); } +Json::Value const& CompilerStack::contractABI(Contract const& _contract) const +{ + return metadata(_contract, DocumentationType::ABIInterface); +} + Json::Value const& CompilerStack::metadata(string const& _contractName, DocumentationType _type) const { return metadata(contract(_contractName), _type); @@ -830,7 +835,7 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const for (auto const& library: m_libraries) meta["settings"]["libraries"][library.first] = "0x" + toHex(library.second.asBytes()); - meta["output"]["abi"] = metadata(_contract, DocumentationType::ABIInterface); + meta["output"]["abi"] = contractABI(_contract); meta["output"]["userdoc"] = metadata(_contract, DocumentationType::NatspecUser); meta["output"]["devdoc"] = metadata(_contract, DocumentationType::NatspecDev); diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 223cc15d..4eb52fc2 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -391,7 +391,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) // ABI, documentation and metadata Json::Value contractData(Json::objectValue); - contractData["abi"] = m_compilerStack.metadata(contractName, DocumentationType::ABIInterface); + contractData["abi"] = m_compilerStack.contractABI(contractName); contractData["metadata"] = m_compilerStack.onChainMetadata(contractName); contractData["userdoc"] = m_compilerStack.metadata(contractName, DocumentationType::NatspecUser); contractData["devdoc"] = m_compilerStack.metadata(contractName, DocumentationType::NatspecDev); -- cgit v1.2.3