| 466 | } |
| 467 | |
| 468 | static void sendpay(void) |
| 469 | { |
| 470 | struct json *j = json_parse(cmd, "[ 'A', '123', 'hello there' '547']"); |
| 471 | |
| 472 | const jsmntok_t *routetok, *note; |
| 473 | u64 *msatoshi; |
| 474 | unsigned *cltv; |
| 475 | |
| 476 | if (!param(cmd, j->buffer, j->toks, |
| 477 | p_req("route", param_tok, &routetok), |
| 478 | p_req("cltv", param_number, &cltv), |
| 479 | p_opt("note", param_tok, ¬e), |
| 480 | p_opt("msatoshi", param_u64, &msatoshi), |
| 481 | NULL)) |
| 482 | assert(false); |
| 483 | |
| 484 | assert(note); |
| 485 | assert(!strncmp("hello there", j->buffer + note->start, |
| 486 | note->end - note->start)); |
| 487 | assert(msatoshi); |
| 488 | assert(*msatoshi == 547); |
| 489 | } |
| 490 | |
| 491 | static void invalid_bech32m(void) |
| 492 | { |
no test coverage detected