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(distribution)!: use collections for params state #16211

Merged
merged 8 commits into from
May 22, 2023

Conversation

samricotta
Copy link
Contributor

@samricotta samricotta commented May 18, 2023

Closes: #16210


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@samricotta samricotta self-assigned this May 18, 2023
@samricotta samricotta requested a review from a team as a code owner May 18, 2023 10:24
@github-actions github-actions bot added the C:x/distribution distribution module related label May 18, 2023
@github-prbot github-prbot requested review from a team, JeancarloBarrios and atheeshp and removed request for a team May 18, 2023 10:24
@samricotta samricotta requested a review from testinginprod May 18, 2023 10:25
bz, err := store.Get(types.ParamsKey)
if bz == nil || err != nil {
func (k Keeper) GetParams(ctx context.Context) (types.Params, error) {
params, err := k.Params.Get(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this function can be shorthanded to just return return k.Params.Get 

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

lgtm!

CHANGELOG.md Outdated
@@ -211,6 +211,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
* `simulation.NewOperationMsg` is now 2-arity instead of 3-arity with the obsolete argument `codec.ProtoCodec` removed.
* The field `OperationMsg.Msg` is now of type `[]byte` instead of `json.RawMessage`.

* (x/distribution)[#16211](https://github.com/cosmos/cosmos-sdk/pull/16211) Use collections for params state management.
Copy link
Member

Choose a reason for hiding this comment

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

nit space between the package and the PR and no need the space L213.

@samricotta samricotta added the A:automerge Automatically merge PR once all prerequisites pass. label May 22, 2023
@samricotta samricotta enabled auto-merge May 22, 2023 19:38
@samricotta samricotta added this pull request to the merge queue May 22, 2023
Merged via the queue into main with commit 2843261 May 22, 2023
@samricotta samricotta deleted the sam/distribution/coll-params branch May 22, 2023 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:Simulations C:x/distribution distribution module related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor(distribution): move Params to use collections
4 participants