x/gamm: Make all internal set functions private#2013
Merged
mergify[bot] merged 10 commits intomainfrom Jul 18, 2022
Merged
Conversation
AlpinYukseloglu
commented
Jul 17, 2022
Comment on lines
-177
to
+181
| s.App.GAMMKeeper.SetParams(s.Ctx, gammtypes.Params{ | ||
| PoolCreationFee: sdk.Coins{}, | ||
| }) | ||
|
|
||
| bondDenom := s.App.StakingKeeper.BondDenom(s.Ctx) | ||
| // TODO: use sdk crypto instead of tendermint to generate address | ||
| acc1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) | ||
|
|
||
| poolCreationFee := s.App.GAMMKeeper.GetParams(s.Ctx) | ||
| s.FundAcc(acc1, poolCreationFee.PoolCreationFee) | ||
| params := s.App.GAMMKeeper.GetParams(s.Ctx) |
Contributor
Author
There was a problem hiding this comment.
Context:
The use of SetParams here was unnecessary and was the only thing prevent us from making the function private, so it makes sense to remove it
The rest of the changes here fix the test, which was broken to begin with but was never caught because SetParams would always set the pool creation fee to zero
Member
There was a problem hiding this comment.
Ah nice, this is a good fix!
AlpinYukseloglu
commented
Jul 17, 2022
ValarDragon
approved these changes
Jul 17, 2022
Member
ValarDragon
left a comment
There was a problem hiding this comment.
LGTM, needs changelog entry.
Adding a backport label, if we need more things to be backported to get this through, can you backport them?
ValarDragon
reviewed
Jul 18, 2022
mergify bot
pushed a commit
that referenced
this pull request
Jul 18, 2022
Closes: #1945 ## What is the purpose of the change I believe these functions were only public because they needed to be for an older SDK version. I think it would be appropriate to make them private now so that they aren't exposed to other modules. ## Brief Changelog - Made the following functions private: `SetParams` `SetPool` `SetTotalLiquidity` `SetDenomLiquidity` - Commented out old upgrade code that prevented `SetParams` and `SetPool` from being made private - Removed use of `SetParams` in a superfluid test ## Testing and Verifying This change is a trivial rework / code cleanup without any test coverage. ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? (no) - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? (no) - How is the feature or change documented? (not documented) (cherry picked from commit 7fb5f82) # Conflicts: # CHANGELOG.md # app/upgrades/v4/upgrade_test.go # app/upgrades/v4/upgrades.go # x/gamm/genesis.go
This was referenced Apr 1, 2024
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #1945
What is the purpose of the change
I believe these functions were only public because they needed to be for an older SDK version. I think it would be appropriate to make them private now so that they aren't exposed to other modules.
Brief Changelog
SetParamsSetPoolSetTotalLiquiditySetDenomLiquiditySetParamsandSetPoolfrom being made privateSetParamsin a superfluid testTesting and Verifying
This change is a trivial rework / code cleanup without any test coverage.
Documentation and Release Note
Unreleasedsection inCHANGELOG.md? (no)