Skip to content

Conversation

@Imod7
Copy link
Contributor

@Imod7 Imod7 commented Jan 6, 2026

Description

This PR is a continuation/additional fix of the previous fix/PR #1868

Changes

  • We are now taking into account the era key and we are iterating through the slashes per era. Consequently, the era info is added in the response.
  • The correct type of the unappliedSlashes is UnappliedSlashes where we have
    UnappliedSlash<T>,
    OptionQuery,
    
  • So, the information for each slash is an Option which we need to check and unwrap.
  • The correct type from pj-api is PalletStakingAsyncUnappliedSlash.

Testing

You can test this change:

  • with a local instance of Sidecar with .env file:
SAS_SUBSTRATE_URL=wss://kusama-asset-hub-rpc.polkadot.io
SAS_SUBSTRATE_MULTI_CHAIN_URL='[{"url":"wss://kusama-rpc.polkadot.io","type":"relay"}]'
  • and querying the endpoint http://127.0.0.1:8080/pallets/staking/progress
  • which returns
 "unappliedSlashes": [
    {
      "era": "9027",
      "validator": "D5aAp1y8XfkrmtPqsGFZtCjJrPZqKrsG2ceSha846jy6RMU",
      "own": "3289142260",
      "others": [
        [
          "G1rrUNQSk7CjjEmLSGcpNu72tVtyzbWdUvgmSer9eBitXWf",
          "5213796174"
        ],
        [
          "G4RasQNUjgkXkdCuW2zgMJPcjZijaTmkJixb3oMxg9eiHng",
          "58511039826"
        ],
        ....
      ],
      "reporter": "Ed1xXhwva7tsK6sY5WnRQNVQ5bXC2kNbkpbU1EhjPZy4Cb6",
      "payout": "7407060837"
    }
  ],

Credits

Credits and thanks to @Ank4n for pinpointing the correct type in p-sdk and recommending to iterate by era 💯

@Imod7 Imod7 requested a review from a team as a code owner January 6, 2026 12:37
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Imod7 Imod7 merged commit 51d7293 into master Jan 6, 2026
13 checks passed
@Imod7 Imod7 deleted the domi-fix-unappliedSlashes-2 branch January 6, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants