implement BoundedEncodedLen (#8720)
* implement BoundedEncodedLen * update header * update imports * use impl_for_tuples instead of a custom macro * remove redundant where clause Co-authored-by:Bastian Köcher <bkchr@users.noreply.github.com> * impl for Compact<T> * impl BoundedEncodedLen for BoundedVec (#8727) * impl BoundedEncodedLen for bool * explicitly implement BoundedEncodedLen for each Compact form Turns out that u16 doesn't play nicely with the pattern; those values take two extra bytes, where all other cases take one. :( * rename BoundedEncodedLen -> MaxEncodedLen * add tests of compact encoded length Co-authored-by:
Bastian Köcher <bkchr@users.noreply.github.com>
Showing
- substrate/frame/support/src/storage/bounded_vec.rs 16 additions, 1 deletionsubstrate/frame/support/src/storage/bounded_vec.rs
- substrate/frame/support/src/traits.rs 3 additions, 0 deletionssubstrate/frame/support/src/traits.rs
- substrate/frame/support/src/traits/max_encoded_len.rs 132 additions, 0 deletionssubstrate/frame/support/src/traits/max_encoded_len.rs
Please register or sign in to comment