mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Refactor STParsedJSON to parse an object or array [RIPD-480]
The implementation of multi-sign has a SigningAccounts array as a member of the outermost object. This array could not be parsed by the previous implementation of STParsedJSON, which only knew how to parse objects. This refactor supports the required parsing. The refactor divides the parsing into three separate functions: o parseNoRecurse() which parses most rippled data types. o parseObject() which parses object types that may contain arbitrary other types. o parseArray() which parses object types that may contain arbitrary other types. The change is required by the multi-sign implementation, but is independent. So the parsing change is going in as a separate commit. The parsing is still far from perfect. But this was as much as needs doing to accomplish the ends and mitigate risk of breaking the parser.
This commit is contained in:
committed by
Vinnie Falco
parent
af24d541d1
commit
761902864a
@@ -324,7 +324,7 @@ Json::Value transactionSign (
|
||||
}
|
||||
}
|
||||
|
||||
STParsedJSON parsed ("tx_json", tx_json);
|
||||
STParsedJSONObject parsed ("tx_json", tx_json);
|
||||
if (!parsed.object.get())
|
||||
{
|
||||
jvResult ["error"] = parsed.error ["error"];
|
||||
|
||||
Reference in New Issue
Block a user