aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-30 16:22:35 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-16 19:12:44 +0800
commit7e1b9c16528b08a8924f85c57f3b08b6cec70584 (patch)
tree7deaed3488dbff3c6b6d944d4aafe3177698beaa /libsolidity/interface
parent36a90289e65b06c54326a1c254baa5fa6029f766 (diff)
downloaddexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar
dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar.gz
dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar.bz2
dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar.lz
dexon-solidity-7e1b9c16528b08a8924f85c57f3b08b6cec70584.tar.xz
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.cpp16
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