MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / Parse

Function Parse

src/rpc/client.cpp:401–409  ·  view source on GitHub ↗

Parse string to UniValue or throw runtime_error if string contains invalid JSON */

Source from the content-addressed store, hash-verified

399
400/** Parse string to UniValue or throw runtime_error if string contains invalid JSON */
401static UniValue Parse(std::string_view raw, ParamFormat format = ParamFormat::JSON)
402{
403 UniValue parsed;
404 if (!parsed.read(raw)) {
405 if (format != ParamFormat::JSON_OR_STRING) throw std::runtime_error(tfm::format("Error parsing JSON: %s", raw));
406 return UniValue(std::string(raw));
407 }
408 return parsed;
409}
410
411namespace rpc_convert
412{

Callers 15

ParseParamFunction · 0.70
getScriptFromDescriptorFunction · 0.70
getdescriptorinfoFunction · 0.70
deriveaddressesFunction · 0.70
ExportWatchOnlyWalletFunction · 0.50
DeserializeDescriptorMethod · 0.50
GenerateWalletDescriptorFunction · 0.50
MigrateToDescriptorMethod · 0.50
wallet.cppFile · 0.50
AddKeyFunction · 0.50

Calls 3

UniValueClass · 0.70
formatFunction · 0.50
readMethod · 0.45

Tested by 14

AddKeyFunction · 0.40
BOOST_FIXTURE_TEST_CASEFunction · 0.40
CreateSyncedWalletFunction · 0.40
CreateDescriptorFunction · 0.40
CreateWalletDescriptorFunction · 0.40
BOOST_FIXTURE_TEST_CASEFunction · 0.40
CheckUnparsableFunction · 0.40
DoCheckFunction · 0.40
CheckMultipathFunction · 0.40
BOOST_AUTO_TEST_CASEFunction · 0.40
CheckSingleUnparsableFunction · 0.40
CheckUnusedFunction · 0.40