diff --git a/modules/apps/27-interchain-accounts/controller/types/params.go b/modules/apps/27-interchain-accounts/controller/types/params.go index d7b9cc83874..5baaaa8b1df 100644 --- a/modules/apps/27-interchain-accounts/controller/types/params.go +++ b/modules/apps/27-interchain-accounts/controller/types/params.go @@ -33,7 +33,7 @@ func DefaultParams() Params { // Validate validates all controller submodule parameters func (p Params) Validate() error { - if err := validateEnabled(p.ControllerEnabled); err != nil { + if err := validateEnabledType(p.ControllerEnabled); err != nil { return err } @@ -43,11 +43,11 @@ func (p Params) Validate() error { // ParamSetPairs implements params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyControllerEnabled, p.ControllerEnabled, validateEnabled), + paramtypes.NewParamSetPair(KeyControllerEnabled, p.ControllerEnabled, validateEnabledType), } } -func validateEnabled(i interface{}) error { +func validateEnabledType(i interface{}) error { _, ok := i.(bool) if !ok { return fmt.Errorf("invalid parameter type: %T", i) diff --git a/modules/apps/27-interchain-accounts/host/types/params.go b/modules/apps/27-interchain-accounts/host/types/params.go index 7193e2f373c..af28c413c9e 100644 --- a/modules/apps/27-interchain-accounts/host/types/params.go +++ b/modules/apps/27-interchain-accounts/host/types/params.go @@ -39,7 +39,7 @@ func DefaultParams() Params { // Validate validates all host submodule parameters func (p Params) Validate() error { - if err := validateEnabled(p.HostEnabled); err != nil { + if err := validateEnabledType(p.HostEnabled); err != nil { return err } @@ -53,12 +53,12 @@ func (p Params) Validate() error { // ParamSetPairs implements params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyHostEnabled, p.HostEnabled, validateEnabled), + paramtypes.NewParamSetPair(KeyHostEnabled, p.HostEnabled, validateEnabledType), paramtypes.NewParamSetPair(KeyAllowMessages, p.AllowMessages, validateAllowlist), } } -func validateEnabled(i interface{}) error { +func validateEnabledType(i interface{}) error { _, ok := i.(bool) if !ok { return fmt.Errorf("invalid parameter type: %T", i) diff --git a/modules/apps/transfer/types/params.go b/modules/apps/transfer/types/params.go index 4ecdfab77e7..5b5fded0b4d 100644 --- a/modules/apps/transfer/types/params.go +++ b/modules/apps/transfer/types/params.go @@ -40,22 +40,22 @@ func DefaultParams() Params { // Validate all ibc-transfer module parameters func (p Params) Validate() error { - if err := validateEnabled(p.SendEnabled); err != nil { + if err := validateEnabledType(p.SendEnabled); err != nil { return err } - return validateEnabled(p.ReceiveEnabled) + return validateEnabledType(p.ReceiveEnabled) } // ParamSetPairs implements params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeySendEnabled, p.SendEnabled, validateEnabled), - paramtypes.NewParamSetPair(KeyReceiveEnabled, p.ReceiveEnabled, validateEnabled), + paramtypes.NewParamSetPair(KeySendEnabled, p.SendEnabled, validateEnabledType), + paramtypes.NewParamSetPair(KeyReceiveEnabled, p.ReceiveEnabled, validateEnabledType), } } -func validateEnabled(i interface{}) error { +func validateEnabledType(i interface{}) error { _, ok := i.(bool) if !ok { return fmt.Errorf("invalid parameter type: %T", i)