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

return the rewards amount on withdraw tx responses #3850

Closed
4 tasks
fedekunze opened this issue Mar 11, 2019 · 5 comments · Fixed by #4207
Closed
4 tasks

return the rewards amount on withdraw tx responses #3850

fedekunze opened this issue Mar 11, 2019 · 5 comments · Fixed by #4207
Assignees
Labels
C:x/distribution distribution module related
Milestone

Comments

@fedekunze
Copy link
Collaborator

fedekunze commented Mar 11, 2019

Summary

Displaying fees on clients obtained from reward withdrawal txs is not supported because the message doesn't have an amount field.

Problem Definition

See: luniehq/lunie#2222

Proposal

return the amount withdrawn by adding it to the response message


AC:

  • Have WithdrawDelegationRewards return the rewards withdrawn
  • Update handleMsgWithdrawDelegatorReward to include these rewards in a tag

cc: @alexanderbez


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@fedekunze fedekunze added API C:x/distribution distribution module related labels Mar 11, 2019
@alexanderbez
Copy link
Contributor

alexanderbez commented Mar 11, 2019

So we won't be able to return the amount as a result of the tx. I think we can do one of the following:

  1. Use the QueryDelegatorTotalRewards query as the amount (right before you invoke a withdraw)
  2. Add a tag for amount on the tx that you can then query

@fedekunze
Copy link
Collaborator Author

Can 1 and 2 results differ ? I think 2 is more accurate, right ?

@alexanderbez
Copy link
Contributor

I guess it's possible but unlikely. Yes (2) would be more ideal.

@fedekunze
Copy link
Collaborator Author

even if it's not ideal to parse the amount from the tag, I prefer to have the consistency of the amount withdrawn, so I'd go with 2.

cc: @cosmos/cosmos-ui

@faboweb
Copy link
Contributor

faboweb commented Mar 21, 2019

We can add it as a tag and return it in the actual response of the REST endpoint

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

Successfully merging a pull request may close this issue.

5 participants