currentEraPointsEarned not on V1

This commit is contained in:
Jaco Greeff
2019-11-03 00:12:15 +01:00
parent f8b9615e6b
commit 8d3cb72189
+4 -2
View File
@@ -8,7 +8,7 @@ import { DerivedStakingOverview } from '../types';
import { Observable, combineLatest, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { Vec } from '@polkadot/types';
import { createType, Vec } from '@polkadot/types';
import { drr, memo } from '../util';
import { indexes as sessionIndexes } from '../session';
@@ -31,7 +31,9 @@ export const overview = memo((api: ApiInterfaceRx): () => Observable<DerivedStak
combineLatest([
of({ currentElected, currentEra, currentIndex, validators, validatorCount }),
// this will change on a per block basis, keep it innermost (and it needs eraIndex)
api.query.staking.currentEraPointsEarned<EraPoints>(currentEra)
api.query.staking.currentEraPointsEarned
? api.query.staking.currentEraPointsEarned<EraPoints>(currentEra)
: of(createType('EraPoints'))
])
),
map(([{ currentElected, currentEra, currentIndex, validators, validatorCount }, eraPoints]): DerivedStakingOverview => ({