MCPcopy Create free account
hub / github.com/LUX-Core/lux / RPCConvertValues

Function RPCConvertValues

src/rpcclient.cpp:221–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221UniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)
222{
223 UniValue params(UniValue::VARR);
224
225 for (unsigned int idx = 0; idx < strParams.size(); idx++) {
226 const std::string& strVal = strParams[idx];
227
228 // insert string value directly
229 if (!rpcCvtTable.convert(strMethod, idx)) {
230 params.push_back(strVal);
231 } else if (strMethod.substr(0, 10) == "getaddress") {
232 UniValue p;
233 try {
234 p = ParseNonRFCJSONValue(strVal);
235 } catch (...) {
236 // allow getaddressbalance "LYmrT81UoxqfskSNt28ZKZ3XXskSFENEtg" for convenience
237 p = strVal;
238 }
239 params.push_back(p);
240 } else {
241 // parse string as JSON, insert bool/number/object/etc. value
242 params.push_back(ParseNonRFCJSONValue(strVal));
243 }
244 }
245
246 return params;
247}
248
249UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<std::string> &strParams)
250{

Callers 4

CommandLineRPCFunction · 0.85
CallRPCFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
RPCParseCommandLineMethod · 0.85

Calls 4

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

Tested by 2

CallRPCFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68