tools/generate-wire.py: enums are assignable.

Simplfies their marshalling/unmarshalling.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-07-04 10:14:57 +09:30
parent a53acb7877
commit 7884343c15
3 changed files with 21 additions and 21 deletions

View File

@@ -36,7 +36,7 @@ class FieldType(object):
self.tsize = FieldType._typesize(name)
def is_assignable(self):
return self.name in ['u8', 'u16', 'u32', 'u64', 'bool']
return self.name in ['u8', 'u16', 'u32', 'u64', 'bool'] or self.name.startswith('enum ')
# We only accelerate the u8 case: it's common and trivial.
def has_array_helper(self):