-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Withdraw commission on self bond removal #3163
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3163 +/- ##
===========================================
- Coverage 55.03% 55.01% -0.02%
===========================================
Files 133 133
Lines 9438 9434 -4
===========================================
- Hits 5194 5190 -4
- Misses 3924 3927 +3
+ Partials 320 317 -3 |
Codecov Report
@@ Coverage Diff @@
## cwgoes/gos-patch-1 #3163 +/- ##
=====================================================
- Coverage 55.06% 55% -0.06%
=====================================================
Files 133 133
Lines 9435 9432 -3
=====================================================
- Hits 5195 5188 -7
- Misses 3923 3927 +4
Partials 317 317 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes LGTM and makes sense based upon the context of the issue. Not sure how something like this wasn't caught during simulation as it seems like a pretty common case.
In any case, this warrants a review from @cwgoes and/or @rigelrozanski.
Thanks @SLAMPER!
@@ -119,6 +122,15 @@ func (k Keeper) takeValidatorFeePoolRewards(ctx sdk.Context, operatorAddr sdk.Va | |||
return nil | |||
} | |||
|
|||
func (k Keeper) withdrawValidatorCommission(ctx sdk.Context, operatorAddr sdk.ValAddress) (types.FeePool, types.DecCoins) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
@@ -42,6 +42,9 @@ func (k Keeper) RemoveValidatorDistInfo(ctx sdk.Context, valAddr sdk.ValAddress) | |||
if vdi.DelAccum.Accum.IsPositive() { | |||
panic("Should not delete validator with unwithdrawn delegator accum") | |||
} | |||
if !vdi.ValCommission.IsZero() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
@SLAMPER Please rebase on |
@cwgoes Did so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK
Fixes #3160
Alternatively, we could also do this in
takeValidatorFeePoolRewards
For Admin Use: