diff --git a/pallets/authority-members/src/impls.rs b/pallets/authority-members/src/impls.rs index 33b51a286d19fd33fe646bed410a19deead1d591..d656f01e6d905427015a02697b026fd54ff036eb 100644 --- a/pallets/authority-members/src/impls.rs +++ b/pallets/authority-members/src/impls.rs @@ -23,7 +23,6 @@ #![allow(clippy::type_complexity)] use super::pallet::*; -use crate::OnBlacklistedMember; use frame_support::pallet_prelude::Weight; use frame_support::traits::Get; use pallet_offences::traits::OnOffenceHandler; @@ -55,7 +54,6 @@ where SlashStrategy::Blacklist => { for offender in offenders { if let Some(member_id) = T::MemberIdOf::convert(offender.offender.0.clone()) { - T::OnBlacklistedMember::on_blacklisted_member(member_id); Blacklist::<T>::mutate(|blacklist| { if !blacklist.contains(&member_id) { blacklist.push(member_id); diff --git a/pallets/authority-members/src/lib.rs b/pallets/authority-members/src/lib.rs index 006dd1bb007fd0ab5954dda5f423c46b249f782d..0a19ac2ea623b3143f9a4547f27bac9e8bb7d1f3 100644 --- a/pallets/authority-members/src/lib.rs +++ b/pallets/authority-members/src/lib.rs @@ -71,7 +71,6 @@ pub mod pallet { type OnNewSession: OnNewSession; type OnOutgoingMember: OnOutgoingMember<Self::MemberId>; type OnIncomingMember: OnIncomingMember<Self::MemberId>; - type OnBlacklistedMember: OnBlacklistedMember<Self::MemberId>; /// Max number of authorities allowed #[pallet::constant] type MaxAuthorities: Get<u32>; diff --git a/pallets/authority-members/src/mock.rs b/pallets/authority-members/src/mock.rs index d5be56ef936408527d2cbfe6a54c4dc2beecd6f9..4c818534a42d84227b1542ed68dc29f4c449804a 100644 --- a/pallets/authority-members/src/mock.rs +++ b/pallets/authority-members/src/mock.rs @@ -159,7 +159,6 @@ impl pallet_authority_members::Config for Test { type RemoveMemberOrigin = system::EnsureRoot<u64>; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); - type OnBlacklistedMember = (); type OnIncomingMember = (); type OnOutgoingMember = (); } diff --git a/pallets/authority-members/src/traits.rs b/pallets/authority-members/src/traits.rs index 2b1331e4e89e9fcae70bba91f1f3d70571c670f5..2bb98f77d134a8e3e6f6b45c53c88626309ee330 100644 --- a/pallets/authority-members/src/traits.rs +++ b/pallets/authority-members/src/traits.rs @@ -24,15 +24,6 @@ impl OnNewSession for () { fn on_new_session(_: SessionIndex) {} } -/// Handle the consequences of a blacklisting for other pallets -pub trait OnBlacklistedMember<MemberId> { - fn on_blacklisted_member(member_id: MemberId); -} -/// By default: no consequences -impl<MemberId> OnBlacklistedMember<MemberId> for () { - fn on_blacklisted_member(_: MemberId) {} -} - /// Handle the consequences of going in the authority set for other pallets. /// Typically, a smith won't expire as long as he is in the authority set. pub trait OnIncomingMember<MemberId> { diff --git a/pallets/distance/src/mock.rs b/pallets/distance/src/mock.rs index 9c181921edf87f4643a99aa818ea4c4beffb8559..dbcf9a811540d7d4f7578612c3a5361b5b4f544f 100644 --- a/pallets/distance/src/mock.rs +++ b/pallets/distance/src/mock.rs @@ -190,7 +190,6 @@ impl pallet_authority_members::Config for Test { type WeightInfo = (); type OnOutgoingMember = (); type OnIncomingMember = (); - type OnBlacklistedMember = (); } parameter_types! { diff --git a/pallets/smith-members/src/impls.rs b/pallets/smith-members/src/impls.rs index 7384ec4218f47342a477452e792418ec586ab596..a8c0ee3fb7384b519b8879ca7b7402960bad7258 100644 --- a/pallets/smith-members/src/impls.rs +++ b/pallets/smith-members/src/impls.rs @@ -5,18 +5,6 @@ use pallet_identity::IdtyEvent; use sp_runtime::traits::Convert; // 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 -/// he does not deserve the Smith role. -impl<T: Config> pallet_authority_members::OnBlacklistedMember<T::MemberId> for Pallet<T> { - fn on_blacklisted_member(member_id: T::MemberId) { - Pallet::<T>::smith_goes_blacklisted( - T::IdtyIdOfAuthorityId::convert(member_id).expect("convertion should be ok"), - ); - } -} - -/// impl<T: Config> pallet_authority_members::OnOutgoingMember<T::MemberId> for Pallet<T> { fn on_outgoing_member(member_id: T::MemberId) { Pallet::<T>::smith_goes_offline( diff --git a/pallets/smith-members/src/lib.rs b/pallets/smith-members/src/lib.rs index 66ab569c58dec1efef910d27cdac139a7b656ac5..f65e3cf4d32845ea26f3d1a3ab46a990938a5682 100644 --- a/pallets/smith-members/src/lib.rs +++ b/pallets/smith-members/src/lib.rs @@ -531,15 +531,6 @@ impl<T: Config> Pallet<T> { } } - // TODO: return what? - fn smith_goes_blacklisted(_idty_index: T::IdtyIndex) { - // TODO: for now, just let smith_goes_offline do the job - // if let Some(_) = Smiths::<T>::get(idty_index) { - // Smiths::<T>::remove(idty_index); - // T::OnSmithDelete::on_smith_delete(idty_index, SmithRemovalReason::Blacklisted); - // } - } - fn provide_is_member(idty_id: &T::IdtyIndex) -> bool { let Some(smith) = Smiths::<T>::get(idty_id) else { return false; diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index d06f97da0f02b81ca3c83a6247f4e1faa98632b4..bd0986770eaa1498a77dd5418e35a856c0a5d55b 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -240,7 +240,6 @@ macro_rules! pallets_config { type MaxAuthorities = MaxAuthorities; type RemoveMemberOrigin = EnsureRoot<Self::AccountId>; type WeightInfo = common_runtime::weights::pallet_authority_members::WeightInfo<Runtime>; - type OnBlacklistedMember = SmithMembers; type OnIncomingMember = SmithMembers; type OnOutgoingMember = SmithMembers; }