Skip to content
Snippets Groups Projects
Commit d6706d9d authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

deduplicate authorities events

parent d17dcd65
No related branches found
No related tags found
1 merge request!303Resolve "OutgoingAuthorities event is triggered too many times."
Pipeline #39473 passed
......@@ -575,18 +575,25 @@ impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
return None;
}
// -- handle incoming members
// callback when smith is incoming
for member_id in members_ids_to_add.iter() {
T::OnIncomingMember::on_incoming_member(*member_id);
}
// a single event with all authorities
Self::deposit_event(Event::IncomingAuthorities {
members: members_ids_to_add.clone(),
});
}
// -- handle outgoing members
// callback when smith is outgoing
for member_id in members_ids_to_del.iter() {
T::OnOutgoingMember::on_outgoing_member(*member_id);
}
// a single event with all authorities
Self::deposit_event(Event::OutgoingAuthorities {
members: members_ids_to_del.clone(),
});
}
// updates the list of OnlineAuthorities and returns the list of their key
Some(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment