ApiDerive.staking backwards compatibility. #5868
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR works on giving the support needed for backwards compatibility. With the recent staking breaking changes these PR's introduced: #5860 #5862 It also ended up breaking compatibility for some parachains in the UI.
This is part 1 of the staking changes saga, and once this goes in I can rework the UI to have support for the new and the old.
Summary
ownExposure
&&ownExposures
will properly build safe types for historic calls such aserasStakers
, anderasStakersClipped
. It also ensures the calls exist or else will default to the empty type.query
&&queryMulti
now take in a flagwithExposureErasStakersLegacy
and returns a new field calledexposureEraStakers
nextElected
now has support for botherasStakersPaged
anderasStakers
.TODO:
NOTE: My one concern is that api.derive.staking.stakersRewards* uses
withClaimedErasRewards
as a default flag here which could potentially still act as a regression for the UI.rel: polkadot-js/apps#10512
rel :polkadot-js/apps#10513
rel: polkadot-js/apps#10505