Skip to content
New issue

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

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

Already on GitHub? # to your account

Batch delegator rewards #3715

Closed
4 tasks
faboweb opened this issue Feb 22, 2019 · 2 comments · Fixed by #4101
Closed
4 tasks

Batch delegator rewards #3715

faboweb opened this issue Feb 22, 2019 · 2 comments · Fixed by #4101
Assignees
Labels
C:CLI C:x/distribution distribution module related
Milestone

Comments

@faboweb
Copy link
Contributor

faboweb commented Feb 22, 2019

Summary

As a developer
I want to query for the rewards of a delegators delegations per validator in one request
So I don't DDOS my app

Problem Definition

GET /distribution/delegators/{delegatorAddr}/rewards currently serves all rewards for my delegator.
It would be nice if this would show the rewards of that delegator by validator.

AC1

Proposed return struct:

{
  "total": 10.50,
  "rewards": [
    {
      "validator_address": "val_0_address",
      "rewards": "2.0",
    },
    {
      "validator_address": "val_1_address",
      "rewards": "2.0",
    },
    {
      "validator_address": "val_2_address",
      "rewards": "6.50",
    }
  ]
}

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

@fedekunze

@fedekunze fedekunze added this to the v0.35.0 milestone Apr 5, 2019
@fedekunze fedekunze added API C:CLI C:x/distribution distribution module related labels Apr 5, 2019
@fedekunze fedekunze changed the title Serve the validator for reward querying Batch delegator rewards Apr 8, 2019
@alessio
Copy link
Contributor

alessio commented Apr 12, 2019

@faboweb

Response alternative counterproposal:

{
  "total": 10.50,
  "rewards": [
    {
      "validator": "val_0_address",
      "rewards": "2.0",
    },
    {
      "validator": "val_1_address",
      "rewards": "2.0",
    },
    {
      "validator": "val_2_address",
      "rewards": "6.50",
    }
  ]
}

@faboweb
Copy link
Contributor Author

faboweb commented Apr 12, 2019

Looks good 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C:CLI C:x/distribution distribution module related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants