| 82 | } |
| 83 | |
| 84 | static u8 *json_to_allowed_features(const tal_t *ctx, |
| 85 | const char *buf, const jsmntok_t *t) |
| 86 | { |
| 87 | size_t i; |
| 88 | const jsmntok_t *f, *features = json_get_member(buf, t, "features"); |
| 89 | u8 *allowed_features; |
| 90 | |
| 91 | allowed_features = tal_arr(ctx, u8, 0); |
| 92 | json_for_each_arr(i, f, features) { |
| 93 | u32 n; |
| 94 | assert(json_to_u32(buf, f, &n)); |
| 95 | set_feature_bit(&allowed_features, n); |
| 96 | } |
| 97 | return allowed_features; |
| 98 | } |
| 99 | |
| 100 | static u8 *json_to_enctlvs(const tal_t *ctx, |
| 101 | const char *buf, const jsmntok_t *tlvs) |
no test coverage detected