diff options
author | chriseth <chris@ethereum.org> | 2017-06-30 16:22:35 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-16 19:12:44 +0800 |
commit | 7e1b9c16528b08a8924f85c57f3b08b6cec70584 (patch) | |
tree | 7deaed3488dbff3c6b6d944d4aafe3177698beaa /libsolidity/interface | |
parent | 36a90289e65b06c54326a1c254baa5fa6029f766 (diff) | |
download | dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar.gz dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar.zst dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.zip |
Structure type json using "components".
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/ABI.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/interface/ABI.cpp b/libsolidity/interface/ABI.cpp index 0e28d010..9af7cdc3 100644 --- a/libsolidity/interface/ABI.cpp +++ b/libsolidity/interface/ABI.cpp @@ -136,25 +136,25 @@ Json::Value ABI::formatType(string const& _name, Type const& _type, bool _forLib suffix = string("[") + arrayType->length().str() + "]"; solAssert(arrayType->baseType(), ""); Json::Value subtype = formatType("", *arrayType->baseType(), _forLibrary); - if (subtype["type"].isString() && !subtype.isMember("subtype")) - ret["type"] = subtype["type"].asString() + suffix; - else + if (subtype.isMember("components")) { - ret["type"] = suffix; - solAssert(!subtype.isMember("subtype"), ""); - ret["subtype"] = subtype["type"]; + ret["type"] = subtype["type"].asString() + suffix; + ret["components"] = subtype["components"]; } + else + ret["type"] = subtype["type"].asString() + suffix; } } else if (StructType const* structType = dynamic_cast<StructType const*>(&_type)) { - ret["type"] = Json::arrayValue; + ret["type"] = string(); + ret["components"] = Json::arrayValue; for (auto const& member: structType->members(nullptr)) { solAssert(member.type, ""); auto t = member.type->interfaceType(_forLibrary); solAssert(t, ""); - ret["type"].append(formatType(member.name, *t, _forLibrary)); + ret["components"].append(formatType(member.name, *t, _forLibrary)); } } else |