Skip to content

Commit

Permalink
fix to use expected error (#7778)
Browse files Browse the repository at this point in the history
Co-authored-by: Gjermund Garaba <[email protected]>
  • Loading branch information
Noulodado and gjermundgaraba authored Dec 20, 2024
1 parent 1b06e2b commit 719bbaf
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions modules/apps/27-interchain-accounts/types/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
testCases := []struct {
name string
malleate func()
expPass bool
expError error
}{
{
"success",
func() {},
true,
nil,
},
{
"success with empty account address",
Expand All @@ -318,7 +318,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
true,
nil,
},
{
"success with EncodingProto3JSON",
Expand All @@ -332,7 +332,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
true,
nil,
},
{
"unsupported encoding format",
Expand All @@ -346,7 +346,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
false,
types.ErrInvalidCodec,
},
{
"unsupported transaction type",
Expand All @@ -360,7 +360,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: "invalid-tx-type",
}
},
false,
types.ErrUnknownDataType,
},
{
"invalid controller connection",
Expand All @@ -374,7 +374,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
false,
connectiontypes.ErrInvalidConnection,
},
{
"invalid host connection",
Expand All @@ -388,7 +388,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
false,
connectiontypes.ErrInvalidConnection,
},
{
"invalid address",
Expand All @@ -402,7 +402,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
false,
types.ErrInvalidAccountAddress,
},
{
"invalid version",
Expand All @@ -416,7 +416,7 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
TxType: types.TxTypeSDKMultiMsg,
}
},
false,
types.ErrInvalidVersion,
},
}

Expand All @@ -439,10 +439,10 @@ func (suite *TypesTestSuite) TestValidateHostMetadata() {
metadata,
)

if tc.expPass {
if tc.expError == nil {
suite.Require().NoError(err, tc.name)
} else {
suite.Require().Error(err, tc.name)
suite.Require().ErrorIs(err, tc.expError)
}
})
}
Expand Down

0 comments on commit 719bbaf

Please sign in to comment.