Here's a snip from my file showing the relevant stuff:
#[pallet::config]
pub trait Config: frame_system::Config {
/// The ID type for freezes.
type FreezeIdentifier: Parameter + Member + MaxEncodedLen + Copy;
/// The maximum number of individual freeze locks that can exist on an account at any
time.
#[pallet::constant]
type MaxFreezes: Get<u32>;
}
#[pallet::storage]
pub type Freezes<T: Config> = StorageMap<
_,
Blake2_128Concat,
T::AccountId,
BoundedVec<IdAmount<T::FreezeIdentifier, T::NativeBalance>, T::MaxFreezes>,
ValueQuery,
>;
It's giving me a ton of errors all with the same format, just for different traits such as Encode and Decode:
error[E0277]: the trait bound `BoundedVec<IdAmount<<T as pallet::Config>::FreezeIdentifier, <T as pallet::Config>::NativeBalance>, <T as pallet::Config>::MaxFreezes>: parity_scale_codec::Decode` is not satisfied
--> pallets/bullposting/src/lib.rs:48:15
|
48 | #[pallet::pallet]
| _______________^
49 | | pub struct Pallet<T>(_);
50 | |
51 | | /// The pallet's configuration trait.
... |
133 | | #[pallet::storage]
134 | | pub type Freezes<T: Config> = StorageMap<
| |____________________^ the trait `parity_scale_codec::Decode` is not implemented for `BoundedVec<IdAmount<<T as pallet::Config>::FreezeIdentifier, <T as pallet::Config>::NativeBalance>, <T as pallet::Config>::MaxFreezes>`, which is required by `frame_support::pallet_prelude::StorageMap<_GeneratedPrefixForStorageFreezes<T>, frame_support::Blake2_128Concat, <T as frame_system::Config>::AccountId, BoundedVec<IdAmount<<T as pallet::Config>::FreezeIdentifier, <T as pallet::Config>::NativeBalance>, <T as pallet::Config>::MaxFreezes>, frame_support::pallet_prelude::ValueQuery>: StorageInfoTrait`
|
= note: required for `BoundedVec<IdAmount<<T as pallet::Config>::FreezeIdentifier, <T as pallet::Config>::NativeBalance>, <T as pallet::Config>::MaxFreezes>` to implement `FullCodec`
= note: required for `StorageMap<_GeneratedPrefixForStorageFreezes<T>, Blake2_128Concat, <T as Config>::AccountId, BoundedVec<..., ...>, ...>` to implement `StorageInfoTrait`
= note: the full name for the type has been written to '/home/tgang/rust/BullChain/target/debug/deps/pallet_bullposting-a4d011cb0bb97c3a.long-type-9057226278347970660.txt'
= note: consider using `--verbose` to print the full type name to the console
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
48 | #[pallet::pallet where BoundedVec<IdAmount<<T as pallet::Config>::FreezeIdentifier, <T as pallet::Config>::NativeBalance>, <T as pallet::Config>::MaxFreezes>: parity_scale_codec::Decode]
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I've found a few other questions along these lines but the fix for both was using Get<u32>
instead of Get<u16>
, but I'm already using Get<u32>
. I copied my code from the Balances pallet.
Get<u32>
instead ofGet<u16>
, but I'm already usingGet<u32>
. I didn't get your mean.type MaxFreezes: Get<u32>;
Both of the related Q&As I found hadGet<u16>
and the solution to their problems was to change it toGet<u32>
but I already have that, so neither of those helped me. @AurevoirXavier