From f2819ba7d88b113914731f92169201f8b5aef964 Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Fri, 19 Jul 2019 11:56:39 -0500 Subject: [PATCH] bolt-gen: remove 'is-optional' qualifier from msg field we now handle optional fields, so we should include them in the message parsing signatures --- tools/gen/header_template | 4 ++-- tools/gen/impl_template | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/gen/header_template b/tools/gen/header_template index 962684c3d..e03168d64 100644 --- a/tools/gen/header_template +++ b/tools/gen/header_template @@ -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} */ diff --git a/tools/gen/impl_template b/tools/gen/impl_template index d0d8a5ced..d106c4d61 100644 --- a/tools/gen/impl_template +++ b/tools/gen/impl_template @@ -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():