From 4bb3d42e5d5cb7f937543c6221ce2988e45583af Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Mon, 21 Nov 2022 23:08:23 +0100 Subject: [PATCH] [Fix] Get target count from TargetList instead of storage (#12748) Co-authored-by: parity-processbot <> --- frame/staking/src/pallet/impls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/staking/src/pallet/impls.rs b/frame/staking/src/pallet/impls.rs index 9be01dd823104..c22a2bd2d1f77 100644 --- a/frame/staking/src/pallet/impls.rs +++ b/frame/staking/src/pallet/impls.rs @@ -948,7 +948,7 @@ impl ElectionDataProvider for Pallet { } fn electable_targets(maybe_max_len: Option) -> data_provider::Result> { - let target_count = Validators::::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) {