How do I mutate a DoubleStorageMapDoubleStorageMap
with a Vec<T::AccountId>Vec<T::AccountId>
as a value using a struct?
Data::<T>::mutate(
id.clone(),
user_id.clone(),
|params: &mut DataParams<T::AccountId>| {
params.users.push(new_user);
params.total_users += 1;
}
);
Data::<T>::mutate(
id.clone(),
user_id.clone(),
|params: &mut DataParams<T::AccountId>| {
params.users.push(new_user);
params.total_users += 1;
}
);
total_users
doesn't increase but users
only ever has one user.
What's the best way to accomplish this? The mutate
is within a for loop and needs to append multiple users.