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

Refactor use of parameters in x/distribution to match module spec #5506

Merged
merged 5 commits into from
Jan 10, 2020

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Jan 10, 2020

The x/distribution made redundant use of parameters and did not follow the module spec. So we introduce a Params type and remove a lot of cruft and duplicate code. Also, move all parameter related logic that should be in types/ from keeper/.

ref: #5504


For contributor use:

  • 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.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alexanderbez alexanderbez added R4R T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). C:x/distribution distribution module related labels Jan 10, 2020
@codecov
Copy link

codecov bot commented Jan 10, 2020

Codecov Report

Merging #5506 into master will decrease coverage by 0.18%.
The diff coverage is 18.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5506      +/-   ##
==========================================
- Coverage   54.54%   54.35%   -0.19%     
==========================================
  Files         313      313              
  Lines       18875    18823      -52     
==========================================
- Hits        10295    10232      -63     
- Misses       7796     7812      +16     
+ Partials      784      779       -5
Impacted Files Coverage Δ
x/distribution/types/querier.go 0% <ø> (ø) ⬆️
x/distribution/client/common/common.go 21.81% <ø> (+5.81%) ⬆️
x/distribution/client/cli/query.go 0% <0%> (ø) ⬆️
x/distribution/types/params.go 0% <0%> (ø)
x/distribution/genesis.go 0% <0%> (ø) ⬆️
x/distribution/types/genesis.go 0% <0%> (ø) ⬆️
x/distribution/types/keys.go 0% <0%> (ø)
x/distribution/keeper/keeper.go 82.92% <100%> (+0.42%) ⬆️
x/distribution/keeper/params.go 100% <100%> (+50.79%) ⬆️
x/distribution/keeper/store.go 46.72% <51.06%> (ø) ⬆️
... and 4 more

x/distribution/keeper/key.go Outdated Show resolved Hide resolved
x/distribution/types/genesis.go Outdated Show resolved Hide resolved
@@ -135,7 +135,7 @@ func CreateTestInputAdvanced(t *testing.T, isCheckTx bool, initPower int64,
sk := staking.NewKeeper(cdc, keyStaking, supplyKeeper, pk.Subspace(staking.DefaultParamspace))
sk.SetParams(ctx, staking.DefaultParams())

keeper := NewKeeper(cdc, keyDistr, pk.Subspace(DefaultParamspace), sk, supplyKeeper, auth.FeeCollectorName, blacklistedAddrs)
keeper := NewKeeper(cdc, keyDistr, pk.Subspace(types.DefaultParamspace), sk, supplyKeeper, auth.FeeCollectorName, blacklistedAddrs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need to do a cleanup on the distr keeper tests eventually to use simapp

Copy link
Collaborator

@fedekunze fedekunze left a comment

Choose a reason for hiding this comment

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

ACK

@alexanderbez alexanderbez merged commit bf41dea into master Jan 10, 2020
@alexanderbez alexanderbez deleted the bez/5504-fix-distr-routes branch January 10, 2020 20:09
Codegnosis added a commit to unification-com/mainchain that referenced this pull request Jan 27, 2020
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 T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants