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

e2e(upgrades): crossing hello test #5535

Merged
Prev Previous commit
Next Next commit
start relayer before executing the proposals
crodriguezvega committed Jan 29, 2024

Verified

This commit was signed with the committer’s verified signature.
addaleax Anna Henningsen
commit 5cfbd4ac6a96fa04b24ce71060e0abb3cf9f5b8c
33 changes: 23 additions & 10 deletions e2e/tests/core/04-channel/upgrades_test.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ package channel

import (
"context"
"sync"
"testing"

"github.com/strangelove-ventures/interchaintest/v8/ibc"
@@ -260,20 +261,32 @@ func (s *ChannelTestSuite) TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Su
s.AssertTxSuccess(transferTxResp)
})

t.Run("execute gov proposals to initiate channel upgrade on chain A and chain B", func(t *testing.T) {
chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID)
s.Require().NoError(err)
s.initiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.createUpgradeFields(chA))

chB, err := s.QueryChannel(ctx, chainB, channelB.PortID, channelB.ChannelID)
s.Require().NoError(err)
s.initiateChannelUpgrade(ctx, chainB, chainBWallet, channelB.PortID, channelB.ChannelID, s.createUpgradeFields(chB))
})

t.Run("start relayer", func(t *testing.T) {
s.StartRelayer(relayer)
})

t.Run("execute gov proposals to initiate channel upgrade on chain A and chain B", func(t *testing.T) {
var wg sync.WaitGroup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love me a WaitGroup <3


wg.Add(1)
go func() {
defer wg.Done()
chA, err := s.QueryChannel(ctx, chainA, channelA.PortID, channelA.ChannelID)
s.Require().NoError(err)
s.initiateChannelUpgrade(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, s.createUpgradeFields(chA))
}()

wg.Add(1)
go func() {
defer wg.Done()
chB, err := s.QueryChannel(ctx, chainB, channelB.PortID, channelB.ChannelID)
s.Require().NoError(err)
s.initiateChannelUpgrade(ctx, chainB, chainBWallet, channelB.PortID, channelB.ChannelID, s.createUpgradeFields(chB))
}()

wg.Wait()
})

s.Require().NoError(test.WaitForBlocks(ctx, 10, chainA, chainB), "failed to wait for blocks")

t.Run("packets are relayed between chain A and chain B", func(t *testing.T) {