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

feat: decouple x/params from simapp #12259

Merged
merged 6 commits into from
Jun 15, 2022
Merged

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Jun 14, 2022

Description

Closes: #12023


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)

},
false,
},
// {
Copy link
Member Author

@julienrbrt julienrbrt Jun 14, 2022

Choose a reason for hiding this comment

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

@aaronc Shouldn't we use another app.yaml for this specific test? I feel like the default app.yaml from testutil should contain the minimum modules required for the tested specific module. Here, gov does not fall into this category.

Copy link
Member

Choose a reason for hiding this comment

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

Not really following. Can you explain more?

Copy link
Member Author

Choose a reason for hiding this comment

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

What I meant is from my understanding the app.yaml of a module should be minimalistic. That means only requiring modules that are dependencies or strictly required for running the module app.

Here we need to add as well the gov module which isn't a dependency of params.

Copy link
Member

Choose a reason for hiding this comment

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

That makes sense but seems like the tests were written in a tightly coupled way so they depend on gov... We'll need to do some refactoring of tests probably

@julienrbrt julienrbrt marked this pull request as ready for review June 14, 2022 22:44
@julienrbrt julienrbrt requested a review from a team as a code owner June 14, 2022 22:44
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Copy link
Member

Choose a reason for hiding this comment

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

im a bit worried about these direct dependencies. It could make versioning harder for us and users. Not sure alternative solutions

Copy link
Member

Choose a reason for hiding this comment

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

There shouldn't be a problem using an expected keeper interface instead

Copy link
Member Author

@julienrbrt julienrbrt Jun 15, 2022

Choose a reason for hiding this comment

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

I think sometimes with expected keepers we still need to import the types. I am not sure it solve that concern then.

It seems it does here tho as the input is only a context for staking, so I will fix that.

However for gov it won't work as we import types as well.

@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #12259 (295b617) into main (4385325) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12259      +/-   ##
==========================================
+ Coverage   66.08%   66.10%   +0.01%     
==========================================
  Files         675      675              
  Lines       71275    71276       +1     
==========================================
+ Hits        47104    47114      +10     
+ Misses      21527    21518       -9     
  Partials     2644     2644              
Impacted Files Coverage Δ
x/params/module.go 55.55% <100.00%> (-13.80%) ⬇️
x/params/simulation/proposals.go 100.00% <100.00%> (ø)
x/params/keeper/querier.go 0.00% <0.00%> (-4.00%) ⬇️
crypto/keys/internal/ecdsa/privkey.go 83.01% <0.00%> (+1.88%) ⬆️
x/distribution/simulation/operations.go 90.21% <0.00%> (+9.78%) ⬆️

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

LGTM

@julienrbrt julienrbrt merged commit 669db98 into main Jun 15, 2022
@julienrbrt julienrbrt deleted the julien/params-decouple-simapp branch June 15, 2022 23:21
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
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.

migrate x/params to use app wiring
5 participants