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

Function test_invoice

common/test/run-param.c:641–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641static void test_invoice(struct command *cmd,
642 const char *buffer,
643 const jsmntok_t *obj UNNEEDED,
644 const jsmntok_t *params)
645{
646 u64 *msatoshi_val;
647 struct json_escape *label_val;
648 const char *desc_val;
649 u64 *expiry;
650 const jsmntok_t *fallbacks;
651 const jsmntok_t *preimagetok;
652
653 assert(cmd->mode == CMD_USAGE);
654 if (!param(cmd, buffer, params,
655 p_req("msatoshi", param_u64, &msatoshi_val),
656 p_req("label", param_label, &label_val),
657 p_req("description", param_escaped_string, &desc_val),
658 p_opt("expiry", param_u64, &expiry),
659 p_opt("fallbacks", param_array, &fallbacks),
660 p_opt("preimage", param_tok, &preimagetok), NULL))
661 return;
662
663 /* should not be here since we are in the mode of CMD_USAGE
664 * and it always returns false. */
665 abort();
666}
667
668static void usage(void)
669{

Callers 1

usageFunction · 0.70

Calls 2

abortFunction · 0.85
paramClass · 0.70

Tested by

no test coverage detected