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

Function RPCConvertValues

src/rpc/client.cpp:285–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)
286{
287 UniValue params(UniValue::VARR);
288
289 for (unsigned int idx = 0; idx < strParams.size(); idx++) {
290 const std::string& strVal = strParams[idx];
291
292 if (!rpcCvtTable.convert(strMethod, idx)) {
293 // insert string value directly
294 params.push_back(strVal);
295 } else {
296 // parse string as JSON, insert bool/number/object/etc. value
297 params.push_back(ParseNonRFCJSONValue(strVal));
298 }
299 }
300
301 return params;
302}
303
304UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<std::string> &strParams)
305{

Callers 8

PrepareRequestMethod · 0.85
PrepareRequestMethod · 0.85
PrepareRequestMethod · 0.85
CallRPCMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
CallRPCMethod · 0.85
FUZZ_TARGETFunction · 0.85
RPCParseCommandLineMethod · 0.85

Calls 4

ParseNonRFCJSONValueFunction · 0.85
convertMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by 4

CallRPCMethod · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
CallRPCMethod · 0.68
FUZZ_TARGETFunction · 0.68