paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.

Home Page:https://paritytech.github.io/substrate-api-sidecar/dist/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/accounts/{accountId}/staking-info The return of this interface is changed (The key claimedRewards that returns the result becomes legacyClaimedRewards), why is this?

wangtao19911111 opened this issue · comments

Description

/accounts/{accountId}/staking-info The return of this interface is changed
(The key claimedRewards that returns the result becomes legacyClaimedRewards), why is this?

Steps to Reproduce

[Provide detailed steps for someone else to reproduce your bug.]

Expected vs. Actual Behavior

[A clear description of what you expected to happen and what actually happened.]

This is due to one of the changes mentioned in this PR :

StakingLedger.claimed_rewards, renamed to StakingLedger.legacy_claimed_rewards.

The reason of the renaming is because the use of StakingLedger.legacy_claimed_rewards is being deprecated and will be removed.

This directly impacts Sidecar's staking-info endpoint where all information found in StakingLedger is returned without any validation on specific fields, as seen here. Hence, as soon as the last runtime upgrade (v1.2.0) was enacted and the change took effect :

  • on Kusama (era 6514 (Apr 18)) and
  • Polkadot (era 1420 (Apr 21))
    (eras and dates mentioned in this PR)

it also resulted in the renaming of the field in Sidecar's response.

I will check the code in detail tomorrow and keep you updated of any related fixes.