ferranbt / fastssz

Fast Ethereum2.0 SSZ encoder/decoder
MIT License
74 stars 44 forks source link

Exclude types before generating them #76

Closed ferranbt closed 2 years ago

ferranbt commented 2 years ago

Unlike the include-objs flag which forces sszgen to only generate objects that are included, the exclude-objs flag performs that filter after the generation is done. Thus, if an invalid object is present on the file, it cannot be excluded and the generation fails like in #75. An example of an invalid type would be:

type Bytes []byte

Since we cannot add tags to this alias struct. This type could never be rendered. I am still not sure if we should be smart and skip right away these objects from the generation. Then, for now, this is a good enough workaround to remove this limitation.

It also fixes the core issue on #75 in which the tags used to declare one alias would be used in another one.