mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-09 22:13:43 +08:00
9 lines
466 B
Python
9 lines
466 B
Python
"""Compare complete compiled layouts, including opaque pointer default values."""
|
|
def layout(schema):
|
|
result = schema.node.struct.to_dict()
|
|
for field in result.get('fields', []):
|
|
if 'slot' in field and next(iter(field['slot']['type'])) in ('struct', 'list', 'anyPointer', 'data'):
|
|
value = schema.fields[field['name']].proto.slot.defaultValue
|
|
field['slot']['defaultValue'] = {'schemaValueHex': value.as_builder().to_bytes().hex()}
|
|
return result
|