mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
bolt-gen: fixup the devtool/decodemsg printing facility
Fixup TLV handling in the bolt printing utility, `devtools/decodemsg`
This commit is contained in:
committed by
Rusty Russell
parent
cedebfd2d9
commit
281b4c241e
@@ -270,6 +270,9 @@ class Type(FieldSet):
|
||||
def is_subtype(self):
|
||||
return bool(self.fields)
|
||||
|
||||
def is_truncated(self):
|
||||
return self.name in self.truncated_typedefs
|
||||
|
||||
def needs_context(self):
|
||||
return self.is_varsize() or any([field.needs_context() for field in self.fields.values()])
|
||||
|
||||
@@ -329,6 +332,9 @@ class Tlv(object):
|
||||
struct_prefix=self.struct_name(),
|
||||
comments=comments)
|
||||
|
||||
def type_name(self):
|
||||
return 'struct ' + self.struct_name()
|
||||
|
||||
def struct_name(self):
|
||||
return "tlv_{}".format(self.name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user