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

Function parseParam

src/rpcwallet.cpp:249–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void parseParam(const UniValue& val, std::vector<dev::h160> &h160s) {
250 if (val.isNull()) {
251 return;
252 }
253
254 // Treat a string as an array of length 1
255 if (val.isStr()) {
256 h160s.push_back(parseParamH160(val.get_str()));
257 return;
258 }
259
260 if (!val.isArray()) {
261 throw JSONRPCError(RPC_INVALID_PARAMS, "Expect an array of hex 160 strings");
262 }
263
264 auto vals = val.getValues();
265 h160s.resize(vals.size());
266
267 std::transform(vals.begin(), vals.end(), h160s.begin(), [](UniValue val) -> dev::h160 {
268 return parseParamH160(val);
269 });
270}
271
272void parseParam(const UniValue& val, std::set<dev::h160> &h160s) {
273 std::vector<dev::h160> v;

Callers 2

SearchLogsParamsMethod · 0.85
parseFilterMethod · 0.85

Calls 15

parseParamH160Function · 0.85
JSONRPCErrorFunction · 0.85
CheckHexFunction · 0.85
isStrMethod · 0.80
get_strMethod · 0.80
isArrayMethod · 0.80
getValuesMethod · 0.80
isNullMethod · 0.45
push_backMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected