git.delta.rocks / unique-network / refs/commits / 2937d8c55b68

difftreelog

fix(collator-selection) disable reward transfer when zero

Yaroslav Bolyukin2023-06-06parent: #2739fc6.patch.diff
in: master

1 file changed

modifiedpallets/collator-selection/src/lib.rsdiffbeforeafterboth
610 .unwrap_or_else(Zero::zero)610 .unwrap_or_else(Zero::zero)
611 .div(2u32.into());611 .div(2u32.into());
612
613 if !reward.is_zero() {
612 // `reward` is half of pot account minus ED, this should never fail.614 // `reward` is half of pot account minus ED, this should never fail.
613 let _success = T::Currency::transfer(&pot, &author, reward, Preservation::Preserve);615 let _success = T::Currency::transfer(&pot, &author, reward, Preservation::Preserve);
614 debug_assert!(_success.is_ok());616 debug_assert!(_success.is_ok());
617 }
615 <LastAuthoredBlock<T>>::insert(author, frame_system::Pallet::<T>::block_number());618 <LastAuthoredBlock<T>>::insert(author, frame_system::Pallet::<T>::block_number());
616619
617 frame_system::Pallet::<T>::register_extra_weight_unchecked(620 frame_system::Pallet::<T>::register_extra_weight_unchecked(