| 418 | } |
| 419 | |
| 420 | static void sendpay(void) |
| 421 | { |
| 422 | struct json *j = json_parse(cmd, "[ 'A', '123', 'hello there' '547']"); |
| 423 | |
| 424 | const jsmntok_t *routetok, *note; |
| 425 | u64 *msatoshi; |
| 426 | unsigned *cltv; |
| 427 | |
| 428 | if (!param(cmd, j->buffer, j->toks, |
| 429 | p_req("route", param_tok, &routetok), |
| 430 | p_req("cltv", param_number, &cltv), |
| 431 | p_opt("note", param_tok, ¬e), |
| 432 | p_opt("msatoshi", param_u64, &msatoshi), |
| 433 | NULL)) |
| 434 | assert(false); |
| 435 | |
| 436 | assert(note); |
| 437 | assert(!strncmp("hello there", j->buffer + note->start, |
| 438 | note->end - note->start)); |
| 439 | assert(msatoshi); |
| 440 | assert(*msatoshi == 547); |
| 441 | } |
| 442 | |
| 443 | static void deprecated_rename(void) |
| 444 | { |
no test coverage detected