Skip to content

Commit

Permalink
seperate legacy params functions
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Sep 23, 2023
1 parent 0705ef2 commit 367d6d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
23 changes: 1 addition & 22 deletions types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,14 @@ import (
"fmt"

errorsmod "cosmossdk.io/errors"

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

// Default period for closing bids for an auction
var (
//DefaultDenomCreationFee Default period for closing bids for an auction
DefaultDenomCreationFee = sdk.NewInt64Coin("uflix", 100_000_000) // 100FLIX
)

// Parameter keys
var (
ParamStoreKeyDenomCreationFee = []byte("DenomCreationFee")
)

var _ paramtypes.ParamSet = (*Params)(nil)

// ParamKeyTable returns the parameter key table.
func ParamKeyTable() paramtypes.KeyTable {
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
}

func NewONFTParams(denomCreationFee sdk.Coin) Params {
return Params{
DenomCreationFee: denomCreationFee,
Expand All @@ -39,13 +25,6 @@ func DefaultParams() Params {
)
}

// ParamSetPairs returns the parameter set pairs.
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
return paramtypes.ParamSetPairs{
paramtypes.NewParamSetPair(ParamStoreKeyDenomCreationFee, &p.DenomCreationFee, validateDenomCreationFee),
}
}

// ValidateBasic performs basic validation on onft parameters.
func (p Params) ValidateBasic() error {
if err := validateDenomCreationFee(p.DenomCreationFee); err != nil {
Expand Down
23 changes: 23 additions & 0 deletions types/params_legacy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package types

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

var (
ParamStoreKeyDenomCreationFee = []byte("DenomCreationFee")
)

var _ paramtypes.ParamSet = (*Params)(nil)

// ParamKeyTable returns the parameter key table.
func ParamKeyTable() paramtypes.KeyTable {
return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
}

// ParamSetPairs returns the parameter set pairs.
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
return paramtypes.ParamSetPairs{
paramtypes.NewParamSetPair(ParamStoreKeyDenomCreationFee, &p.DenomCreationFee, validateDenomCreationFee),
}
}

0 comments on commit 367d6d0

Please sign in to comment.