Incorporate the new electing/electable naming into the code (#10956)

* Incorporate the new electing/electable naming into the code

* Update frame/election-provider-support/src/lib.rs

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>

* Update frame/election-provider-support/src/lib.rs

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>

* Some additional changes

* fmt

* update codec

* revert lock file to master

* fix doc test

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
This commit is contained in:
Kian Paimani
2022-03-19 12:24:41 +00:00
committed by GitHub
parent bbfdd38b69
commit 95192f0cda
9 changed files with 81 additions and 69 deletions
+2 -2
View File
@@ -860,7 +860,7 @@ impl<T: Config> ElectionDataProvider for Pallet<T> {
Ok(Self::validator_count())
}
fn voters(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<VoterOf<Self>>> {
fn electing_voters(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<VoterOf<Self>>> {
// This can never fail -- if `maybe_max_len` is `Some(_)` we handle it.
let voters = Self::get_npos_voters(maybe_max_len);
debug_assert!(maybe_max_len.map_or(true, |max| voters.len() <= max));
@@ -868,7 +868,7 @@ impl<T: Config> ElectionDataProvider for Pallet<T> {
Ok(voters)
}
fn targets(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<T::AccountId>> {
fn electable_targets(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<T::AccountId>> {
let target_count = Validators::<T>::count();
// We can't handle this case yet -- return an error.