Skip to content

Commit

Permalink
test: follow up nits from coordinator method deprecations. (cosmos#5721)
Browse files Browse the repository at this point in the history
* Follow up nits from coordinator method deprecations.

- Use path method in coordinator functions for creating transfer/mock channels.
- Clean up three additional usages of old functions in tests.

* nit: address linting issue.
  • Loading branch information
DimitrisJim authored Jan 25, 2024
1 parent f49fd45 commit c62d15b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ func (suite *InterchainAccountsTestSuite) TestControlAccountAfterChannelClose()
// open a new channel on the same port
path.EndpointA.ChannelID = ""
path.EndpointB.ChannelID = ""
suite.coordinator.CreateChannels(path)
path.CreateChannels()

//nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck)
_, err = suite.chainA.GetSimApp().ICAControllerKeeper.SendTx(suite.chainA.GetContext(), nil, ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID, icaPacketData, ^uint64(0))
Expand Down
2 changes: 1 addition & 1 deletion modules/core/02-client/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func (suite *KeeperTestSuite) TestQueryUpgradedClientState() {
suite.SetupTest() // reset

path = ibctesting.NewPath(suite.chainA, suite.chainB)
suite.coordinator.SetupClients(path)
path.SetupClients()

req = &types.QueryUpgradedClientStateRequest{}

Expand Down
2 changes: 1 addition & 1 deletion modules/core/04-channel/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func (suite *KeeperTestSuite) TestSetPacketAcknowledgement() {
func (suite *KeeperTestSuite) TestSetUpgradeErrorReceipt() {
path := ibctesting.NewPath(suite.chainA, suite.chainB)
path.SetupConnections()
suite.coordinator.CreateChannels(path)
path.CreateChannels()

errorReceipt, found := suite.chainA.App.GetIBCKeeper().ChannelKeeper.GetUpgradeErrorReceipt(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)
suite.Require().False(found)
Expand Down
8 changes: 4 additions & 4 deletions testing/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ func (*Coordinator) CreateConnections(path *Path) {
// channels that use a mock application module that returns nil on all callbacks. This
// function is expects the channels to be successfully opened otherwise testing will
// fail.
func (coord *Coordinator) CreateMockChannels(path *Path) {
func (*Coordinator) CreateMockChannels(path *Path) {
path.EndpointA.ChannelConfig.PortID = MockPort
path.EndpointB.ChannelConfig.PortID = MockPort

coord.CreateChannels(path)
path.CreateChannels()
}

// CreateTransferChannels constructs and executes channel handshake messages to create OPEN
// ibc-transfer channels on chainA and chainB. The function expects the channels to be
// successfully opened otherwise testing will fail.
func (coord *Coordinator) CreateTransferChannels(path *Path) {
func (*Coordinator) CreateTransferChannels(path *Path) {
path.EndpointA.ChannelConfig.PortID = TransferPort
path.EndpointB.ChannelConfig.PortID = TransferPort

coord.CreateChannels(path)
path.CreateChannels()
}

// CreateChannel constructs and executes channel handshake messages in order to create
Expand Down

0 comments on commit c62d15b

Please sign in to comment.