- Notifications
You must be signed in to change notification settings - Fork52
Open
Description
Description
It appears thatsszgen
ignores inline struct field declarations when generating encoders, causing marshalling/unmarshalling to omit all inline struct fields.
sszgen version0.1.3
Reproducible Sample Showcasing the Issue
Commands to Generate Encodings:
sszgen -path. --objs Foo -output foo_encoding.gosszgen -path. --objs Bar -output bar_encoding.go
typeFoostruct {Name,Address []byte//inline struct fields that are ignored}typeBarstruct {Name []byteAddress []byte}funcmain() {f:=Foo{}fooBytes,err:=f.MarshalSSZ()iferr!=nil {panic(err)}fmt.Printf("Foo len: '%v'",len(fooBytes))b:=Bar{}barBytes,err:=b.MarshalSSZ()iferr!=nil {panic(err)}fmt.Printf("Bar len: '%v'",len(barBytes))}
Expected output:
Foo len: '8'Bar len: '8'
Actual output:
Foo len: '0'Bar len: '8'
Metadata
Metadata
Assignees
Labels
No labels