Skip to content

Commit

Permalink
[Fix] Get target count from TargetList instead of storage (paritytech…
Browse files Browse the repository at this point in the history
…#12748)

Co-authored-by: parity-processbot <>
  • Loading branch information
ruseinov authored and ark0f committed Feb 27, 2023
1 parent 24c2bdd commit 4bb3d42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frame/staking/src/pallet/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ impl<T: Config> ElectionDataProvider for Pallet<T> {
}

fn electable_targets(maybe_max_len: Option<usize>) -> data_provider::Result<Vec<T::AccountId>> {
let target_count = Validators::<T>::count();
let target_count = T::TargetList::count();

// We can't handle this case yet -- return an error.
if maybe_max_len.map_or(false, |max_len| target_count > max_len as u32) {
Expand Down

0 comments on commit 4bb3d42

Please sign in to comment.