-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Launchpad: Make distKeeper.calculateDelegationRewards public #7466
Comments
@ethanfrey there is a
|
Great, so making this public should be a backport. |
@ethanfrey can we PR into master first and then backport to Launchpad? I think that is the general process we want to follow, right? |
The PR #5725 is already in master, so only a backport to Launchpad is needed. +1 for the process you described. |
Just pull in parts of that PR #5725, right? Not all of it. https://github.com/cosmos/cosmos-sdk/pull/5725/files#diff-de71192adba700b3255b1eab62bef50e in particular |
@ethanfrey is this still a desired feature for your team to have this back ported to Launchpad? |
@clevinson Nope, we are no longer developing on launchpad and have used the stargate improvement already. Thanks. |
Summary
I am trying to query the pending delegator rewards (this will be a very common request when people build staking derivates or other such instruments). But there is no public method to find this.
distKeeper.calculateDelegationRewards
provides the info, but cannot be called from another module.Problem Definition
It turns out the
distribution.NewQuerier()
indirectly exposes this call. My current workaround is:It works, but I feel it is a bit ugly
Proposal
Make the needed functions public, so I can write this easily.
Actually, looking deeper, the above may have side effects... in the query logic I see:
incrementValidatorPeriod
??It would be great to have
k.GetValidatorPeriod()
and then use period +1 or such. That is actually exposed viak.GetValidatorCurrentRewards().Period
, but maybe we could make this nicer....My final proposal would be to add a new function to distribution:
For Admin Use
The text was updated successfully, but these errors were encountered: