Allow geneic args for keys/entries (#3165)

This commit is contained in:
Jaco Greeff
2021-02-10 13:04:23 +01:00
committed by GitHub
parent 3e014b38e6
commit 40edc131fe
8 changed files with 33 additions and 27 deletions
@@ -18,7 +18,7 @@ export function nextElected (instanceId: string, api: ApiInterfaceRx): () => Obs
// only populate for next era in the last session, so track both here - entries are not
// subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh
switchMap(({ currentEra }) => api.query.staking.erasStakers.keys(currentEra)),
map((keys) => keys.map((key) => key.args[1]))
map((keys) => keys.map(({ args: [, accountId] }) => accountId))
)
: api.query.staking.currentElected<AccountId[]>()
);