diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-04-17 21:26:12 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-04-27 19:08:32 +0800 |
commit | 2d62c482fd50a69bb19d2c3e3adca3a66260417f (patch) | |
tree | e3a3903b584289a066263872f00abbf44ff530c5 /InterfaceHandler.cpp | |
parent | fcd3f44fd9b76c659fa0a41beeb00680e8337a5e (diff) | |
download | dexon-solidity-2d62c482fd50a69bb19d2c3e3adca3a66260417f.tar.gz dexon-solidity-2d62c482fd50a69bb19d2c3e3adca3a66260417f.tar.zst dexon-solidity-2d62c482fd50a69bb19d2c3e3adca3a66260417f.zip |
fixed the output of the test
Diffstat (limited to 'InterfaceHandler.cpp')
-rw-r--r-- | InterfaceHandler.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/InterfaceHandler.cpp b/InterfaceHandler.cpp index ea787c28..d68f9dbe 100644 --- a/InterfaceHandler.cpp +++ b/InterfaceHandler.cpp @@ -38,7 +38,17 @@ std::unique_ptr<std::string> InterfaceHandler::getDocumentation(ContractDefiniti std::unique_ptr<std::string> InterfaceHandler::getABIInterface(ContractDefinition const& _contractDef) { Json::Value abi(Json::arrayValue); - for (auto const& it: _contractDef.getInterfaceFunctions()) + auto allFunctions = _contractDef.getInterfaceFunctions(); + + FunctionTypePointer functionTypePointer = nullptr; + if (_contractDef.getConstructor()) + { + functionTypePointer = make_shared<FunctionType>(*_contractDef.getConstructor(), false); + allFunctions.insert(make_pair(_contractDef.getConstructorsInterface(), functionTypePointer)); + } + + //allFunctions.insert(_contractDef.getConstructor()); + for (auto it: allFunctions) { auto populateParameters = [](vector<string> const& _paramNames, vector<string> const& _paramTypes) { @@ -55,7 +65,7 @@ std::unique_ptr<std::string> InterfaceHandler::getABIInterface(ContractDefinitio }; Json::Value method; - method["type"] = "function"; + method["type"] = (functionTypePointer == it.second ? "constructor" : "function"); method["name"] = it.second->getDeclaration().getName(); method["constant"] = it.second->isConstant(); method["inputs"] = populateParameters(it.second->getParameterNames(), |