Remove in-tree max-encoded-len and use the new SCALE codec crate instead (#9163)

* Update impl-codec to use new upstream MaxEncodedLen trait

* Adapt crates to use the updated codec crate for `MaxEncodedLen`

* Remove max-encoded-len crate altogether

* Fix test compilation in `pallet-proxy`

* reorganize import (#9186)

* Fix remaining `MaxEncodedLen` imports

* Fix remaining old usages of max-encoded-len crate

* Fix UI test

* Manually depend on new impl-codec to fix Polkadot companion build

* Use newly released primitive-types v0.9.1 that has new codec impls

* Make sure codec deps are up-to-date in crates that use them

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Igor MatuszewskiandGuillaume Thiolliere authored and GitHub committed 2021-07-05 20:37:24 +00:00
1 parent b61dd3e8c5
commit eb6d651f9c
70 files changed
+72 -1037

No files matched your search

@@ -267,7 +267,7 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
use #scrate::sp_runtime::SaturatedConversion;
let max_size = <
#value_type as #scrate::traits::MaxEncodedLen
#value_type as #scrate::codec::MaxEncodedLen
>::max_encoded_len()
.saturated_into();
@@ -301,7 +301,7 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
>::Hasher::max_len::<#key>();
let max_size = <
#value_type as #scrate::traits::MaxEncodedLen
#value_type as #scrate::codec::MaxEncodedLen
>::max_encoded_len()
.saturating_add(key_max_size)
.saturated_into();
@@ -342,7 +342,7 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
>::Hasher2::max_len::<#key2>();
let max_size = <
#value_type as #scrate::traits::MaxEncodedLen
#value_type as #scrate::codec::MaxEncodedLen
>::max_encoded_len()
.saturating_add(key1_max_size)
.saturating_add(key2_max_size)
@@ -378,7 +378,7 @@ pub fn decl_and_impl(def: &DeclStorageDefExt) -> TokenStream {
>::key_max_encoded_len();
let max_size = <
#value_type as #scrate::traits::MaxEncodedLen
#value_type as #scrate::codec::MaxEncodedLen
>::max_encoded_len()
.saturating_add(key_max_size)
.saturated_into();