Skip to content

refactor(distribution)!: use collections for params state#16211

Merged
samricotta merged 8 commits into
mainfrom
sam/distribution/coll-params
May 22, 2023
Merged

refactor(distribution)!: use collections for params state#16211
samricotta merged 8 commits into
mainfrom
sam/distribution/coll-params

Conversation

@samricotta

@samricotta samricotta commented May 18, 2023

Copy link
Copy Markdown
Contributor

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 May 18, 2023 10:24
@github-actions github-actions Bot added the C:x/distribution distribution module related label May 18, 2023
@ghost ghost 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
Comment thread x/distribution/keeper/params.go Outdated
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
Copy Markdown
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 

Comment thread x/distribution/types/keys.go Outdated
Comment thread x/distribution/keeper/params.go Outdated

@julienrbrt julienrbrt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm!

Comment thread CHANGELOG.md Outdated
* `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
Copy Markdown
Contributor

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.

Comment thread x/distribution/keeper/keeper.go
@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

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