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: Distr-PR-1 Staking ConsPubKey -> ConsAddr index #2369

Merged
merged 13 commits into from
Sep 25, 2018

Conversation

rigelrozanski
Copy link
Contributor

@rigelrozanski rigelrozanski commented Sep 21, 2018

splitting up the distribution PRs cause there's a lot.

closes #2244
ref #2369
Note this PR also deletes old distribution (commented-out) code

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/)
  • Added entries in PENDING.md with issue #
  • rereviewed Files changed in the github PR explorer

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)

@rigelrozanski rigelrozanski changed the title Distr-PR-Fanclub-1 Staking ConsPubKey -> ConsAddr index WIP: Distr-PR-Fanclub-1 Staking ConsPubKey -> ConsAddr index Sep 21, 2018
@rigelrozanski rigelrozanski changed the title WIP: Distr-PR-Fanclub-1 Staking ConsPubKey -> ConsAddr index WIP: Distr-PR-1 Staking ConsPubKey -> ConsAddr index Sep 21, 2018
@rigelrozanski rigelrozanski changed the title WIP: Distr-PR-1 Staking ConsPubKey -> ConsAddr index R4R: Distr-PR-1 Staking ConsPubKey -> ConsAddr index Sep 21, 2018
@rigelrozanski
Copy link
Contributor Author

I tried to keep the refactors to a minimum in this PR but there are some basic ones which I just left in (copied from fee-distribution PR)

Copy link
Contributor

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

utACK

I agree with all of the refactors done here, I think they really cleanup the code. (Especially migrating more of the code to use address instead of pubkey, I think thats been needed for awhile now) Thanks Rigel!

docs/spec/staking/state.md Outdated Show resolved Hide resolved
x/stake/keeper/slash.go Show resolved Hide resolved
x/stake/keeper/validator.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 22, 2018

Codecov Report

Merging #2369 into develop will increase coverage by 2.84%.
The diff coverage is 67.46%.

@@             Coverage Diff             @@
##           develop    #2369      +/-   ##
===========================================
+ Coverage    61.94%   64.78%   +2.84%     
===========================================
  Files          132      135       +3     
  Lines         8245     8442     +197     
===========================================
+ Hits          5107     5469     +362     
+ Misses        2811     2602     -209     
- Partials       327      371      +44

cwgoes
cwgoes previously requested changes Sep 22, 2018
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.

Looks great, I think we can simplify just a bit further.

types/stake.go Outdated Show resolved Hide resolved
x/slashing/keeper_test.go Outdated Show resolved Hide resolved
x/stake/keeper/slash_test.go Outdated Show resolved Hide resolved
x/stake/keeper/slash_test.go Outdated Show resolved Hide resolved
x/stake/keeper/validator.go Outdated Show resolved Hide resolved
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.

LGTM -- Agree with @cwgoes comment and your suggestion in creating a helper function to get rid of ValidatorByConsPubKey.

types/stake.go Outdated Show resolved Hide resolved
@jaekwon jaekwon merged commit 6b59584 into develop Sep 25, 2018
@rigelrozanski rigelrozanski deleted the rigel/stake-cons-addr branch September 25, 2018 04:16
@rigelrozanski rigelrozanski restored the rigel/stake-cons-addr branch September 25, 2018 04:16
@rigelrozanski rigelrozanski deleted the rigel/stake-cons-addr branch September 25, 2018 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch staking Validator.ConsPubkey to Validator.ConsAddr
5 participants