Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emitting event when setting external validators #857

Merged
merged 13 commits into from
Feb 19, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pallets/external-validators/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ pub mod pallet {
NewEra { era: EraIndex },
/// A new force era mode was set.
ForceEra { mode: Forcing },
/// External validators were set.
ExternalValidatorsSet { validators: Vec<T::ValidatorId>, external_index: u64 },
}

#[pallet::error]
Expand Down Expand Up @@ -380,8 +382,10 @@ pub mod pallet {
) -> DispatchResult {
// If more validators than max, take the first n
let validators = BoundedVec::truncate_from(validators);
<ExternalValidators<T>>::put(validators);
<ExternalValidators<T>>::put(validators.clone());
<ExternalIndex<T>>::put(external_index);

Self::deposit_event(Event::<T>::ExternalValidatorsSet { validators: validators.into_inner(), external_index });
Ok(())
}

Expand Down
Loading