| 1953 | } |
| 1954 | |
| 1955 | static bool json_to_route_hop_inplace(struct route_hop *dst, const char *buffer, |
| 1956 | const jsmntok_t *toks) |
| 1957 | { |
| 1958 | const jsmntok_t *idtok = json_get_member(buffer, toks, "id"); |
| 1959 | const jsmntok_t *channeltok = json_get_member(buffer, toks, "channel"); |
| 1960 | const jsmntok_t *directiontok = json_get_member(buffer, toks, "direction"); |
| 1961 | const jsmntok_t *amounttok = json_get_member(buffer, toks, "amount_msat"); |
| 1962 | const jsmntok_t *delaytok = json_get_member(buffer, toks, "delay"); |
| 1963 | const jsmntok_t *styletok = json_get_member(buffer, toks, "style"); |
| 1964 | |
| 1965 | if (idtok == NULL || channeltok == NULL || directiontok == NULL || |
| 1966 | amounttok == NULL || delaytok == NULL || styletok == NULL) |
| 1967 | return false; |
| 1968 | |
| 1969 | json_to_node_id(buffer, idtok, &dst->node_id); |
| 1970 | json_to_short_channel_id(buffer, channeltok, &dst->scid); |
| 1971 | json_to_int(buffer, directiontok, &dst->direction); |
| 1972 | json_to_msat(buffer, amounttok, &dst->amount); |
| 1973 | json_to_number(buffer, delaytok, &dst->delay); |
| 1974 | return true; |
| 1975 | } |
| 1976 | |
| 1977 | struct route_hop *json_to_route(const tal_t *ctx, const char *buffer, |
| 1978 | const jsmntok_t *toks) |
no test coverage detected