Additional derive cleanups (#4307)
* Additional derive cleanups * Adjust * Multi cache set * Adjust mapping
This commit is contained in:
@@ -14,7 +14,7 @@ import { erasHistoricApplyAccount } from './util';
|
||||
export function _stakerPrefs (instanceId: string, api: ApiInterfaceRx): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean) => Observable<DeriveStakerPrefs[]> {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean): Observable<DeriveStakerPrefs[]> =>
|
||||
api.query.staking.erasValidatorPrefs.multi(eras.map((era) => [era, accountId])).pipe(
|
||||
api.query.staking.erasValidatorPrefs.multi(eras.map((e) => [e, accountId])).pipe(
|
||||
map((all): DeriveStakerPrefs[] =>
|
||||
all.map((validatorPrefs, index): DeriveStakerPrefs => ({
|
||||
era: eras[index],
|
||||
|
||||
Reference in New Issue
Block a user