Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
crodriguezvega committed Jan 5, 2024
1 parent 5730ad1 commit 7cd3d83
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 9 additions & 4 deletions modules/core/04-channel/keeper/handshake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
ibctesting "github.com/cosmos/ibc-go/v8/testing"
)

const (
connectionID = "connection-0"
unauthorizedStatus = "status is Unauthorized"
)

type testCase = struct {
msg string
malleate func()
Expand Down Expand Up @@ -42,8 +47,8 @@ func (suite *KeeperTestSuite) TestChanOpenInit() {
}, false},
{"connection doesn't exist", func() {
// any non-empty values
path.EndpointA.ConnectionID = "connection-0"
path.EndpointB.ConnectionID = "connection-0"
path.EndpointA.ConnectionID = connectionID
path.EndpointB.ConnectionID = connectionID
}, false},
{"capability is incorrect", func() {
suite.coordinator.SetupConnections(path)
Expand Down Expand Up @@ -89,7 +94,7 @@ func (suite *KeeperTestSuite) TestChanOpenInit() {
msg: "unauthorized client",
expPass: false,
malleate: func() {
expErrorMsgSubstring = "status is Unauthorized"
expErrorMsgSubstring = unauthorizedStatus
suite.coordinator.SetupConnections(path)

// remove client from allowed list
Expand Down Expand Up @@ -685,7 +690,7 @@ func (suite *KeeperTestSuite) TestChanCloseInit() {
params := suite.chainA.App.GetIBCKeeper().ClientKeeper.GetParams(suite.chainA.GetContext())
params.AllowedClients = []string{}
suite.chainA.App.GetIBCKeeper().ClientKeeper.SetParams(suite.chainA.GetContext(), params)
expErrorMsgSubstring = "status is Unauthorized"
expErrorMsgSubstring = unauthorizedStatus
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions modules/core/04-channel/keeper/multihop_handshake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func (suite *MultihopTestSuite) TestChanOpenInit() {
}, false},
{"connection doesn't exist", func() {
// any non-empty values
suite.A().ConnectionID = "connection-0"
suite.Z().ConnectionID = "connection-0"
suite.A().ConnectionID = connectionID
suite.Z().ConnectionID = connectionID
}, false},
{"capability is incorrect", func() {
suite.SetupConnections()
Expand Down Expand Up @@ -84,7 +84,7 @@ func (suite *MultihopTestSuite) TestChanOpenInit() {
portCap = suite.A().Chain.GetPortCapability(ibctesting.MockPort)
}, true},
{"unauthorized client", func() {
expErrorMsgSubstring = "status is Unauthorized"
expErrorMsgSubstring = unauthorizedStatus
suite.coord.SetupConnections(suite.chanPath)

// remove client from allowed list
Expand Down

0 comments on commit 7cd3d83

Please sign in to comment.