I have a StorageValue defined as follows

    #[pallet::getter(fn reg_students)]
    pub type RegStudents<T: Config> =
        StorageValue<_, BoundedVec<StudentId, T::MaxStudents>, ValueQuery>;

and the types are defined as follows

type MaxStudents: Get<u16>;

pub type StudentId = u32;

I am getting the following error compiling

62  | pub trait StorageValue<T: FullCodec> {
    |                           ^^^^^^^^^ required by this bound in `frame_support::StorageValue::get`
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
103 |     #[pallet::storage where sp_runtime::BoundedVec<u32, <T as pallet::Config>::MaxStudents>: Decode]

StorageValue<_, BoundedVec<StudentId, T::MaxStudents>, ValueQuery>;
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Decode` is not implemented for `sp_runtime::BoundedVec<u32, <T as pallet::Config>::MaxStudents>`

1 Answer 1


Please check the impl.


It requires Get<u32>.


type MaxStudents: Get<u32>;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.