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

api.derive.staking.electedInfo returns duplicated data #5869

Closed
3 of 10 tasks
bizk opened this issue May 6, 2024 · 4 comments · Fixed by #5876
Closed
3 of 10 tasks

api.derive.staking.electedInfo returns duplicated data #5869

bizk opened this issue May 6, 2024 · 4 comments · Fixed by #5876

Comments

@bizk
Copy link

bizk commented May 6, 2024

  • I'm submitting a ...
  • Bug report
  • Feature request
  • Support request
  • Other
  • What is the current behavior and expected behavior?

When using api.derive.staking.electedInfo it will fetch duplicated data that should exist only once.

I.e if running the following code

        const resp:any = await this.dotAPI.derive.staking.electedInfo()
        resp['info'].map(async param => {
          console.log(param["accountId"].toString())
        })

will return something like this (where . . . represents repeated addresses)

5CFPcUJgYgWryPaV1aYjSbTpbTLu42V32Ytw1L9rfoMAsfGh
5CFPcUJgYgWryPaV1aYjSbTpbTLu42V32Ytw1L9rfoMAsfGh
5GTD7ZeD823BjpmZBCSzBQp7cvHR1Gunq7oDkurZr9zUev2n
5GTD7ZeD823BjpmZBCSzBQp7cvHR1Gunq7oDkurZr9zUev2n
.
.
.
5GTD7ZeD823BjpmZBCSzBQp7cvHR1Gunq7oDkurZr9zUev2n
5GYaYNVq6e855t5hVCyk4Wuqssaf6ADTrvdPZ3QXyHvFXTip
5CAsa5uG1i3Duq5NM1g8zYjNvUCwkwADxgFQiypSLTg6Hnwm
5CAsa5uG1i3Duq5NM1g8zYjNvUCwkwADxgFQiypSLTg6Hnwm
5CcHdjf6sPcEkTmXFzF2CfH7MFrVHyY5PZtSm1eZsxgsj1KC
5G1ojzh47Yt8KoYhuAjXpHcazvsoCXe3G8LZchKDvumozJJJ
5G1ojzh47Yt8KoYhuAjXpHcazvsoCXe3G8LZchKDvumozJJJ
.
.
.
5G1ojzh47Yt8KoYhuAjXpHcazvsoCXe3G8LZchKDvumozJJJ

REQUIRED:

  • Version: v11.0.2

  • Environment: node js v20.12.2

    • Node.js
    • Browser
    • Other (limited support for other environments)
  • Language: 4.8.3

    • JavaScript
    • TypeScript (include tsc --version)
    • Other
@TarikGul
Copy link
Member

TarikGul commented May 6, 2024

Thanks for reporting this, I am in the process of fixes the staking derives so I'll look into this today as well.

It currently looks like it has to do with api.derive.staking.queryMulti.

@TarikGul
Copy link
Member

TarikGul commented May 6, 2024

Im not exactly able to reproduce the above, what chain are you querying westend?

@bizk
Copy link
Author

bizk commented May 6, 2024

I have been using westend. I got it working by using api.derive.staking.queryMulti, but I found the behaviour odd

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants