From a5bde5c66a44b64f85ddea65917e21a73b1f63e9 Mon Sep 17 00:00:00 2001 From: Gjermund Garaba Date: Fri, 21 Jun 2024 18:13:11 +0200 Subject: [PATCH] refactor: rename SetupPath to SetupPaths --- e2e/tests/core/03-connection/connection_test.go | 2 +- e2e/tests/transfer/authz_test.go | 2 +- e2e/tests/transfer/base_test.go | 2 +- e2e/tests/transfer/forwarding_test.go | 2 +- e2e/tests/transfer/incentivized_test.go | 2 +- e2e/tests/transfer/upgradesv1_test.go | 2 +- e2e/tests/transfer/upgradesv2_test.go | 2 +- e2e/tests/upgrades/upgrade_test.go | 2 +- e2e/testsuite/testsuite.go | 11 ++++++----- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/e2e/tests/core/03-connection/connection_test.go b/e2e/tests/core/03-connection/connection_test.go index 9caeb4a302b..93dbcd98004 100644 --- a/e2e/tests/core/03-connection/connection_test.go +++ b/e2e/tests/core/03-connection/connection_test.go @@ -34,7 +34,7 @@ type ConnectionTestSuite struct { } func (s *ConnectionTestSuite) SetupTest() { - s.SetupPath(ibc.DefaultClientOpts(), s.TransferChannelOptions()) + s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions()) } // QueryMaxExpectedTimePerBlockParam queries the on-chain max expected time per block param for 03-connection diff --git a/e2e/tests/transfer/authz_test.go b/e2e/tests/transfer/authz_test.go index 6829bbd35ed..2a1d9b7c1fc 100644 --- a/e2e/tests/transfer/authz_test.go +++ b/e2e/tests/transfer/authz_test.go @@ -33,7 +33,7 @@ type AuthzTransferTestSuite struct { } func (suite *AuthzTransferTestSuite) SetupTest() { - suite.SetupPath(ibc.DefaultClientOpts(), suite.TransferChannelOptions()) + suite.SetupPaths(ibc.DefaultClientOpts(), suite.TransferChannelOptions()) } // QueryGranterGrants returns all GrantAuthorizations for the given granterAddress. diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index 5993f92862e..7acafea833f 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -34,7 +34,7 @@ type TransferTestSuite struct { } func (s *TransferTestSuite) SetupTest() { - s.SetupPath(ibc.DefaultClientOpts(), s.TransferChannelOptions()) + s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions()) } // QueryTransferParams queries the on-chain send enabled param for the transfer module diff --git a/e2e/tests/transfer/forwarding_test.go b/e2e/tests/transfer/forwarding_test.go index 8b4f6c0c461..1c96b978f9d 100644 --- a/e2e/tests/transfer/forwarding_test.go +++ b/e2e/tests/transfer/forwarding_test.go @@ -113,7 +113,7 @@ func (s *TransferForwardingTestSuite) TestForwarding_WithLastChainBeingICS20v1_S // Creating a new path between chain B and chain C with a ICS20-v1 channel opts := s.TransferChannelOptions() opts.Version = transfertypes.V1 - channelBtoC, _ := s.CreateNewPath(ctx, chainB, chainC, ibc.DefaultClientOpts(), opts) + channelBtoC, _ := s.CreatePath(ctx, chainB, chainC, ibc.DefaultClientOpts(), opts) s.Require().Equal(transfertypes.V1, channelBtoC.Version, "the channel version is not ics20-1") chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) diff --git a/e2e/tests/transfer/incentivized_test.go b/e2e/tests/transfer/incentivized_test.go index 463b4fcfb62..350d0ccaa37 100644 --- a/e2e/tests/transfer/incentivized_test.go +++ b/e2e/tests/transfer/incentivized_test.go @@ -39,7 +39,7 @@ func TestIncentivizedTransferTestSuite(t *testing.T) { // SetupTest explicitly enables fee middleware in the channel options. func (s *IncentivizedTransferTestSuite) SetupTest() { - s.SetupPath(ibc.DefaultClientOpts(), s.FeeTransferChannelOptions()) + s.SetupPaths(ibc.DefaultClientOpts(), s.FeeTransferChannelOptions()) } func (s *IncentivizedTransferTestSuite) TestMsgPayPacketFee_AsyncSingleSender_Succeeds() { diff --git a/e2e/tests/transfer/upgradesv1_test.go b/e2e/tests/transfer/upgradesv1_test.go index 11f6b656879..31bcaf7faa2 100644 --- a/e2e/tests/transfer/upgradesv1_test.go +++ b/e2e/tests/transfer/upgradesv1_test.go @@ -33,7 +33,7 @@ type TransferChannelUpgradesV1TestSuite struct { func (s *TransferChannelUpgradesV1TestSuite) SetupTest() { opts := s.TransferChannelOptions() opts.Version = transfertypes.V1 - s.SetupPath(ibc.DefaultClientOpts(), opts) + s.SetupPaths(ibc.DefaultClientOpts(), opts) } // TestChannelUpgrade_WithICS20v2_Succeeds tests upgrading a transfer channel to ICS20 v2. diff --git a/e2e/tests/transfer/upgradesv2_test.go b/e2e/tests/transfer/upgradesv2_test.go index 0f7a95f152e..8a505fef560 100644 --- a/e2e/tests/transfer/upgradesv2_test.go +++ b/e2e/tests/transfer/upgradesv2_test.go @@ -32,7 +32,7 @@ type TransferChannelUpgradesTestSuite struct { } func (s *TransferChannelUpgradesTestSuite) SetupTest() { - s.SetupPath(ibc.DefaultClientOpts(), s.TransferChannelOptions()) + s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions()) } // TestChannelUpgrade_WithFeeMiddleware_Succeeds tests upgrading a transfer channel to wire up fee middleware diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 998f4bcd747..bbfa2567915 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -63,7 +63,7 @@ func (s *UpgradeTestSuite) SetupTest() { if strings.HasSuffix(s.T().Name(), "TestV8ToV8_1ChainUpgrade") { channelOpts = s.FeeTransferChannelOptions() } - s.SetupPath(ibc.DefaultClientOpts(), channelOpts) + s.SetupPaths(ibc.DefaultClientOpts(), channelOpts) } // UpgradeChain upgrades a chain to a specific version using the planName provided. diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 5ae47a5b8df..bc430786106 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -174,22 +174,23 @@ func (s *E2ETestSuite) SetupChains(ctx context.Context, channelOptionsModifier C // SetupTest will by default use the default channel options to create a path between the chains. // if non default channel options are required, the test suite must override the `SetupTest` function. func (s *E2ETestSuite) SetupTest() { - s.SetupPath(ibc.DefaultClientOpts(), defaultChannelOpts(s.GetAllChains())) + s.SetupPaths(ibc.DefaultClientOpts(), defaultChannelOpts(s.GetAllChains())) } -// SetupPath creates paths between the all chains using the provided client and channel options. -func (s *E2ETestSuite) SetupPath(clientOpts ibc.CreateClientOptions, channelOpts ibc.CreateChannelOptions) { +// SetupPaths creates paths between the chains using the provided client and channel options. +// The paths are created such that ChainA is connected to ChainB, ChainB is connected to ChainC etc. +func (s *E2ETestSuite) SetupPaths(clientOpts ibc.CreateClientOptions, channelOpts ibc.CreateChannelOptions) { s.T().Logf("Setting up path for: %s", s.T().Name()) ctx := context.TODO() allChains := s.GetAllChains() for i := 0; i < len(allChains)-1; i++ { chainA, chainB := allChains[i], allChains[i+1] - _, _ = s.CreateNewPath(ctx, chainA, chainB, clientOpts, channelOpts) + _, _ = s.CreatePath(ctx, chainA, chainB, clientOpts, channelOpts) } } -func (s *E2ETestSuite) CreateNewPath( +func (s *E2ETestSuite) CreatePath( ctx context.Context, chainA ibc.Chain, chainB ibc.Chain,