Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: claimed in staking info endpoint #1445

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c65010a
fix: claimed in staking info endpoint
Imod7 Jun 4, 2024
50943e1
fix existing tests
Imod7 Jun 4, 2024
82457aa
add test for kusama (includes era 6508)
Imod7 Jun 7, 2024
9012e24
updated docs
Imod7 Jun 13, 2024
f320c08
implement new logic & update test responses
Imod7 Jun 14, 2024
2aa5996
add test for partially claimed & overview = null
Imod7 Jun 18, 2024
de06c6b
updated docs
Imod7 Jun 18, 2024
8c47eda
output up until 84 eras & update tests
Imod7 Jun 18, 2024
56e3738
merge master, update historical tests & code for lastReward
Imod7 Jun 20, 2024
9e838e8
Remove yarn.lock files from PR
Imod7 Jun 20, 2024
753f3ee
check before unwrapping & fix types
Imod7 Jun 21, 2024
7ac0236
run linter
Imod7 Jun 21, 2024
171e10a
docs: added links & updated schema description
Imod7 Jun 24, 2024
88be07e
updated logic of claimed field for validator account
Imod7 Aug 5, 2024
cd66735
fix for claimed in case of validator account
Imod7 Aug 6, 2024
00a54a0
moved validator logic in separate function
Imod7 Aug 22, 2024
df175e8
adding first draft of nominator logic
Imod7 Sep 16, 2024
0829f44
nominator logic when validator era partially claimed
Imod7 Sep 19, 2024
22ad9f7
added test for nominator
Imod7 Nov 4, 2024
b04c28f
Merged master, resolve conflicts & rebuilt docs
Imod7 Nov 4, 2024
4a2cba0
run linter
Imod7 Nov 4, 2024
343f2cb
abstracting logic into separate functions
Imod7 Nov 5, 2024
af6f130
add implementation_details guide
Imod7 Jan 6, 2025
f0c3e3f
remove docs dist
Imod7 Jan 6, 2025
18e840a
kept historical tests data but changed format
Imod7 Jan 8, 2025
c7b7256
docs small update
Imod7 Jan 8, 2025
9bc1c08
Updated eras section & code comments
Imod7 Jan 10, 2025
9278ed9
updated cases section in implementation guide
Imod7 Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,603 changes: 0 additions & 13,603 deletions docs/dist/app.bundle.js

This file was deleted.

14 changes: 0 additions & 14 deletions docs/dist/index.html

This file was deleted.

79 changes: 0 additions & 79 deletions docs/dist/oauth2-redirect.html

This file was deleted.

36 changes: 29 additions & 7 deletions docs/src/openapi-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ paths:
- staking
summary: Get staking information for a _Stash_ account.
description: Returns information about a _Stash_ account's staking activity.
Replaces `/staking/{address}` from versions < v1.0.0.
Replaces `/staking/{address}` from versions < v1.0.0. The _Stash_ account
can be either a validator or nominator account.
operationId: getStakingSummaryByAccountId
parameters:
- name: accountId
Expand Down Expand Up @@ -2685,8 +2686,13 @@ components:
stakingLedger:
$ref: '#/components/schemas/StakingLedger'
description: >-
Note: Runtime versions of Kusama less than 1062 will either have `lastReward` in place of
`claimedRewards`, or no field at all. This is related to changes in reward distribution. See: [Lazy Payouts](https://github.com/paritytech/substrate/pull/4474), [Simple Payouts](https://github.com/paritytech/substrate/pull/5406)
Note: After Sidecar's v.20.0.0, we always return the field `claimedRewards` under `stakingLedger`.
Before we returned `lastReward`, `claimedRewards` or `legacyClaimedRewards`. While these fields (and their corresponding calls)
are still taken into account, they are now only used in the background to calculate the right values for the `claimedRewards` field.
Note on lastReward: Runtime versions of Kusama less than 1062 will either have `lastReward` in place of
`claimedRewards`, or no field at all. This is related to changes in reward distribution.
See: [Lazy Payouts](https://github.com/paritytech/substrate/pull/4474),
[Simple Payouts](https://github.com/paritytech/substrate/pull/5406)
AccountStakingPayouts:
type: object
properties:
Expand Down Expand Up @@ -4332,11 +4338,27 @@ components:
format: unsignedInteger
claimedRewards:
type: array
description: Array of eras for which the stakers behind a validator have
claimed rewards. Only updated for _validators._
description: Array of objects, each containing an `era` and its corresponding `status`,
which represents the rewards status of the queried Stash account. The queried account can either be
a validator or nominator account. This array is populated with values from `stakingLedger.legacyClaimedRewards`
or `stakingLedger.claimedRewards`, as well as the `query.staking.claimedRewards` call, depending
on whether the queried block is before or after the migration. For more details on the implementation
and the migration, refer to the related PR (https://github.com/paritytech/substrate-api-sidecar/pull/1445)
and linked issue (https://github.com/paritytech/substrate-api-sidecar/issues/1433#issuecomment-2075914389).
items:
type: string
format: unsignedInteger
type: object
properties:
era:
type: string
description: The era for which we check the rewards status.
format: unsignedInteger
status:
type: string
description: The rewards status of the stakers backing a validator.
enum:
- claimed
- unclaimed
- partially claimed
description: The staking ledger.
StakingProgress:
type: object
Expand Down
Loading
Loading