I have the following StorageMap
defined in my pallet:
#[pallet::storage]
pub(super) type Signatures<T: Config> = StorageMap<
_,
Blake2_128Concat,
T::Hash,
BoundedBTreeMap<Public, BoundedVec<u8, T::SignatureLength>, T::MaxAuthorities>,
>;
and in the benchmarks:
benchmarks!{
test_add{
type CustomMap= BoundedBTreeMap<sp_core::sr25519::Public, BoundedVec<u8, ConstU32<64>>, ConstU32<32>>;
let mut custom : CustomMap= BoundedBTreeMap::new();
let id = H256::default();// using a concrete type also wouldn't work
let hash = T::Hash::default();
}:{
Signatures::<T>::insert(hash, custom);
}
} it gives me the following error:
error[E0277]: the trait bound `frame_support::BoundedBTreeMap<sp_core::sr25519::Public, frame_support::BoundedVec<u8, ConstU32<64>>, ConstU32<32>>: EncodeL
ike<frame_support::BoundedBTreeMap<sp_core::sr25519::Public, frame_support::BoundedVec<u8, <T as pallet::Config>::SignatureLength>, <T as pallet::Config>::
MaxAuthorities>>` is not satisfied
--> /home/test/projects/custom/pallet/src/benchmarking.rs:70:46
|
70 | Signatures::<T>::insert(hash, custom);
| ---------------------- ^^^^^^ the trait `EncodeLike<frame_support::BoundedBTreeMap<sp_core::sr25519::Public, frame_support::Bou
ndedVec<u8, <T as pallet::Config>::SignatureLength>, <T as pallet::Config>::MaxAuthorities>>` is not implemented for `frame_support::BoundedBTreeMap<sp_cor
e::sr25519::Public, frame_support::BoundedVec<u8, ConstU32<64>>, ConstU32<32>>`
even though the same code is executed perfectly in the pallet with no errors.