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>
This commit is contained in:
Peter Goodspeed-NiklausandBastian Köcher authored and GitHub committed 2021-05-04 13:57:32 +00:00
1 parent 1f21d77ad1
commit 98744eb3b2
3 files changed
+151 -1

No files matched your search

+3
View File
@@ -80,3 +80,6 @@ pub use dispatch::{EnsureOrigin, OriginTrait, UnfilteredDispatchable};
mod voting;
pub use voting::{CurrencyToVote, SaturatingCurrencyToVote, U128CurrencyToVote};
mod max_encoded_len;
pub use max_encoded_len::MaxEncodedLen;