Skip to content

Commit

Permalink
refactor: avoid use paramset for getParam keeper method (tendermint…
Browse files Browse the repository at this point in the history
…#998)

* fetch all paramset instead one by one field

* git commit -am "change `GetParams` from campaign module to avoid use the `paramset`"

* fix merge issues

Co-authored-by: Lucas Bertrand <[email protected]>
  • Loading branch information
Pantani and lumtis authored Dec 9, 2022
1 parent 7e769a1 commit cbb7e55
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions x/campaign/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import (
"github.com/tendermint/spn/x/campaign/types"
)

// GetParams returns the total set of campaign parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, &params)
return params
// GetParams get all parameters as types.Params
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
return types.NewParams(
k.TotalSupplyRange(ctx).MinTotalSupply,
k.TotalSupplyRange(ctx).MaxTotalSupply,
k.CampaignCreationFee(ctx),
k.MaxMetadataLength(ctx),
)
}

// SetParams sets the campaign parameters to the param space.
Expand Down

0 comments on commit cbb7e55

Please sign in to comment.