| 247 | } |
| 248 | |
| 249 | static struct tlv_query_short_channel_ids_tlvs_query_flags * |
| 250 | get_query_flags_array(const tal_t *ctx, |
| 251 | const char *test_vector, |
| 252 | const jsmntok_t *opt) |
| 253 | { |
| 254 | const jsmntok_t *encoding, *arr, *t; |
| 255 | struct tlv_query_short_channel_ids_tlvs_query_flags *tlv |
| 256 | = tal(ctx, struct tlv_query_short_channel_ids_tlvs_query_flags); |
| 257 | size_t i; |
| 258 | |
| 259 | arr = json_get_member(test_vector, opt, "array"); |
| 260 | |
| 261 | tlv->encoded_query_flags = encoding_start(tlv, false); |
| 262 | encoding = json_get_member(test_vector, opt, "encoding"); |
| 263 | json_for_each_arr(i, t, arr) { |
| 264 | bigsize_t f; |
| 265 | assert(json_to_u64(test_vector, t, &f)); |
| 266 | encoding_add_query_flag(&tlv->encoded_query_flags, f); |
| 267 | } |
| 268 | assert(json_tok_streq(test_vector, encoding, "UNCOMPRESSED")); |
| 269 | tlv->encoding_type = ARR_UNCOMPRESSED; |
| 270 | |
| 271 | return tlv; |
| 272 | } |
| 273 | |
| 274 | static u8 *test_query_short_channel_ids(const char *test_vector, |
| 275 | const jsmntok_t *obj) |
no test coverage detected