Skip to content
4 changes: 3 additions & 1 deletion substrate/frame/bags-list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,13 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
) -> Result<Option<(T::Score, T::Score)>, ListError> {
// If no voter at that node, don't do anything. the caller just wasted the fee to call this.
let node = list::Node::<T, I>::get(&account).ok_or(ListError::NodeNotFound)?;
if node.score != new_score {
Self::deposit_event(Event::<T, I>::ScoreUpdated { who: account.clone(), new_score });
}
let maybe_movement = List::update_position_for(node, new_score);
if let Some((from, to)) = maybe_movement {
Self::deposit_event(Event::<T, I>::Rebagged { who: account.clone(), from, to });
};
Self::deposit_event(Event::<T, I>::ScoreUpdated { who: account.clone(), new_score });
Ok(maybe_movement)
}

Expand Down
Loading