Add new staking types, support derives (#1828)

* Add new staking types

* StakingLedgerTo213 - StakingLedgerTo223

* StakingLedgerTo223 in polkadot (dev)

* Add derive activeEra

* Map Ponts -> RewardPoints

* StakingLedger override CHANGELOG

* Cleanups

* Apparent CC dupes (don't see it, but cleanup useul)

* Cleanup result formatting for indexes

* Map nextElected -> validators

* Fix StakingLedger to current

* Merge CHANGELOG

* Mention derive staking updates

* Mark derive changes as breaking
This commit is contained in:
Jaco Greeff
2020-02-24 16:52:48 +01:00
committed by GitHub
parent 64aa4dcc1c
commit cbc14cc291
14 changed files with 394 additions and 206 deletions
@@ -22,12 +22,16 @@ export function validators (api: ApiInterfaceRx): () => Observable<DeriveStaking
api.query.session
? api.query.session.validators()
: of([]),
api.query.staking
? api.query.staking.currentElected()
// FIXME need a replacement for currentElected in new
api.query.staking?.currentElected
? api.query.staking.erasStakers
? of(null)
: api.query.staking.currentElected()
: of([])
]).pipe(
map(([validators, currentElected]): DeriveStakingValidators => ({
currentElected, validators
map(([validators, nextElected]): DeriveStakingValidators => ({
nextElected: nextElected || validators,
validators
}))
));
}