From c5d6c8e53e33a0d62a554a2b924e8bfa2576b221 Mon Sep 17 00:00:00 2001
From: bgallois <benjamin@gallois.cc>
Date: Tue, 18 Feb 2025 21:27:47 +0100
Subject: [PATCH] fix #291

---
 pallets/authority-members/src/lib.rs | 6 +++---
 runtime/common/src/handlers.rs       | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pallets/authority-members/src/lib.rs b/pallets/authority-members/src/lib.rs
index 99babcc9..f06f9d39 100644
--- a/pallets/authority-members/src/lib.rs
+++ b/pallets/authority-members/src/lib.rs
@@ -485,14 +485,14 @@ pub mod pallet {
         }
 
         /// Check if member is incoming.
-        fn is_incoming(member_id: &T::MemberId) -> bool {
+        pub fn is_incoming(member_id: &T::MemberId) -> bool {
             IncomingAuthorities::<T>::get()
                 .binary_search(member_id)
                 .is_ok()
         }
 
-        /// C&heck if member is online.
-        fn is_online(member_id: &T::MemberId) -> bool {
+        /// Check if member is online.
+        pub fn is_online(member_id: &T::MemberId) -> bool {
             OnlineAuthorities::<T>::get()
                 .binary_search(member_id)
                 .is_ok()
diff --git a/runtime/common/src/handlers.rs b/runtime/common/src/handlers.rs
index 078bb6d7..c056d983 100644
--- a/runtime/common/src/handlers.rs
+++ b/runtime/common/src/handlers.rs
@@ -178,7 +178,8 @@ impl<
     for OwnerKeyChangePermissionHandler<Runtime>
 {
     fn check_allowed(idty_index: &IdtyIndex) -> bool {
-        !pallet_authority_members::Pallet::<Runtime>::online().contains(idty_index)
+        !pallet_authority_members::Pallet::<Runtime>::is_online(idty_index)
+            && !pallet_authority_members::Pallet::<Runtime>::is_incoming(idty_index)
     }
 }
 
-- 
GitLab