Skip to content

Commit

Permalink
address Rachid comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed May 13, 2024
1 parent ca40136 commit 825f926
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/tokenfilter/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func SetupWithGenesisValSet(t testing.TB, valSet *tmtypes.ValidatorSet, genAccs

// do not require a network fee for this test
subspace := app.GetSubspace(minfee.ModuleName)
minfee.RegisterMinFeeParamTable(subspace)
subspace = minfee.RegisterMinFeeParamTable(subspace)
ctx := sdk.NewContext(app.CommitMultiStore(), tmproto.Header{}, false, log.NewNopLogger())
subspace.Set(ctx, minfee.KeyGlobalMinGasPrice, sdk.NewDec(0))

Expand Down
9 changes: 4 additions & 5 deletions x/minfee/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ type Params struct {
GlobalMinGasPrice sdk.Dec
}

// RegisterMinFeeParamTable attaches a key table to the provided subspace if it
// doesn't have one.
// RegisterMinFeeParamTable returns a subspace with a key table attached.
func RegisterMinFeeParamTable(subspace paramtypes.Subspace) paramtypes.Subspace {
if !subspace.HasKeyTable() {
return subspace.WithKeyTable(ParamKeyTable())
if subspace.HasKeyTable() {
return subspace
}
return subspace
return subspace.WithKeyTable(ParamKeyTable())
}

// ParamKeyTable returns the param key table for the global min gas price module
Expand Down

0 comments on commit 825f926

Please sign in to comment.