* Bump deps

* Linting cleanups
This commit is contained in:
Jaco Greeff
2020-05-15 13:35:15 +02:00
committed by GitHub
parent f348e34de7
commit 45786b31da
19 changed files with 270 additions and 266 deletions
@@ -10,6 +10,7 @@ import BN from 'bn.js';
import { Observable, combineLatest, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { Option } from '@polkadot/types';
import { isFunction } from '@polkadot/util';
import { memo } from '../util';
@@ -103,12 +104,13 @@ function filterRewards (api: ApiInterfaceRx, rewards: DeriveStakerReward[], stak
}
const validators = uniqValidators(rewards);
const isNewPayouts = isFunction(api.tx.staking.payoutStakers);
return combineLatest([
api.query.staking.migrateEra
isFunction(api.query.staking.migrateEra)
? api.query.staking.migrateEra<Option<EraIndex>>()
: of({ unwrapOr: () => api.tx.staking.payoutStakers ? ZERO : MAX_ERAS }),
api.tx.staking.payoutStakers
: of({ unwrapOr: () => isNewPayouts ? ZERO : MAX_ERAS }),
isNewPayouts
? api.derive.staking.queryMulti(validators)
: of([])
]).pipe(