MCPcopy Create free account
hub / github.com/ElementsProject/lightning / get_query_flags_array

Function get_query_flags_array

gossipd/test/run-extended-info.c:306–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306static struct tlv_query_short_channel_ids_tlvs_query_flags *
307get_query_flags_array(const tal_t *ctx,
308 const char *test_vector,
309 const jsmntok_t *opt)
310{
311 const jsmntok_t *encoding, *arr, *t;
312 struct tlv_query_short_channel_ids_tlvs_query_flags *tlv
313 = tal(ctx, struct tlv_query_short_channel_ids_tlvs_query_flags);
314 size_t i;
315
316 arr = json_get_member(test_vector, opt, "array");
317
318 tlv->encoded_query_flags = encoding_start(tlv, false);
319 encoding = json_get_member(test_vector, opt, "encoding");
320 json_for_each_arr(i, t, arr) {
321 bigsize_t f;
322 assert(json_to_u64(test_vector, t, &f));
323 encoding_add_query_flag(&tlv->encoded_query_flags, f);
324 }
325 assert(json_tok_streq(test_vector, encoding, "UNCOMPRESSED"));
326 tlv->encoding_type = ARR_UNCOMPRESSED;
327
328 return tlv;
329}
330
331static u8 *test_query_short_channel_ids(const char *test_vector,
332 const jsmntok_t *obj)

Callers 1

Calls 5

encoding_startFunction · 0.85
encoding_add_query_flagFunction · 0.85
json_get_memberFunction · 0.50
json_to_u64Function · 0.50
json_tok_streqFunction · 0.50

Tested by

no test coverage detected