[Fix] Get target count from TargetList instead of storage (#12748)

Co-authored-by: parity-processbot <>
This commit is contained in:
Roman Useinov
2022-11-21 23:08:23 +01:00
committed by GitHub
parent 3e7a277878
commit 4cb24da8f2
+1 -1
View File
@@ -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) {