Say I have a StorageDoubleMap
that stores Data
structs for each user and ContextId
#[pallet::storage]
pub type Info<T: Config> = StorageDoubleMap<
_,
Blake2_128Concat,
T::AccountId,
Twox64Concat,
T::ContextId,
Data,
>;
Is there an option to limit the amount of entries per AccountId
? Or should I keep a count of entries in a separate map?
Update:
Accessing a specific ContextId
for an AccountId
quickly is important to me, that's why I chose StorageDoubleMap
.
Moreover, a common operation will be to iterate over all ContextId
s for an AccountId
, which StorageDoubleMap
also has support for.