-
Notifications
You must be signed in to change notification settings - Fork 336
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
Add query support for Distribution module #1154
Comments
Is this still relevant? A contract querying the distribution module is interesting for a contract that stakes, right? Maybe you could explain more about the use case to help understanding the motivation and figure out which queries matter the most. |
I think it is still relevant. Staking contracts are a very interesting design space. Here are couple examples of thing's I've discussed with folks:
|
I agree with this. We support a number of StakingQueries, we should expose some one rewards. Not sure if to extend StakingQuery or add a new Let's define the exact queries we want. |
Thank you for opening the discussion. I'm tracking this in #1521 now to make sure we are talking about the same queries and we have an efficient backend for them.
This would be distribution/DelegationRewards "queries the total rewards accrued by a delegation [= delegator, validator pair)].". I guess this is what wallets show as pending rewards and the value get zeroed on MsgWithdrawDelegatorReward. Those pending rewards will hardly match exactly what is withdrawn due to all the rounding in place. So I assume this is only useful for queries between the withdrawals.
This would be distribution/DelegationTotalRewards "queries the total rewards accrued by a each validator". I don't understand this doc string but seems to be everything that can be claimed by a delegator across multiple validators.
This is staking/Delegation which should be available. |
Let's start with those:
|
Was talking with @sgoya about a contract and it would be really nice to be able to query the distribution module like we can query the staking or bank module. Something like
query_all_rewards
orquery_rewards
similar toquery_all_balances
andquery_balances
in QuerierWrapper would be really useful.Have some folks that would be willing to contribute to this if you could provide some pointers.
The text was updated successfully, but these errors were encountered: