From 9a1e8af944cb4ce32af64a3036625ca877fa6a97 Mon Sep 17 00:00:00 2001
From: zjb0807 <zjb0807@qq.com>
Date: Wed, 23 Jun 2021 00:59:54 +0800
Subject: [PATCH] Fix CandidateRemoved event (#503)

---
 cumulus/pallets/collator-selection/src/lib.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cumulus/pallets/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs
index 371154d0432..9800104a832 100644
--- a/cumulus/pallets/collator-selection/src/lib.rs
+++ b/cumulus/pallets/collator-selection/src/lib.rs
@@ -379,9 +379,9 @@ pub mod pallet {
 				candidates.remove(index);
 				<LastAuthoredBlock<T>>::remove(who.clone());
 				Ok(candidates.len())
-			});
+			})?;
 			Self::deposit_event(Event::CandidateRemoved(who.clone()));
-			current_count
+			Ok(current_count)
 		}
 
 		/// Assemble the current set of candidates and invulnerables into the next collator set.
-- 
GitLab