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

Fix staking rewards query #263

Closed
ethanfrey opened this issue Aug 28, 2020 · 1 comment · Fixed by #278
Closed

Fix staking rewards query #263

ethanfrey opened this issue Aug 28, 2020 · 1 comment · Fixed by #278
Assignees
Milestone

Comments

@ethanfrey
Copy link
Member

This came from CosmWasm/cosmwasm#513 (comment) and also requires CosmWasm/cosmwasm#515 and CosmWasm/wasmvm#134 to properly implement the return value.


There is a FullDelegation response, which does have an accumulated_rewards field, which is what you are looking for.

If you look into the go query handler, which calls into the Keeper to get the rewards. This is then transformed into the cosmwasm type to pass it into Rust. And should have the reward info.

Digging in, I see this was left as a TODO as I had no idea how to get such info from the staking module.

The implementation to calculate that was not done and needs to be implemented. Looking into this again, the calculation is done in distribution.Keeper.calculateDelegationRewards, which is a private method. Even the query method is private. And many of the functions used inside are private.

@ethanfrey ethanfrey added this to the v1.0.0 milestone Aug 28, 2020
@webmaster128 webmaster128 modified the milestones: v1.0.0, v0.11.0 Sep 15, 2020
@ethanfrey ethanfrey mentioned this issue Oct 4, 2020
6 tasks
@ethanfrey ethanfrey self-assigned this Oct 6, 2020
@alpe alpe self-assigned this Oct 6, 2020
@ethanfrey
Copy link
Member Author

I think I completed this one. If you see a better way to get this info, please let me know.

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 a pull request may close this issue.

3 participants