aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-14 23:49:09 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-14 23:49:09 +0800
commita78794e8721c8f8f80ec89de2bf8ba158796e39f (patch)
tree57d6961cbc0f93fc387cc421012942b52a7e95c6
parentac8ad058cf0cf4fdc73591393eee7f1611560862 (diff)
downloaddexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.tar
dexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.tar.gz
dexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.tar.bz2
dexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.tar.lz
dexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.tar.xz
dexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.tar.zst
dexon-solidity-a78794e8721c8f8f80ec89de2bf8ba158796e39f.zip
Fixes and additional checks for Natspec Popup authentication
-rw-r--r--CompilerStack.cpp22
-rw-r--r--CompilerStack.h9
2 files changed, 5 insertions, 26 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index b0642349..11d90d08 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -137,12 +137,12 @@ bytes const& CompilerStack::getBytecode(string const& _contractName) const
return getContract(_contractName).bytecode;
}
-bytes const& CompilerStack::getRuntimeBytecode(std::string const& _contractName) const
+bytes const& CompilerStack::getRuntimeBytecode(string const& _contractName) const
{
return getContract(_contractName).runtimeBytecode;
}
-dev::h256 CompilerStack::getContractCodeHash(std::string const& _contractName) const
+dev::h256 CompilerStack::getContractCodeHash(string const& _contractName) const
{
return dev::sha3(getRuntimeBytecode(_contractName));
}
@@ -192,24 +192,6 @@ string const& CompilerStack::getMetadata(string const& _contractName, Documentat
return *(*doc);
}
-std::string const CompilerStack::getFunctionHashes(std::string const& _contractName)
-{
- if (!m_parseSuccessful)
- BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful."));
-
- std::string ret = "";
- Contract const& contract = getContract(_contractName);
- auto interfaceFunctions = contract.contract->getInterfaceFunctions();
-
- for (auto const& it: interfaceFunctions)
- {
- ret += it.first.abridged();
- ret += " :";
- ret += it.second->getName() + "\n";
- }
- return ret;
-}
-
Scanner const& CompilerStack::getScanner(string const& _sourceName) const
{
return *getSource(_sourceName).scanner;
diff --git a/CompilerStack.h b/CompilerStack.h
index 202f1b32..29de69d5 100644
--- a/CompilerStack.h
+++ b/CompilerStack.h
@@ -76,11 +76,11 @@ public:
/// @returns the compiled bytecode
bytes const& compile(std::string const& _sourceCode, bool _optimize = false);
- /// Gets the assembled bytecode for a contract
+ /// @returns the assembled bytecode for a contract.
bytes const& getBytecode(std::string const& _contractName = "") const;
- /// Get the runtime context's bytecode for a contract
+ /// @returns the runtime context's bytecode for a contract.
bytes const& getRuntimeBytecode(std::string const& _contractName = "") const;
- /// Get the runtime context's code hash for a contract
+ /// @returns the runtime bytecode for the contract, i.e. the code that is returned by the constructor.
dev::h256 getContractCodeHash(std::string const& _contractName = "") const;
/// Streams a verbose version of the assembly to @a _outStream.
@@ -99,9 +99,6 @@ public:
/// Can be one of 4 types defined at @c DocumentationType
std::string const& getMetadata(std::string const& _contractName, DocumentationType _type) const;
- /// Convenience function to return all contract method hashes in a string
- std::string const getFunctionHashes(std::string const& _contractName = "");
-
/// @returns the previously used scanner, useful for counting lines during error reporting.
Scanner const& getScanner(std::string const& _sourceName = "") const;
/// @returns the parsed source unit with the supplied name.