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

Remove token factory config #1971

Merged
merged 7 commits into from
Dec 5, 2024
Merged

Remove token factory config #1971

merged 7 commits into from
Dec 5, 2024

Conversation

dssei
Copy link
Contributor

@dssei dssei commented Dec 3, 2024

Describe your changes and provide context

Move allowlist size app setting to gov params.

Testing performed to validate your change

  • Unit testing
  • local functional testing

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.

Project coverage is 61.85%. Comparing base (7c8e452) to head (277065e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
x/tokenfactory/types/params.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1971      +/-   ##
==========================================
+ Coverage   61.71%   61.85%   +0.14%     
==========================================
  Files         264      263       -1     
  Lines       23498    23503       +5     
==========================================
+ Hits        14501    14538      +37     
+ Misses       7985     7951      -34     
- Partials     1012     1014       +2     
Files with missing lines Coverage Δ
app/app.go 66.19% <ø> (+0.05%) ⬆️
app/test_helpers.go 60.00% <ø> (-0.51%) ⬇️
x/tokenfactory/keeper/createdenom.go 87.17% <100.00%> (ø)
x/tokenfactory/keeper/keeper.go 93.33% <100.00%> (+0.47%) ⬆️
x/tokenfactory/keeper/migrations.go 91.30% <100.00%> (+1.06%) ⬆️
x/tokenfactory/keeper/msg_server.go 87.27% <100.00%> (ø)
x/tokenfactory/types/keys.go 0.00% <ø> (ø)
x/tokenfactory/types/params.go 76.19% <80.00%> (+26.19%) ⬆️

... and 4 files with indirect coverage changes

@dssei dssei requested a review from mj850 December 4, 2024 17:56
Copy link
Contributor

@mj850 mj850 left a comment

Choose a reason for hiding this comment

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

Left some minor comments

@@ -4,4 +4,6 @@ package seiprotocol.seichain.tokenfactory;
option go_package = "github.com/sei-protocol/sei-chain/x/tokenfactory/types";

// Params defines the parameters for the tokenfactory module.
message Params {}
message Params {
int32 denom_allowlist_max_size = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: consider using uint32 for easier validation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -51,6 +51,10 @@ func (suite *KeeperTestSuite) TestMsgCreateDenom() {
}

func (suite *KeeperTestSuite) TestCreateDenom() {
largeAllowList := make([]string, 2001)
for i := 0; i < 2001; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Should we make this size (2001) relative to the MaxAllowListSize stored in params? (Ie MaxAlowListSize + 1).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -158,6 +156,10 @@ func (suite *KeeperTestSuite) TestCreateDenom() {
}

func (suite *KeeperTestSuite) TestUpdateDenom() {
largeAllowList := make([]string, 2001)
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment as above wrt making this exceed the MaxAllowListSize param

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -86,3 +81,9 @@ func (k Keeper) CreateModuleAccount(ctx sdk.Context) {
moduleAcc := authtypes.NewEmptyModuleAccount(types.ModuleName, authtypes.Minter, authtypes.Burner)
k.accountKeeper.SetModuleAccount(ctx, moduleAcc)
}

func (k Keeper) GetDenomAllowListMaxSize(ctx sdk.Context) int32 {
var demomAllowListMaxSize int32
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: denomAllowListMaxSize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)

// ParamTable for tokenfactory module.
const DenomAllowListMaxSize = 2000
Copy link
Contributor

Choose a reason for hiding this comment

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

DefaultDenomAllowListMaxSize? To make it clearer that this is just the default and might be changed by future gov proposals

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed and added comment

@dssei dssei requested review from philipsu522 and codchen December 5, 2024 00:00
@dssei dssei merged commit 15333e5 into main Dec 5, 2024
49 checks passed
@dssei dssei deleted the allowlist_config_update branch December 5, 2024 19:23
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.

3 participants