Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rename SetupPath to SetupPaths in e2e testsuite #6674

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/tests/core/03-connection/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/forwarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/incentivized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/upgradesv1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/upgradesv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 6 additions & 5 deletions e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading