MCPcopy Create free account
hub / github.com/ElementsProject/lightning / param_arr

Function param_arr

common/json_param.c:276–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276static struct command_result *param_arr(struct command *cmd, const char *buffer,
277 const jsmntok_t tokens[],
278 struct param *params,
279 bool allow_extra)
280{
281#if DEVELOPER
282 if (!check_params(params)) {
283 return command_fail(cmd, PARAM_DEV_ERROR,
284 "developer error: check_params");
285 }
286#endif
287 if (tokens->type == JSMN_ARRAY)
288 return parse_by_position(cmd, params, buffer, tokens, allow_extra);
289 else if (tokens->type == JSMN_OBJECT)
290 return parse_by_name(cmd, params, buffer, tokens, allow_extra);
291
292 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
293 "Expected array or object for params");
294}
295
296const char *param_subcommand(struct command *cmd, const char *buffer,
297 const jsmntok_t tokens[],

Callers 3

param_subcommandFunction · 0.85
paramFunction · 0.85
five_hundred_paramsFunction · 0.85

Calls 4

check_paramsFunction · 0.85
parse_by_positionFunction · 0.85
parse_by_nameFunction · 0.85
command_failFunction · 0.50

Tested by 1

five_hundred_paramsFunction · 0.68