diff --git a/CHANGELOG.md b/CHANGELOG.md index 2121cad050e..41e6a2dd2eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Fix the `StorageVec` type by excluding the `len_cached` field from its type info - [#2052](https://github.com/paritytech/ink/pull/2052) ## Version 5.0.0-rc diff --git a/crates/storage/src/lazy/vec.rs b/crates/storage/src/lazy/vec.rs index d6abb47abfc..910bc3e7bca 100644 --- a/crates/storage/src/lazy/vec.rs +++ b/crates/storage/src/lazy/vec.rs @@ -117,6 +117,7 @@ pub struct StorageVec { /// /// Because of caching, never operate on this field directly! /// Always use `fn get_len()` an `fn set_len()` instead. + #[cfg_attr(feature = "std", codec(skip))] len_cached: CachedLen, /// We use a [Mapping] to store all elements of the vector. /// Each element is living in storage under `&(KeyType::KEY, index)`. @@ -130,15 +131,6 @@ pub struct StorageVec { #[derive(Debug)] struct CachedLen(Cell>); -#[cfg(feature = "std")] -impl scale_info::TypeInfo for CachedLen { - type Identity = Option; - - fn type_info() -> scale_info::Type { - ::type_info() - } -} - impl Default for StorageVec where V: Packed,