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

Function param_rune

lightningd/runes.c:222–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220};
221
222static struct command_result *param_rune(struct command *cmd, const char *name,
223 const char * buffer, const jsmntok_t *tok,
224 struct rune_and_string **rune_and_string)
225{
226 u64 uid;
227
228 *rune_and_string = tal(cmd, struct rune_and_string);
229 (*rune_and_string)->runestr = json_strdup(*rune_and_string, buffer, tok);
230 (*rune_and_string)->rune = rune_from_base64(cmd, (*rune_and_string)->runestr);
231 if (!(*rune_and_string)->rune)
232 return command_fail_badparam(cmd, name, buffer, tok,
233 "should be base64 string");
234 /* We always create runes with integer unique ids: accept no less! */
235 if (!unique_id_num((*rune_and_string)->rune, &uid))
236 return command_fail_badparam(cmd, name, buffer, tok,
237 "should have valid numeric unique_id");
238
239 return NULL;
240}
241
242static struct command_result *param_params(struct command *cmd, const char *name,
243 const char * buffer, const jsmntok_t *tok,

Callers

nothing calls this directly

Calls 4

rune_from_base64Function · 0.85
unique_id_numFunction · 0.85
json_strdupFunction · 0.50
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected