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

no need for event when no changes to authority

parent f36c580f
No related branches found
No related tags found
1 merge request!303Resolve "OutgoingAuthorities event is triggered too many times."
This commit is part of merge request !303. Comments created here will be created in the context of that merge request.
......@@ -580,20 +580,24 @@ impl<T: Config> pallet_session::SessionManager<T::ValidatorId> for Pallet<T> {
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(),
});
// a single event with all authorities if some
if !members_ids_to_add.is_empty() {
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(),
});
// a single event with all authorities if some
if !members_ids_to_del.is_empty() {
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.
Finish editing this message first!
Please register or to comment