MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseNonRFCJSONValue

Function ParseNonRFCJSONValue

src/rpc/client.cpp:276–283  ·  view source on GitHub ↗

Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) * as well as objects and arrays. */

Source from the content-addressed store, hash-verified

274 * as well as objects and arrays.
275 */
276UniValue ParseNonRFCJSONValue(const std::string& strVal)
277{
278 UniValue jVal;
279 if (!jVal.read(std::string("[")+strVal+std::string("]")) ||
280 !jVal.isArray() || jVal.size()!=1)
281 throw std::runtime_error(std::string("Error parsing JSON: ") + strVal);
282 return jVal[0];
283}
284
285UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)
286{

Callers 5

BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGET_INITFunction · 0.85
FUZZ_TARGETFunction · 0.85
RPCConvertValuesFunction · 0.85
RPCConvertNamedValuesFunction · 0.85

Calls 3

isArrayMethod · 0.80
readMethod · 0.45
sizeMethod · 0.45

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGET_INITFunction · 0.68
FUZZ_TARGETFunction · 0.68