diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go index 8413a68f83f..da06cd44b12 100644 --- a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go @@ -9,6 +9,7 @@ import ( genesistypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/genesis/types" hosttypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -34,33 +35,33 @@ func (suite *GenesisTypesTestSuite) TestValidateGenesisState() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "failed to validate - empty value", func() { genesisState = genesistypes.GenesisState{} }, - false, + host.ErrInvalidID, }, { "failed to validate - invalid controller genesis", func() { genesisState = *genesistypes.NewGenesisState(genesistypes.ControllerGenesisState{Ports: []string{"invalid|port"}}, genesistypes.DefaultHostGenesis()) }, - false, + host.ErrInvalidID, }, { "failed to validate - invalid host genesis", func() { genesisState = *genesistypes.NewGenesisState(genesistypes.DefaultControllerGenesis(), genesistypes.HostGenesisState{}) }, - false, + host.ErrInvalidID, }, } @@ -74,10 +75,11 @@ func (suite *GenesisTypesTestSuite) TestValidateGenesisState() { err := genesisState.Validate() - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err, tc.name) } else { suite.Require().Error(err, tc.name) + suite.Require().ErrorIs(err, tc.expErr) } }) }