| 2613 | } |
| 2614 | |
| 2615 | static bool json_to_route_hop_inplace(struct route_hop *dst, const char *buffer, |
| 2616 | const jsmntok_t *toks) |
| 2617 | { |
| 2618 | const jsmntok_t *idtok = json_get_member(buffer, toks, "id"); |
| 2619 | const jsmntok_t *channeltok = json_get_member(buffer, toks, "channel"); |
| 2620 | const jsmntok_t *directiontok = json_get_member(buffer, toks, "direction"); |
| 2621 | const jsmntok_t *amounttok = json_get_member(buffer, toks, "amount_msat"); |
| 2622 | const jsmntok_t *delaytok = json_get_member(buffer, toks, "delay"); |
| 2623 | const jsmntok_t *styletok = json_get_member(buffer, toks, "style"); |
| 2624 | |
| 2625 | if (idtok == NULL || channeltok == NULL || directiontok == NULL || |
| 2626 | amounttok == NULL || delaytok == NULL || styletok == NULL) |
| 2627 | return false; |
| 2628 | |
| 2629 | json_to_node_id(buffer, idtok, &dst->node_id); |
| 2630 | json_to_short_channel_id(buffer, channeltok, &dst->scid); |
| 2631 | json_to_int(buffer, directiontok, &dst->direction); |
| 2632 | json_to_msat(buffer, amounttok, &dst->amount); |
| 2633 | json_to_number(buffer, delaytok, &dst->delay); |
| 2634 | return true; |
| 2635 | } |
| 2636 | |
| 2637 | struct route_hop *json_to_route(const tal_t *ctx, const char *buffer, |
| 2638 | const jsmntok_t *toks) |
no test coverage detected