| 87 | /* AUTOGENERATED MOCKS END */ |
| 88 | |
| 89 | static 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 | |
| 106 | int main(int argc, char *argv[]) |
| 107 | { |
no test coverage detected