Make CompilerStack::contractDefinition() public

This commit is contained in:
Kamil Śliwak 2021-02-23 10:01:24 +01:00
parent 051995a373
commit 769a7687c6

View File

@ -251,6 +251,10 @@ public:
/// @returns the parsed source unit with the supplied name. /// @returns the parsed source unit with the supplied name.
SourceUnit const& ast(std::string const& _sourceName) const; SourceUnit const& ast(std::string const& _sourceName) const;
/// @returns the parsed contract with the supplied name. Throws an exception if the contract
/// does not exist.
ContractDefinition const& contractDefinition(std::string const& _contractName) const;
/// Helper function for logs printing. Do only use in error cases, it's quite expensive. /// Helper function for logs printing. Do only use in error cases, it's quite expensive.
/// line and columns are numbered starting from 1 with following order: /// line and columns are numbered starting from 1 with following order:
/// start line, start column, end line, end column /// start line, start column, end line, end column
@ -442,10 +446,6 @@ private:
/// Can only be called after state is SourcesSet. /// Can only be called after state is SourcesSet.
Source const& source(std::string const& _sourceName) const; Source const& source(std::string const& _sourceName) const;
/// @returns the parsed contract with the supplied name. Throws an exception if the contract
/// does not exist.
ContractDefinition const& contractDefinition(std::string const& _contractName) const;
/// @returns the metadata JSON as a compact string for the given contract. /// @returns the metadata JSON as a compact string for the given contract.
std::string createMetadata(Contract const& _contract) const; std::string createMetadata(Contract const& _contract) const;