aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-09 00:18:31 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-09 00:18:31 +0800
commit184ddca5a108c5f3d026aa372a2af2f63b2694f9 (patch)
tree13dfa78ad1dbaa6fa83e83bf82d5fbdb78288de4 /Types.cpp
parent68b94275354e5715cea37ccbca18eb2a4b42704e (diff)
downloaddexon-solidity-184ddca5a108c5f3d026aa372a2af2f63b2694f9.tar.gz
dexon-solidity-184ddca5a108c5f3d026aa372a2af2f63b2694f9.tar.zst
dexon-solidity-184ddca5a108c5f3d026aa372a2af2f63b2694f9.zip
Compiler EVM generation now takes into account for the new function hash
identifier - Changed tests to comply with the new function hash identifier - Changed the function index offset to 4, and made it a constant for easy adjustment in the future
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Types.cpp b/Types.cpp
index 1a04fe61..e5bfa30f 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -323,16 +323,13 @@ shared_ptr<FunctionType const> const& ContractType::getConstructorType() const
return m_constructorType;
}
-unsigned ContractType::getFunctionIndex(string const& _functionName) const
+u256 ContractType::getFunctionIdentifier(string const& _functionName) const
{
- unsigned index = 0;
auto interfaceFunctions = m_contract.getInterfaceFunctions();
for (auto it = interfaceFunctions.cbegin(); it != interfaceFunctions.cend(); ++it)
- {
if (it->second->getName() == _functionName)
- return index;
- ++index;
- }
+ return FixedHash<4>::Arith(it->first);
+
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Index of non-existing contract function requested."));
}