From 8d3cb72189db5a5a6015ebff28f5d29b1af00e68 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sun, 3 Nov 2019 00:12:15 +0100 Subject: [PATCH] currentEraPointsEarned not on V1 --- packages/api-derive/src/staking/overview.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/api-derive/src/staking/overview.ts b/packages/api-derive/src/staking/overview.ts index 45fb88512c..116101cdfd 100644 --- a/packages/api-derive/src/staking/overview.ts +++ b/packages/api-derive/src/staking/overview.ts @@ -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(currentEra) + api.query.staking.currentEraPointsEarned + ? api.query.staking.currentEraPointsEarned(currentEra) + : of(createType('EraPoints')) ]) ), map(([{ currentElected, currentEra, currentIndex, validators, validatorCount }, eraPoints]): DerivedStakingOverview => ({