diff --git a/x/liquidstakeibc/types/liquidstakeibc.go b/x/liquidstakeibc/types/liquidstakeibc.go index 21cdbb409..098603a17 100644 --- a/x/liquidstakeibc/types/liquidstakeibc.go +++ b/x/liquidstakeibc/types/liquidstakeibc.go @@ -97,6 +97,14 @@ func (hc *HostChain) Validate() error { if err != nil { return err } + err = sdk.ValidateDenom(hc.HostDenom) + if err != nil { + return err + } + err = sdk.ValidateDenom(hc.MintDenom()) + if err != nil { + return err + } if hc.DelegationAccount != nil { err = hc.DelegationAccount.Validate() if err != nil { diff --git a/x/liquidstakeibc/types/liquidstakeibc_test.go b/x/liquidstakeibc/types/liquidstakeibc_test.go index c24be445e..88ff437c6 100644 --- a/x/liquidstakeibc/types/liquidstakeibc_test.go +++ b/x/liquidstakeibc/types/liquidstakeibc_test.go @@ -395,6 +395,24 @@ func TestHostChain_Validate(t *testing.T) { }, wantErr: true, }, + { + name: "invalid host denom", + fields: func() fields { + newfields := validFields() + newfields.HostDenom = "@@@" + return newfields + }, + wantErr: true, + }, + { + name: "invalid mint_denom", + fields: func() fields { + newfields := validFields() + newfields.HostDenom = "denomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenomdenom" + return newfields + }, + wantErr: true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {