mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
generate-wire: handle variable-size arrays of unknown types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
c15511cf39
commit
fd09345628
@ -241,8 +241,12 @@ class Message(object):
|
||||
print('\t/*{} */'.format(c))
|
||||
|
||||
if f.is_unknown:
|
||||
print('\t*{} = fromwire_{}(ctx, &cursor, plen);'
|
||||
.format(f.name, basetype))
|
||||
if f.is_variable_size():
|
||||
print('\t*{} = fromwire_{}_array(ctx, &cursor, plen, {});'
|
||||
.format(f.name, basetype, f.lenvar))
|
||||
else:
|
||||
print('\t*{} = fromwire_{}(ctx, &cursor, plen);'
|
||||
.format(f.name, basetype))
|
||||
elif f.is_padding():
|
||||
print('\tfromwire_pad(&cursor, plen, {});'
|
||||
.format(f.num_elems))
|
||||
|
Loading…
Reference in New Issue
Block a user