mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 06:54:30 +01:00
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:
committed by
Rusty Russell
parent
96bf7aead5
commit
f2819ba7d8
@@ -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} */
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user