Skip to content

Commit

Permalink
fix TestNewControllerPortID (#7777)
Browse files Browse the repository at this point in the history
Co-authored-by: Gjermund Garaba <[email protected]>
  • Loading branch information
solkorap7 and gjermundgaraba authored Dec 20, 2024
1 parent 18162f0 commit 1b06e2b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/apps/27-interchain-accounts/types/port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ func (suite *TypesTestSuite) TestNewControllerPortID() {
name string
malleate func()
expValue string
expPass bool
expErr error
}{
{
"success",
func() {},
types.ControllerPortPrefix + TestOwnerAddress,
true,
nil,
},
{
"invalid owner address",
func() {
owner = " "
},
"",
false,
types.ErrInvalidAccountAddress,
},
}

Expand All @@ -45,12 +45,13 @@ func (suite *TypesTestSuite) TestNewControllerPortID() {

portID, err := types.NewControllerPortID(owner)

if tc.expPass {
if tc.expErr == nil {
suite.Require().NoError(err, tc.name)
suite.Require().Equal(tc.expValue, portID)
} else {
suite.Require().Error(err, tc.name)
suite.Require().Empty(portID)
suite.Require().ErrorIs(err, tc.expErr)
}
})
}
Expand Down

0 comments on commit 1b06e2b

Please sign in to comment.