diff options
author | chriseth <c@ethdev.com> | 2015-01-09 18:22:59 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-01-09 18:22:59 +0800 |
commit | 42d186fdfca29fc23aff72b97493cdc8e03ed6b1 (patch) | |
tree | 4599ce43eb672644f93ac618c1fab2e0bb600407 /InterfaceHandler.cpp | |
parent | 23eff4d24a18b6a82565dbf5074c4e1ed313bb9e (diff) | |
parent | a36af5364c82f970fd9503833c04c1b5863e6697 (diff) | |
download | dexon-solidity-42d186fdfca29fc23aff72b97493cdc8e03ed6b1.tar.gz dexon-solidity-42d186fdfca29fc23aff72b97493cdc8e03ed6b1.tar.zst dexon-solidity-42d186fdfca29fc23aff72b97493cdc8e03ed6b1.zip |
Merge pull request #754 from LefterisJP/sol_abiFunctionHash
Calculation of ABI Function Identifier Hash
Diffstat (limited to 'InterfaceHandler.cpp')
-rw-r--r-- | InterfaceHandler.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/InterfaceHandler.cpp b/InterfaceHandler.cpp index 06b9824c..ca805fc9 100644 --- a/InterfaceHandler.cpp +++ b/InterfaceHandler.cpp @@ -39,7 +39,7 @@ std::unique_ptr<std::string> InterfaceHandler::getABIInterface(ContractDefinitio { Json::Value methods(Json::arrayValue); - for (FunctionDefinition const* f: _contractDef.getInterfaceFunctions()) + for (auto const& it: _contractDef.getInterfaceFunctions()) { Json::Value method; Json::Value inputs(Json::arrayValue); @@ -58,10 +58,10 @@ std::unique_ptr<std::string> InterfaceHandler::getABIInterface(ContractDefinitio return params; }; - method["name"] = f->getName(); - method["constant"] = f->isDeclaredConst(); - method["inputs"] = populateParameters(f->getParameters()); - method["outputs"] = populateParameters(f->getReturnParameters()); + method["name"] = it.second->getName(); + method["constant"] = it.second->isDeclaredConst(); + method["inputs"] = populateParameters(it.second->getParameters()); + method["outputs"] = populateParameters(it.second->getReturnParameters()); methods.append(method); } return std::unique_ptr<std::string>(new std::string(m_writer.write(methods))); @@ -94,10 +94,10 @@ std::unique_ptr<std::string> InterfaceHandler::getUserDocumentation(ContractDefi Json::Value doc; Json::Value methods(Json::objectValue); - for (FunctionDefinition const* f: _contractDef.getInterfaceFunctions()) + for (auto const& it: _contractDef.getInterfaceFunctions()) { Json::Value user; - auto strPtr = f->getDocumentation(); + auto strPtr = it.second->getDocumentation(); if (strPtr) { resetUser(); @@ -105,7 +105,7 @@ std::unique_ptr<std::string> InterfaceHandler::getUserDocumentation(ContractDefi if (!m_notice.empty()) {// since @notice is the only user tag if missing function should not appear user["notice"] = Json::Value(m_notice); - methods[f->getName()] = user; + methods[it.second->getName()] = user; } } } @@ -135,10 +135,10 @@ std::unique_ptr<std::string> InterfaceHandler::getDevDocumentation(ContractDefin doc["title"] = m_title; } - for (FunctionDefinition const* f: _contractDef.getInterfaceFunctions()) + for (auto const& it: _contractDef.getInterfaceFunctions()) { Json::Value method; - auto strPtr = f->getDocumentation(); + auto strPtr = it.second->getDocumentation(); if (strPtr) { resetDev(); @@ -161,7 +161,7 @@ std::unique_ptr<std::string> InterfaceHandler::getDevDocumentation(ContractDefin method["return"] = m_return; if (!method.empty()) // add the function, only if we have any documentation to add - methods[f->getName()] = method; + methods[it.second->getName()] = method; } } doc["methods"] = methods; |