Skip to content

Commit 508439c

Browse files
authored
Adjust nextElected to use erasStakersOverview (#6011)
1 parent 64e30dd commit 508439c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/api-derive/src/staking/validators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import { memo } from '../util/index.js';
1212
export function nextElected (instanceId: string, api: DeriveApi): () => Observable<AccountId[]> {
1313
return memo(instanceId, (): Observable<AccountId[]> =>
1414
// Compatibility for future generation changes in staking.
15-
api.query.staking.erasStakersPaged
15+
api.query.staking.erasStakersOverview
1616
? api.derive.session.indexes().pipe(
1717
// only populate for next era in the last session, so track both here - entries are not
1818
// subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh
19-
switchMap(({ currentEra }) => api.query.staking.erasStakersPaged.keys(currentEra)),
19+
switchMap(({ currentEra }) => api.query.staking.erasStakersOverview.keys(currentEra)),
2020
// Dedupe any duplicates
2121
map((keys) => [...new Set(keys.map(({ args: [, accountId] }) => accountId.toString()))].map((a) => api.registry.createType('AccountId', a)))
2222
)

0 commit comments

Comments
 (0)