From c4af1699b41ece45784c4771f0b7333bc291e8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 16 Feb 2022 12:59:47 +0100 Subject: [PATCH 1/2] refactor: use mock module for closing handshakes in ics29 --- modules/apps/29-fee/ibc_module_test.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go index 8f1e4ad1f28..40df5a36fd3 100644 --- a/modules/apps/29-fee/ibc_module_test.go +++ b/modules/apps/29-fee/ibc_module_test.go @@ -318,14 +318,14 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { for _, tc := range testCases { tc := tc suite.Run(tc.name, func() { - suite.SetupTest() + suite.SetupMockTest() suite.coordinator.Setup(suite.path) // setup channel origBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress()) tc.setup(suite) - module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.TransferPort) + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) suite.Require().NoError(err) cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) @@ -334,12 +334,10 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { if tc.disabled { suite.Require().True( suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID), - "fee is not disabled on original channel: %s", suite.path.EndpointA.ChannelID, ) suite.Require().True( suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), "portID7", "channel-7"), - "fee is not disabled on other channel: %s", "channel-7", ) } else { @@ -405,7 +403,7 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { tc.setup(suite) - module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.TransferPort) + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) suite.Require().NoError(err) cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) @@ -414,12 +412,10 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { if tc.disabled { suite.Require().True( suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID), - "fee is not disabled on original channel: %s", suite.path.EndpointA.ChannelID, ) suite.Require().True( suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), "portID7", "channel-7"), - "fee is not disabled on other channel: %s", "channel-7", ) } else { From dc897738095726f2aac640aa6955d10de2996b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 16 Feb 2022 13:01:26 +0100 Subject: [PATCH 2/2] self-review fix --- modules/apps/29-fee/ibc_module_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go index 40df5a36fd3..13d1caa39f1 100644 --- a/modules/apps/29-fee/ibc_module_test.go +++ b/modules/apps/29-fee/ibc_module_test.go @@ -396,7 +396,7 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { for _, tc := range testCases { tc := tc suite.Run(tc.name, func() { - suite.SetupTest() + suite.SetupMockTest() suite.coordinator.Setup(suite.path) // setup channel origBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress())