Commit d462202e authored by Pascal Engélibert's avatar Pascal Engélibert 🚴
Browse files

opti(ud): mul instead of adds for creating UD

parent 2feb399b
Pipeline #13486 passed with stages
in 41 minutes and 26 seconds
......@@ -191,15 +191,14 @@ pub mod pallet {
let total_weight: Weight = 0;
let ud_amount = <CurrentUdStorage<T>>::try_get().expect("corrupted storage");
let mut monetary_mass = <MonetaryMassStorage<T>>::try_get().expect("corrupted storage");
let monetary_mass = <MonetaryMassStorage<T>>::try_get().expect("corrupted storage");
for account_id in T::MembersIds::get() {
T::Currency::deposit_creating(&account_id, ud_amount);
monetary_mass += ud_amount;
Self::write_ud_history(n, account_id, ud_amount);
<MonetaryMassStorage<T>>::put(monetary_mass + ud_amount * members_count);
Self::deposit_event(Event::NewUdCreated(ud_amount, members_count));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment