mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
avoid reshuffling active validators (#2605)
This commit is contained in:
committed by
GitHub
parent
40a584bebc
commit
0fac590b84
@@ -116,12 +116,22 @@ impl<T: Config> Module<T> {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn set_active_validators(active: Vec<ValidatorId>) {
|
||||
pub(crate) fn set_active_validators_ascending(active: Vec<ValidatorId>) {
|
||||
ActiveValidatorIndices::set(
|
||||
(0..active.len()).map(|i| ValidatorIndex(i as _)).collect()
|
||||
);
|
||||
ActiveValidatorKeys::set(active);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn set_active_validators_with_indices(
|
||||
indices: Vec<ValidatorIndex>,
|
||||
keys: Vec<ValidatorId>,
|
||||
) {
|
||||
assert_eq!(indices.len(), keys.len());
|
||||
ActiveValidatorIndices::set(indices);
|
||||
ActiveValidatorKeys::set(keys);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user