paritytech / parity-scale-codec

Lightweight, efficient, binary serialization and deserialization codec
Apache License 2.0
256 stars 94 forks source link

Fix `MaxEncodedLen` derive macro for enum with skipped variant #622

Closed gui1117 closed 2 months ago

gui1117 commented 2 months ago

right now MaxEncodedLen do not differentiate betwen skipped variants and normal variants on enum.

Now skipped variant are correctly skipped.

(also thinking again, it is not so much consistent to have skipped variant being not decodable and skipped fields being decoded to default value. Maybe it should be 2 different names)

gui1117 commented 2 months ago

CI fails because I am external maybe? or CI is down?

ggwpez commented 2 months ago

@gui1117 i started the CI now. Looks like the format is not happy and the clippy because of unconstructed variants 🙃

gui1117 commented 2 months ago

@gui1117 i started the CI now. Looks like the format is not happy and the clippy because of unconstructed variants 🙃

Thanks, it should be fixed hopefully