alloy-rs / rlp

Fast implementation of Ethereum RLP serialization
Apache License 2.0
77 stars 16 forks source link

Add enum example #6

Closed lightclient closed 11 months ago

lightclient commented 11 months ago

Spent some time with @ralexstokes and @echoalice trying to debug an issue in a custom encoder / decoder for an enum type. We ultimately realized that data needs to be advanced and were using Rlp to stream decode (which doesn't advance data). In retrospect this makes sense, but in the moment it isn't super clear.

I wanted to add a clarification to the documentation to mention this. Also thought it might be useful to have an enum example since we (mostly Alex) figured out how it might look!