From 22e5e9b3dd6b8633c78007665004ca67d84e8e34 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Wed, 27 Dec 2023 13:45:31 +0100
Subject: [PATCH] refac(smith-members): authority-members OnRemovedMember is no
 more used

---
 pallets/authority-members/src/lib.rs    |  1 -
 pallets/authority-members/src/mock.rs   |  1 -
 pallets/authority-members/src/traits.rs |  8 --------
 pallets/distance/src/mock.rs            |  1 -
 pallets/smith-members/src/impls.rs      |  7 -------
 runtime/common/src/handlers.rs          | 12 ------------
 runtime/common/src/pallets_config.rs    |  1 -
 7 files changed, 31 deletions(-)

diff --git a/pallets/authority-members/src/lib.rs b/pallets/authority-members/src/lib.rs
index f57ff7d39..006dd1bb0 100644
--- a/pallets/authority-members/src/lib.rs
+++ b/pallets/authority-members/src/lib.rs
@@ -69,7 +69,6 @@ pub mod pallet {
     {
         type IsMember: IsMember<Self::MemberId>;
         type OnNewSession: OnNewSession;
-        type OnRemovedMember: OnRemovedMember<Self::MemberId>;
         type OnOutgoingMember: OnOutgoingMember<Self::MemberId>;
         type OnIncomingMember: OnIncomingMember<Self::MemberId>;
         type OnBlacklistedMember: OnBlacklistedMember<Self::MemberId>;
diff --git a/pallets/authority-members/src/mock.rs b/pallets/authority-members/src/mock.rs
index c5aaa5f2d..d5be56ef9 100644
--- a/pallets/authority-members/src/mock.rs
+++ b/pallets/authority-members/src/mock.rs
@@ -156,7 +156,6 @@ impl pallet_authority_members::Config for Test {
     type MemberId = u64;
     type MemberIdOf = ConvertInto;
     type OnNewSession = ();
-    type OnRemovedMember = ();
     type RemoveMemberOrigin = system::EnsureRoot<u64>;
     type RuntimeEvent = RuntimeEvent;
     type WeightInfo = ();
diff --git a/pallets/authority-members/src/traits.rs b/pallets/authority-members/src/traits.rs
index 639ef95df..2b1331e4e 100644
--- a/pallets/authority-members/src/traits.rs
+++ b/pallets/authority-members/src/traits.rs
@@ -24,14 +24,6 @@ impl OnNewSession for () {
     fn on_new_session(_: SessionIndex) {}
 }
 
-pub trait OnRemovedMember<MemberId> {
-    fn on_removed_member(member_id: MemberId);
-}
-
-impl<MemberId> OnRemovedMember<MemberId> for () {
-    fn on_removed_member(_: MemberId) {}
-}
-
 /// Handle the consequences of a blacklisting for other pallets
 pub trait OnBlacklistedMember<MemberId> {
     fn on_blacklisted_member(member_id: MemberId);
diff --git a/pallets/distance/src/mock.rs b/pallets/distance/src/mock.rs
index bb020190a..9c181921e 100644
--- a/pallets/distance/src/mock.rs
+++ b/pallets/distance/src/mock.rs
@@ -185,7 +185,6 @@ impl pallet_authority_members::Config for Test {
     type MemberId = u32;
     type MemberIdOf = IdentityIndexOf<Self>;
     type OnNewSession = ();
-    type OnRemovedMember = ();
     type RemoveMemberOrigin = system::EnsureRoot<AccountId>;
     type RuntimeEvent = RuntimeEvent;
     type WeightInfo = ();
diff --git a/pallets/smith-members/src/impls.rs b/pallets/smith-members/src/impls.rs
index 937aa5104..7384ec421 100644
--- a/pallets/smith-members/src/impls.rs
+++ b/pallets/smith-members/src/impls.rs
@@ -4,13 +4,6 @@ use pallet_authority_members::SessionIndex;
 use pallet_identity::IdtyEvent;
 use sp_runtime::traits::Convert;
 
-/// We want to remove a Smith when he is removed from the higher level set of "authorities".
-impl<T: Config> pallet_authority_members::OnRemovedMember<T::MemberId> for Pallet<T> {
-    fn on_removed_member(_: T::MemberId) {
-        todo!("Remove smith as well")
-    }
-}
-
 // TODO: /// or //! ?
 /// We want to remove a Smith when he is removed (blacklisted) from the higher level set of "authorities".
 /// A blacklisting means the user does not respect the operational conditions for an authority, so
diff --git a/runtime/common/src/handlers.rs b/runtime/common/src/handlers.rs
index 5a5fc2ebd..cb01cd3c4 100644
--- a/runtime/common/src/handlers.rs
+++ b/runtime/common/src/handlers.rs
@@ -74,18 +74,6 @@ impl<
     }
 }
 
-// authority member removal handler
-pub struct OnRemovedAuthorityMemberHandler<Runtime>(core::marker::PhantomData<Runtime>);
-impl<Runtime> pallet_authority_members::traits::OnRemovedMember<Runtime::MemberId>
-    for OnRemovedAuthorityMemberHandler<Runtime>
-where
-    Runtime: pallet_smith_members::Config,
-{
-    fn on_removed_member(idty_index: Runtime::MemberId) {
-        pallet_smith_members::Pallet::<Runtime>::on_removed_member(idty_index);
-    }
-}
-
 // spend treasury handler
 pub struct TreasurySpendFunds<Runtime>(core::marker::PhantomData<Runtime>);
 impl<Runtime> pallet_treasury::SpendFunds<Runtime> for TreasurySpendFunds<Runtime>
diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs
index 8121de965..d06f97da0 100644
--- a/runtime/common/src/pallets_config.rs
+++ b/runtime/common/src/pallets_config.rs
@@ -235,7 +235,6 @@ macro_rules! pallets_config {
             type RuntimeEvent = RuntimeEvent;
             type IsMember = SmithMembers;
             type OnNewSession = OnNewSessionHandler<Runtime>;
-            type OnRemovedMember = OnRemovedAuthorityMemberHandler<Runtime>;
             type MemberId = IdtyIndex;
             type MemberIdOf = common_runtime::providers::IdentityIndexOf<Self>;
             type MaxAuthorities = MaxAuthorities;
-- 
GitLab