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

Function tlv_to_fields

common/test/run-bolt12_merkle-json.c:89–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87/* AUTOGENERATED MOCKS END */
88
89static const struct tlv_field *tlv_to_fields(const tal_t *ctx, const u8 *tlv)
90{
91 struct tlv_field *fields = tal_arr(ctx, struct tlv_field, 0);
92 size_t len = tal_bytelen(tlv);
93
94 /* Dumb parser, assuming it's valid! */
95 while (len) {
96 struct tlv_field f;
97 f.numtype = fromwire_bigsize(&tlv, &len);
98 f.length = fromwire_bigsize(&tlv, &len);
99 f.value = (u8 *)tlv;
100 fromwire(&tlv, &len, NULL, f.length);
101 tal_arr_expand(&fields, f);
102 }
103 return fields;
104}
105
106int main(int argc, char *argv[])
107{

Callers 1

mainFunction · 0.85

Calls 3

tal_bytelenFunction · 0.85
fromwire_bigsizeFunction · 0.70
fromwireFunction · 0.70

Tested by

no test coverage detected