Skip to content

staking-info improvement on claimed #1577

@Imod7

Description

@Imod7

Description

This is an issue in continuation of the changes made in the #1445 PR, to implement a performance improvement and test checking in the staking-info endpoint (claimed field).

Performance Improvement

In the staking-info endpoint, an improvement can be done regarding the calculation of claimed that can potentially increase the performance of the endpoint.

  • Moving the OldCalls check outside the eras loop

Credits for this idea to @filvecchiato

Double Check Test Cases

It will be a good opportunity with the above improvement to also review existing tests & check if the below cases are covered:

  • Case of era < 518 and chain = isKusama -> the era is considered as claimed "automatically".
  • Case of status = undefined -> which is when we do not have enough info to determine the status of the era.
  • Case where staking.erasStakersOverview = null & erasStakers = 0 which can be implemented by mocking this request http://127.0.0.1:8080/accounts/CmjHFdR59QAZMuyjDF5Sn4mwTgGbKMH2cErUFuf6UT51UwS/staking-info?at=22869643

If not, consider of adding them as tests or adding those cases in the STAKING_IMPLEMENTATION_DETAILS guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions