Bump metadata (incl. lazy payouts) (#1995)

* Bump metadata (inl. lazy payouts)

* Fix currentElected via generic

* Update tests for latest metadata
This commit is contained in:
Jaco Greeff
2020-03-03 16:13:28 +01:00
committed by GitHub
parent d462a1d6c0
commit 4feed1db5d
14 changed files with 660 additions and 159 deletions
@@ -3,6 +3,7 @@
// of the Apache-2.0 license. See the LICENSE file for details.
import { ApiInterfaceRx } from '@polkadot/api/types';
import { AccountId } from '@polkadot/types/interfaces';
import { DeriveStakingValidators } from '../types';
import { Observable, combineLatest, of } from 'rxjs';
@@ -26,7 +27,7 @@ export function validators (api: ApiInterfaceRx): () => Observable<DeriveStaking
api.query.staking?.currentElected
? api.query.staking.erasStakers
? of(null)
: api.query.staking.currentElected()
: api.query.staking.currentElected<AccountId[]>()
: of([])
]).pipe(
map(([validators, nextElected]): DeriveStakingValidators => ({