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

R4R: Withdraw commission on self bond removal #3163

Merged
merged 2 commits into from
Dec 19, 2018
Merged

R4R: Withdraw commission on self bond removal #3163

merged 2 commits into from
Dec 19, 2018

Conversation

hendrikhofstadt
Copy link
Contributor

@hendrikhofstadt hendrikhofstadt commented Dec 19, 2018

Fixes #3160

Alternatively, we could also do this in takeValidatorFeePoolRewards


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@codecov
Copy link

codecov bot commented Dec 19, 2018

Codecov Report

Merging #3163 into develop will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             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
Copy link

codecov bot commented Dec 19, 2018

Codecov Report

Merging #3163 into cwgoes/gos-patch-1 will decrease coverage by 0.05%.
The diff coverage is 86.66%.

@@                  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

@hendrikhofstadt hendrikhofstadt changed the title WIP: Withdraw commission on self bond removal Withdraw commission on self bond removal Dec 19, 2018
@alexanderbez alexanderbez changed the title Withdraw commission on self bond removal R4R: Withdraw commission on self bond removal Dec 19, 2018
@alexanderbez alexanderbez added ready-for-review C:x/distribution distribution module related labels Dec 19, 2018
Copy link
Contributor

@alexanderbez alexanderbez left a 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) {
Copy link
Contributor

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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@cwgoes cwgoes changed the base branch from develop to cwgoes/gos-patch-1 December 19, 2018 14:54
@cwgoes
Copy link
Contributor

cwgoes commented Dec 19, 2018

@SLAMPER Please rebase on v0.28.1 (or my branch), we want a point release without the changes from develop.

@hendrikhofstadt
Copy link
Contributor Author

@cwgoes Did so.

Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK

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 this pull request may close these issues.

None yet

3 participants