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

Function get_query_flags_array

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

Source from the content-addressed store, hash-verified

247}
248
249static struct tlv_query_short_channel_ids_tlvs_query_flags *
250get_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
274static u8 *test_query_short_channel_ids(const char *test_vector,
275 const jsmntok_t *obj)

Callers 1

Calls 5

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

Tested by

no test coverage detected