You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, RlpEncodableWrapper/RlpDecodableWrapper can only be derived for single-field structs.
This contradicts the documentation, which explicitly mentions more than one field:
Derives Encodable for the type which encodes the fields as-is, without a header: <fields...>
There are several use cases where "headerless" encoding would be very helpful. So it should be considered if the documented behavior should be added. Otherwise, at least the documentation should be corrected to match the implementation.
An example of such a use case would be to implement something like #[serde(flatten)] by manually calling the headerless encoding of the structs to be flattened. This could, e.g., be useful for simplifying EIP-2718 transaction encoding.
The text was updated successfully, but these errors were encountered:
This makes sense, although I'd say the current documentation should be changed to say field instead of fields since it's mainly used for the newtype pattern.
Traits for headerless encoding, length, and rlp(flatten) would make it possible to replace lots of existing manual rlp implementations with derived encoding / decoding, basically this suggestion: #10
Currently,
RlpEncodableWrapper
/RlpDecodableWrapper
can only be derived for single-field structs.This contradicts the documentation, which explicitly mentions more than one field:
There are several use cases where "headerless" encoding would be very helpful. So it should be considered if the documented behavior should be added. Otherwise, at least the documentation should be corrected to match the implementation.
An example of such a use case would be to implement something like
#[serde(flatten)]
by manually calling the headerless encoding of the structs to be flattened. This could, e.g., be useful for simplifying EIP-2718 transaction encoding.The text was updated successfully, but these errors were encountered: