bolt-gen: remove 'is-optional' qualifier from msg field

we now handle optional fields, so we should include them in
the message parsing signatures
This commit is contained in:
lisa neigut
2019-07-19 11:56:39 -05:00
committed by Rusty Russell
parent 96bf7aead5
commit f2819ba7d8
2 changed files with 3 additions and 3 deletions

View File

@@ -79,8 +79,8 @@ void fromwire_${subtype.name}(const u8 **cursor, size_t *plen, ${subtype.type_na
% for c in msg.msg_comments:
/* ${c} */
% endfor
u8 *towire_${msg.name}(const tal_t *ctx${''.join([f.arg_desc_to() for f in msg.fields.values() if not f.is_optional])});
bool fromwire_${msg.name}(${'const tal_t *ctx, ' if msg.has_len_fields() else ''}const void *p${''.join([f.arg_desc_from() for f in msg.fields.values() if not f.is_optional])});
u8 *towire_${msg.name}(const tal_t *ctx${''.join([f.arg_desc_to() for f in msg.fields.values()])});
bool fromwire_${msg.name}(${'const tal_t *ctx, ' if msg.needs_context() else ''}const void *p${''.join([f.arg_desc_from() for f in msg.fields.values()])});
% endfor
#endif /* LIGHTNING_${idem} */

View File

@@ -144,7 +144,7 @@ fromwire_${type_}(${'ctx, ' if f.needs_context() else ''}&cursor, &plen, ${'*' i
% for c in msg.msg_comments:
/* ${c} */
% endfor
u8 *towire_${msg.name}(const tal_t *ctx${''.join([f.arg_desc_to() for f in msg.fields.values() if not f.is_optional])})
u8 *towire_${msg.name}(const tal_t *ctx${''.join([f.arg_desc_to() for f in msg.fields.values()])})
{
## FIXME: we're ignoring TLV's rn
% for f in msg.get_len_fields():