aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-07 23:39:21 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-07 23:39:21 +0800
commitc55608f94b834d5286c4b638dd4daa77cf406807 (patch)
treefb60c5c2a916e8fa1b4e06915bd233f81cb8bd08 /Types.cpp
parentdf0dce584d2d1aacf3d33658b0540f243b3adb81 (diff)
downloaddexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.tar
dexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.tar.gz
dexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.tar.bz2
dexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.tar.lz
dexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.tar.xz
dexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.tar.zst
dexon-solidity-c55608f94b834d5286c4b638dd4daa77cf406807.zip
Solidity getInterfaceFunctions is now a map of hash to Function
- Also introduced dependency between libsolidity and libdevcrypto - Compler's appendFunctionSelector now has a first version of using function signature hash instead of index
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Types.cpp b/Types.cpp
index 7a4c45c6..1a04fe61 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -301,9 +301,10 @@ MemberList const& ContractType::getMembers() const
// We need to lazy-initialize it because of recursive references.
if (!m_members)
{
+ auto interfaceFunctions = m_contract.getInterfaceFunctions();
map<string, shared_ptr<Type const>> members;
- for (FunctionDefinition const* function: m_contract.getInterfaceFunctions())
- members[function->getName()] = make_shared<FunctionType>(*function, false);
+ for (auto it = interfaceFunctions.cbegin(); it != interfaceFunctions.cend(); ++it)
+ members[it->second->getName()] = make_shared<FunctionType>(*it->second, false);
m_members.reset(new MemberList(members));
}
return *m_members;
@@ -325,9 +326,10 @@ shared_ptr<FunctionType const> const& ContractType::getConstructorType() const
unsigned ContractType::getFunctionIndex(string const& _functionName) const
{
unsigned index = 0;
- for (FunctionDefinition const* function: m_contract.getInterfaceFunctions())
+ auto interfaceFunctions = m_contract.getInterfaceFunctions();
+ for (auto it = interfaceFunctions.cbegin(); it != interfaceFunctions.cend(); ++it)
{
- if (function->getName() == _functionName)
+ if (it->second->getName() == _functionName)
return index;
++index;
}