From bb44e68bba60e68d39cc3fc27828e96095012f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 10 Aug 2022 16:57:27 +0200 Subject: [PATCH 01/22] add successful transfer test --- e2e/transfer_test.go | 132 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 e2e/transfer_test.go diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go new file mode 100644 index 00000000000..6a049b79480 --- /dev/null +++ b/e2e/transfer_test.go @@ -0,0 +1,132 @@ +package e2e + +import ( + "context" + "fmt" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/strangelove-ventures/ibctest" + "github.com/strangelove-ventures/ibctest/chain/cosmos" + "github.com/strangelove-ventures/ibctest/ibc" + "github.com/strangelove-ventures/ibctest/test" + "github.com/stretchr/testify/suite" + + "github.com/cosmos/ibc-go/e2e/testsuite" + "github.com/cosmos/ibc-go/e2e/testvalues" + transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" +) + +func TestTransferTestSuite(t *testing.T) { + suite.Run(t, new(TransferTestSuite)) +} + +type TransferTestSuite struct { + testsuite.E2ETestSuite +} + +// Transfer broadcasts a MsgTransfer message. +func (s *TransferTestSuite) Transfer(ctx context.Context, chain *cosmos.CosmosChain, user *ibctest.User, + portID, channelID string, token sdk.Coin, sender, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, +) (sdk.TxResponse, error) { + msg := transfertypes.NewMsgTransfer(portID, channelID, token, sender, receiver, timeoutHeight, timeoutTimestamp) + return s.BroadcastMessages(ctx, chain, user, msg) +} + +// TestMsgTransfer_Succeeds_Nonincentivized will test sending successful IBC transfers from chainA to chainB. +// The transfer will occur over a basic transfer channel (non incentivized) and both native and non-native tokens +// will be sent forwards and backwards in the IBC transfer timeline (both chains will act as source and receiver chains). +func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { + t := s.T() + ctx := context.TODO() + + relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, transferChannelOptions()) + chainA, chainB := s.GetChains() + + chainADenom := chainA.Config().Denom + + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainAAddress := chainAWallet.Bech32Address(chainA.Config().Bech32Prefix) + + chainBWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainBAddress := chainBWallet.Bech32Address(chainB.Config().Bech32Prefix) + + t.Run("relayer wallets recovered", func(t *testing.T) { + err := s.RecoverRelayerWallets(ctx, relayer) + s.Require().NoError(err) + }) + + s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") + + t.Run("native IBC token transfer from chainA (source) to chainB, sender is source", func(t *testing.T) { + transferTxResp, err := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.getTimeoutHeight(ctx, chainB), 0) + s.Require().NoError(err) + s.AssertValidTxResponse(transferTxResp) + }) + + t.Run("tokens are escrowed", func(t *testing.T) { + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + s.Require().NoError(err) + + expected := testvalues.StartingTokenAmount - testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance) + }) + + t.Run("start relayer", func(t *testing.T) { + s.StartRelayer(relayer) + }) + + chainBIBCToken := s.getIBCToken(chainADenom, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID) + + t.Run("packets are relayed", func(t *testing.T) { + actualBalance, err := chainA.GetBalance(ctx, chainAAddress, chainBIBCToken.IBCDenom()) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance) + }) + + t.Run("non-native IBC token transfer from chainB to chainA (source), receiver is source", func(t *testing.T) { + transferTxResp, err := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.getTimeoutHeight(ctx, chainA), 0) + s.Require().NoError(err) + s.AssertValidTxResponse(transferTxResp) + }) + + t.Run("tokens are escrowed", func(t *testing.T) { + actualBalance, err := chainA.GetBalance(ctx, chainAAddress, chainBIBCToken.IBCDenom()) + s.Require().NoError(err) + + s.Require().Equal(0, actualBalance) + }) + + t.Run("packets are relayed", func(t *testing.T) { + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + s.Require().NoError(err) + + expected := testvalues.StartingTokenAmount + s.Require().Equal(expected, actualBalance) + }) +} + +// transferChannelOptions configures both of the chains to have non-incentivized transfer channels. +func transferChannelOptions() func(options *ibc.CreateChannelOptions) { + return func(opts *ibc.CreateChannelOptions) { + opts.Version = "ics20-1" + opts.SourcePortName = "transfer" + opts.DestPortName = "transfer" + } +} + +// getIBCToken returns the denomination of the full token denom sent to the receiving channel +func (s *TransferTestSuite) getIBCToken(fullTokenDenom string, portID, channelID string) transfertypes.DenomTrace { + return transfertypes.ParseDenomTrace(fmt.Sprintf("%s/%s/%s", portID, channelID, fullTokenDenom)) +} + +// getTimeoutHeight returns a timeout height of 1000 blocks above the current block height +// this function should be used when the timeout is never expected to be reached +func (s *TransferTestSuite) getTimeoutHeight(ctx context.Context, chain *cosmos.CosmosChain) clienttypes.Height { + height, err := chain.Height(ctx) + s.Require().NoError(err) + return clienttypes.NewHeight(clienttypes.ParseChainID(chain.Config().ChainID), uint64(height)+1000) +} From c37c716ace7b32cb2a926fbc42263c76f866c5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 10 Aug 2022 17:07:40 +0200 Subject: [PATCH 02/22] add back start relayer --- e2e/transfer_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index 6a049b79480..60bf9a060ed 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -100,6 +100,10 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().Equal(0, actualBalance) }) + t.Run("start relayer", func(t *testing.T) { + s.StartRelayer(relayer) + }) + t.Run("packets are relayed", func(t *testing.T) { actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) s.Require().NoError(err) From 4a5683057f13613699262160a57f6caf377d5344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 10 Aug 2022 17:13:22 +0200 Subject: [PATCH 03/22] use one wallet, fix various bugs --- e2e/transfer_test.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index 60bf9a060ed..f1798187384 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -46,11 +46,9 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { chainADenom := chainA.Config().Denom - chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) - chainAAddress := chainAWallet.Bech32Address(chainA.Config().Bech32Prefix) - - chainBWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) - chainBAddress := chainBWallet.Bech32Address(chainB.Config().Bech32Prefix) + wallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainAAddress := wallet.Bech32Address(chainA.Config().Bech32Prefix) + chainBAddress := wallet.Bech32Address(chainB.Config().Bech32Prefix) t.Run("relayer wallets recovered", func(t *testing.T) { err := s.RecoverRelayerWallets(ctx, relayer) @@ -60,13 +58,13 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("native IBC token transfer from chainA (source) to chainB, sender is source", func(t *testing.T) { - transferTxResp, err := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.getTimeoutHeight(ctx, chainB), 0) + transferTxResp, err := s.Transfer(ctx, chainA, wallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.getTimeoutHeight(ctx, chainB), 0) s.Require().NoError(err) s.AssertValidTxResponse(transferTxResp) }) t.Run("tokens are escrowed", func(t *testing.T) { - actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + actualBalance, err := s.GetChainANativeBalance(ctx, wallet) s.Require().NoError(err) expected := testvalues.StartingTokenAmount - testvalues.IBCTransferAmount @@ -80,7 +78,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { chainBIBCToken := s.getIBCToken(chainADenom, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID) t.Run("packets are relayed", func(t *testing.T) { - actualBalance, err := chainA.GetBalance(ctx, chainAAddress, chainBIBCToken.IBCDenom()) + actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) s.Require().NoError(err) expected := testvalues.IBCTransferAmount @@ -88,13 +86,13 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { }) t.Run("non-native IBC token transfer from chainB to chainA (source), receiver is source", func(t *testing.T) { - transferTxResp, err := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.getTimeoutHeight(ctx, chainA), 0) + transferTxResp, err := s.Transfer(ctx, chainB, wallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.getTimeoutHeight(ctx, chainA), 0) s.Require().NoError(err) s.AssertValidTxResponse(transferTxResp) }) t.Run("tokens are escrowed", func(t *testing.T) { - actualBalance, err := chainA.GetBalance(ctx, chainAAddress, chainBIBCToken.IBCDenom()) + actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) s.Require().NoError(err) s.Require().Equal(0, actualBalance) @@ -105,7 +103,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { }) t.Run("packets are relayed", func(t *testing.T) { - actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + actualBalance, err := s.GetChainANativeBalance(ctx, wallet) s.Require().NoError(err) expected := testvalues.StartingTokenAmount From f7de720856d7741f0ed7ca85f9e98039b8277c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 10 Aug 2022 17:40:29 +0200 Subject: [PATCH 04/22] fix various bugs, except last issue --- e2e/transfer_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index f1798187384..e2b28bfbea1 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -46,9 +46,11 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { chainADenom := chainA.Config().Denom - wallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) - chainAAddress := wallet.Bech32Address(chainA.Config().Bech32Prefix) - chainBAddress := wallet.Bech32Address(chainB.Config().Bech32Prefix) + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainAAddress := chainAWallet.Bech32Address(chainA.Config().Bech32Prefix) + + chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) + chainBAddress := chainBWallet.Bech32Address(chainB.Config().Bech32Prefix) t.Run("relayer wallets recovered", func(t *testing.T) { err := s.RecoverRelayerWallets(ctx, relayer) @@ -58,13 +60,13 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("native IBC token transfer from chainA (source) to chainB, sender is source", func(t *testing.T) { - transferTxResp, err := s.Transfer(ctx, chainA, wallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.getTimeoutHeight(ctx, chainB), 0) + transferTxResp, err := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.getTimeoutHeight(ctx, chainB), 0) s.Require().NoError(err) s.AssertValidTxResponse(transferTxResp) }) t.Run("tokens are escrowed", func(t *testing.T) { - actualBalance, err := s.GetChainANativeBalance(ctx, wallet) + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) s.Require().NoError(err) expected := testvalues.StartingTokenAmount - testvalues.IBCTransferAmount @@ -86,7 +88,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { }) t.Run("non-native IBC token transfer from chainB to chainA (source), receiver is source", func(t *testing.T) { - transferTxResp, err := s.Transfer(ctx, chainB, wallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.getTimeoutHeight(ctx, chainA), 0) + transferTxResp, err := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.getTimeoutHeight(ctx, chainA), 0) s.Require().NoError(err) s.AssertValidTxResponse(transferTxResp) }) @@ -95,15 +97,13 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) s.Require().NoError(err) - s.Require().Equal(0, actualBalance) + s.Require().Equal(int64(0), actualBalance) }) - t.Run("start relayer", func(t *testing.T) { - s.StartRelayer(relayer) - }) + // s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("packets are relayed", func(t *testing.T) { - actualBalance, err := s.GetChainANativeBalance(ctx, wallet) + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) s.Require().NoError(err) expected := testvalues.StartingTokenAmount From dad0435fc55b58615937b2821a1fa03300de204a Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 09:15:57 +0100 Subject: [PATCH 05/22] chore: using single registry for all images --- .github/workflows/e2e-fork.yml | 2 +- .github/workflows/e2e-manual.yaml | 3 ++- .github/workflows/e2e.yaml | 4 ++-- e2e/README.md | 12 ++++++------ e2e/scripts/run-e2e.sh | 2 +- e2e/testconfig/testconfig.go | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml index 240c4322545..34e5fdd4372 100644 --- a/.github/workflows/e2e-fork.yml +++ b/.github/workflows/e2e-fork.yml @@ -25,7 +25,7 @@ jobs: e2e: env: CHAIN_A_SIMD_TAG: latest - CHAIN_A_SIMD_IMAGE: ibc-go-simd-e2e + CHAIN_A_SIMD_IMAGE: ibc-go-simd if: ${{ github.event.pull_request.head.repo.fork || github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch' }} needs: - build-test-matrix diff --git a/.github/workflows/e2e-manual.yaml b/.github/workflows/e2e-manual.yaml index 65be1c8f8e2..d8b4be3340c 100644 --- a/.github/workflows/e2e-manual.yaml +++ b/.github/workflows/e2e-manual.yaml @@ -15,7 +15,7 @@ on: description: 'The image to use for chain A' required: true type: string - default: "ghcr.io/cosmos/ibc-go-simd-e2e" + default: "ghcr.io/cosmos/ibc-go-simd" chain-a-tag: description: 'The tag to use for chain A' required: true @@ -39,6 +39,7 @@ on: required: true type: choice options: + - main - v4.0.0-rc3 - v3.0.0 - v2.2.0 diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 627d2f3307d..861d2836b79 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -10,7 +10,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ibc-go-simd-e2e + IMAGE_NAME: ibc-go-simd jobs: docker-build: @@ -82,7 +82,7 @@ jobs: - docker-build env: CHAIN_A_SIMD_TAG: ${{ needs.determine-image-tag.outputs.simd-tag }} - CHAIN_A_SIMD_IMAGE: ghcr.io/cosmos/ibc-go-simd-e2e + CHAIN_A_SIMD_IMAGE: ghcr.io/cosmos/ibc-go-simd # see images here https://github.com/cosmos/relayer/pkgs/container/relayer/versions RLY_TAG: "v2.0.0-rc2" strategy: diff --git a/e2e/README.md b/e2e/README.md index 0605d507176..fa1901f225f 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -40,29 +40,29 @@ There are several envinronment variables that alter the behaviour of the make ta | Environment Variable | Description | Default Value| | ----------- | ----------- | ----------- | -| SIMD_IMAGE | The image that will be used for simd | ibc-go-simd-e2e | +| SIMD_IMAGE | The image that will be used for simd | ibc-go-simd | | SIMD_TAG | The tag used for simd | latest| | RLY_TAG | The tag used for the go relayer | main| -> Note: when running tests locally, **no images are pushed** to the `ghcr.io/cosmos/ibc-go-simd-e2e` registry. +> Note: when running tests locally, **no images are pushed** to the `ghcr.io/cosmos/ibc-go-simd` registry. The images which are used only exist on your machine. These environment variables allow us to run tests with arbitrary verions (from branches or released) of simd and the go relayer. -Every time changes are pushed to a branch or to `main`, a new `simd` image is built and pushed [here](https://github.com/cosmos/ibc-go/pkgs/container/ibc-go-simd-e2e). +Every time changes are pushed to a branch or to `main`, a new `simd` image is built and pushed [here](https://github.com/cosmos/ibc-go/pkgs/container/ibc-go-simd). #### Example Command: ```sh -export CHAIN_A_SIMD_IMAGE="ghcr.io/cosmos/ibc-go-simd-e2e" +export CHAIN_A_SIMD_IMAGE="ghcr.io/cosmos/ibc-go-simd" export CHAIN_A_SIMD_TAG="pr-1650" # We can also specify different values for the chains if needed. # they will default to the same as chain a. -# export CHAIN_B_SIMD_IMAGE="ghcr.io/cosmos/ibc-go-simd-e2e" +# export CHAIN_B_SIMD_IMAGE="ghcr.io/cosmos/ibc-go-simd" # export CHAIN_B_SIMD_TAG="pr-1650" export RLY_TAG="v2.0.0-rc2" @@ -209,7 +209,7 @@ There are two main github actions for e2e tests. [e2e-fork.yaml](https://github.com/cosmos/ibc-go/blob/main/.github/workflows/e2e-fork.yml) which runs when forks are created. -In `e2e.yaml`, the `simd` image is built and pushed to [a registry](https://github.com/cosmos/ibc-go/pkgs/container/ibc-go-simd-e2e) and every test +In `e2e.yaml`, the `simd` image is built and pushed to [a registry](https://github.com/cosmos/ibc-go/pkgs/container/ibc-go-simd) and every test that is run uses the image that was built. In `e2e-fork.yaml`, images are not pushed to this registry, but instead remain local to the host runner. diff --git a/e2e/scripts/run-e2e.sh b/e2e/scripts/run-e2e.sh index 44996100990..f6e1173123c 100755 --- a/e2e/scripts/run-e2e.sh +++ b/e2e/scripts/run-e2e.sh @@ -5,7 +5,7 @@ set -euo pipefail SUITE="${1}" TEST="${2}" export SIMD_TAG="${CHAIN_A_SIMD_TAG:-latest}" -export SIMD_IMAGE="${CHAIN_A_SIMD_IMAGE:-ibc-go-simd-e2e}" +export SIMD_IMAGE="${CHAIN_A_SIMD_IMAGE:-ibc-go-simd}" # In CI, the docker images will be built separately. # context for building the image is one directory up. diff --git a/e2e/testconfig/testconfig.go b/e2e/testconfig/testconfig.go index eac0bd3f070..7613ec470d4 100644 --- a/e2e/testconfig/testconfig.go +++ b/e2e/testconfig/testconfig.go @@ -20,7 +20,7 @@ const ( ChainBSimdTagEnv = "CHAIN_B_SIMD_TAG" GoRelayerTagEnv = "RLY_TAG" - defaultSimdImage = "ghcr.io/cosmos/ibc-go-simd-e2e" + defaultSimdImage = "ghcr.io/cosmos/ibc-go-simd" defaultRlyTag = "main" ) From acda77b44fd9be710bb498a5c033eaba27df8f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Thu, 11 Aug 2022 11:04:30 +0200 Subject: [PATCH 06/22] fix test --- e2e/testsuite/testsuite.go | 7 +++++-- e2e/transfer_test.go | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 80a5ea42ed4..21a4438d30b 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -21,6 +21,7 @@ import ( "github.com/cosmos/ibc-go/e2e/testconfig" feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ) const ( @@ -46,7 +47,8 @@ type E2ETestSuite struct { // These should typically be used for query clients only. If we need to make changes, we should // use E2ETestSuite.BroadcastMessages to broadcast transactions instead. type GRPCClients struct { - FeeQueryClient feetypes.QueryClient + FeeQueryClient feetypes.QueryClient + ChannelQueryClient channeltypes.QueryClient } // path is a pairing of two chains which will be used in a test. @@ -274,7 +276,8 @@ func (s *E2ETestSuite) initGRPCClients(chain *cosmos.CosmosChain) { } s.grpcClients[chain.Config().ChainID] = GRPCClients{ - FeeQueryClient: feetypes.NewQueryClient(grpcConn), + ChannelQueryClient: channeltypes.NewQueryClient(grpcConn), + FeeQueryClient: feetypes.NewQueryClient(grpcConn), } } diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index e2b28bfbea1..900da6c7989 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/ibc-go/e2e/testvalues" transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ) func TestTransferTestSuite(t *testing.T) { @@ -34,6 +35,20 @@ func (s *TransferTestSuite) Transfer(ctx context.Context, chain *cosmos.CosmosCh return s.BroadcastMessages(ctx, chain, user, msg) } +// QueryPacketCommitment queries the counterparty payee of the given chain and relayer address on the specified channel. +func (s *TransferTestSuite) QueryPacketCommitment(ctx context.Context, chain ibc.Chain, portID, channelID string, sequence uint64) ([]byte, error) { + queryClient := s.GetChainGRCPClients(chain).ChannelQueryClient + res, err := queryClient.PacketCommitment(ctx, &channeltypes.QueryPacketCommitmentRequest{ + PortId: portID, + ChannelId: channelID, + Sequence: sequence, + }) + if err != nil { + return nil, err + } + return res.Commitment, nil +} + // TestMsgTransfer_Succeeds_Nonincentivized will test sending successful IBC transfers from chainA to chainB. // The transfer will occur over a basic transfer channel (non incentivized) and both native and non-native tokens // will be sent forwards and backwards in the IBC transfer timeline (both chains will act as source and receiver chains). @@ -100,9 +115,12 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().Equal(int64(0), actualBalance) }) - // s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") + s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA, chainB), "failed to wait for blocks") t.Run("packets are relayed", func(t *testing.T) { + commitment, err := s.QueryPacketCommitment(ctx, chainB, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, 1) + s.Require().Empty(commitment) + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) s.Require().NoError(err) From f288a87b9cb60ffbc012026860cff43c5e4ba6e3 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 12:49:38 +0100 Subject: [PATCH 07/22] chore: updating readme to use main tag --- e2e/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/README.md b/e2e/README.md index fa1901f225f..31e0dde941e 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -58,7 +58,7 @@ Every time changes are pushed to a branch or to `main`, a new `simd` image is bu ```sh export CHAIN_A_SIMD_IMAGE="ghcr.io/cosmos/ibc-go-simd" -export CHAIN_A_SIMD_TAG="pr-1650" +export CHAIN_A_SIMD_TAG="main" # We can also specify different values for the chains if needed. # they will default to the same as chain a. From 1eced8dead94e27f8bb919e6068678c259d9db72 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 13:23:00 +0100 Subject: [PATCH 08/22] chore: refactor e2e.yml to use reusable workflow --- .github/workflows/e2e-test.yml | 108 +++++++++++++++++++++++++++++ .github/workflows/e2e.yaml | 121 +++++++++------------------------ 2 files changed, 139 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/e2e-test.yml diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml new file mode 100644 index 00000000000..23724d74178 --- /dev/null +++ b/.github/workflows/e2e-test.yml @@ -0,0 +1,108 @@ +on: + workflow_call: + inputs: + test-entry-point: + description: 'Test entry point' + required: true + type: string + chain-a-image: + description: 'The image to use for chain A' + required: true + type: string + default: "ghcr.io/cosmos/ibc-go-simd" + chain-a-tag: + description: 'The tag to use for chain A' + required: true + type: string + default: main + chain-b-image: + description: 'The image to use for chain B' + required: true + type: string + default: "ghcr.io/cosmos/ibc-go-simd" + chain-b-tag: + default: v4.0.0-rc3 + description: 'The tag to use for chain B' + required: true + type: string + relayer-tag: + description: 'The tag to use for the relayer' + required: true + default: "v2.0.0-rc2" + type: string + build-docker-image: + description: "Flag to specify if the docker image should be built beforehand" + required: false + type: boolean + default: false + + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ibc-go-simd + +jobs: + docker-build: + if: ${{ inputs.build-docker-image }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Log in to the Container registry + uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a + with: + images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # dynamically build a matrix of test/test suite pairs to run + build-test-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - id: set-matrix + run: echo "::set-output name=matrix::$(go run cmd/build_test_matrix/main.go)" + env: + TEST_ENTRYPOINT: "${{ inputs.test-entry-point }}" + + e2e-tests: + runs-on: ubuntu-latest + needs: + - build-test-matrix + - docker-build + env: + CHAIN_A_SIMD_TAG: "${{ inputs.chain-a-tag }}" + CHAIN_A_SIMD_IMAGE: "${{ inputs.chain-a-image }}" + CHAIN_B_SIMD_TAG: "${{ inputs.chain-b-tag }}" + CHAIN_B_SIMD_IMAGE: "${{ inputs.chain-b-image }}" + RLY_TAG: "{{ inputs.relayer-tag }}" + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Run e2e Test + run: | + cd e2e + make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 861d2836b79..92b0db25cf5 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -13,93 +13,34 @@ env: IMAGE_NAME: ibc-go-simd jobs: - docker-build: - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Log in to the Container registry - uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a - with: - images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - # dynamically build a matrix of test/test suite pairs to run - build-test-matrix: - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - id: set-matrix - run: echo "::set-output name=matrix::$(go run cmd/build_test_matrix/main.go)" - - - # the tag of the image will differ if this is a PR or the branch is being merged into main. - # we store the tag as an environment variable and use it in the E2E tests to determine the tag. - determine-image-tag: - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-latest - outputs: - simd-tag: ${{ steps.get-tag.outputs.simd-tag }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - id: get-tag - run: | - tag=$(go run cmd/determine_simd_tag/main.go -pr "${{ github.event.pull_request.number }}" ) - echo "Using tag $tag" - echo "::set-output name=simd-tag::$tag" - - - e2e: - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-latest - needs: - - build-test-matrix - - determine-image-tag - - docker-build - env: - CHAIN_A_SIMD_TAG: ${{ needs.determine-image-tag.outputs.simd-tag }} - CHAIN_A_SIMD_IMAGE: ghcr.io/cosmos/ibc-go-simd - # see images here https://github.com/cosmos/relayer/pkgs/container/relayer/versions - RLY_TAG: "v2.0.0-rc2" - strategy: - fail-fast: false - matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - name: Log in to the Container registry - uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Run e2e Test - run: | - cd e2e - make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} + determine-image-tag: + if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} + runs-on: ubuntu-latest + outputs: + simd-tag: ${{ steps.get-tag.outputs.simd-tag }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - id: get-tag + run: | + tag=$(go run cmd/determine_simd_tag/main.go -pr "${{ github.event.pull_request.number }}" ) + echo "Using tag $tag" + echo "::set-output name=simd-tag::$tag" + e2e: + needs: + - determine-image-tag + if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} + runs-on: ubuntu-latest + steps: + - name: Run E2E Tests + uses: ./.github/workflows/e2e-test.yml + secrets: inherit + with: + build-docker-image: true + chain-a-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} + chain-a-image: ghcr.io/cosmos/ibc-go-simd + chain-b-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} + chain-b-image: ghcr.io/cosmos/ibc-go-simd + relayer-tag: "v2.0.0-rc2" From 0f54059ce5978824fd652e4cfd3b457e9677a088 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 13:27:01 +0100 Subject: [PATCH 09/22] chore: adding import for clienttypes --- e2e/testsuite/testsuite.go | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 502dac842df..979dcb617ce 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -21,6 +21,7 @@ import ( "github.com/cosmos/ibc-go/e2e/testconfig" feetypes "github.com/cosmos/ibc-go/v5/modules/apps/29-fee/types" + clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ) From eab0ce5edcfa446189e5b90894331e4f24c9068a Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 13:34:49 +0100 Subject: [PATCH 10/22] chore: correcting workflow syntax --- .github/workflows/e2e.yaml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 92b0db25cf5..5e0490bb15a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -31,16 +31,12 @@ jobs: e2e: needs: - determine-image-tag - if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} - runs-on: ubuntu-latest - steps: - - name: Run E2E Tests - uses: ./.github/workflows/e2e-test.yml - secrets: inherit - with: - build-docker-image: true - chain-a-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} - chain-a-image: ghcr.io/cosmos/ibc-go-simd - chain-b-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} - chain-b-image: ghcr.io/cosmos/ibc-go-simd - relayer-tag: "v2.0.0-rc2" + uses: ./.github/workflows/e2e-test.yml + secrets: inherit + with: + build-docker-image: true + chain-a-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} + chain-a-image: ghcr.io/cosmos/ibc-go-simd + chain-b-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} + chain-b-image: ghcr.io/cosmos/ibc-go-simd + relayer-tag: "v2.0.0-rc2" From afdcecb238d476dc0f29ed59728648a659410281 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 13:37:22 +0100 Subject: [PATCH 11/22] chore: adding test-entry-point param --- .github/workflows/e2e.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 5e0490bb15a..b1eb4f29c98 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -40,3 +40,4 @@ jobs: chain-b-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} chain-b-image: ghcr.io/cosmos/ibc-go-simd relayer-tag: "v2.0.0-rc2" + test-entry-point: "" # run all tests From db5ef231b26690dd72fa5eec25b7376b908334dc Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 13:46:30 +0100 Subject: [PATCH 12/22] chore: correcting reference format --- .github/workflows/e2e-manual.yaml | 47 ++++++------------------------- .github/workflows/e2e-test.yml | 6 ++-- .github/workflows/e2e.yaml | 7 +++-- 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/.github/workflows/e2e-manual.yaml b/.github/workflows/e2e-manual.yaml index d8b4be3340c..f7a83b514f1 100644 --- a/.github/workflows/e2e-manual.yaml +++ b/.github/workflows/e2e-manual.yaml @@ -53,43 +53,12 @@ on: jobs: - # dynamically build a matrix of test/test suite pairs to run - build-test-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - id: set-matrix - run: echo "::set-output name=matrix::$(go run cmd/build_test_matrix/main.go)" - env: - TEST_ENTRYPOINT: "${{ github.event.inputs.test-entry-point }}" - - - e2e-manual: - runs-on: ubuntu-latest - needs: - - build-test-matrix - env: - CHAIN_A_SIMD_TAG: "${{ github.event.inputs.chain-a-tag }}" - CHAIN_A_SIMD_IMAGE: "${{ github.event.inputs.chain-a-image }}" - CHAIN_B_SIMD_TAG: "${{ github.event.inputs.chain-b-tag }}" - CHAIN_B_SIMD_IMAGE: "${{ github.event.inputs.chain-b-image }}" - # see images here https://github.com/cosmos/relayer/pkgs/container/relayer/versions - RLY_TAG: "${{ github.event.inputs.relayer-tag }}" - strategy: - fail-fast: false - matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - name: Run e2e Test - run: | - cd e2e - make e2e-test suite=${{ matrix.suite }} test=${{ matrix.test }} + uses: ./.github/workflows/e2e-test.yml + with: + chain-a-tag: "${{ github.event.inputs.chain-a-tag }}" + chain-a-image: "${{ github.event.inputs.chain-a-image }}" + chain-b-tag: "${{ github.event.inputs.chain-b-tag }}" + chain-b-image: "${{ github.event.inputs.chain-b-image }}" + relayer-tag: "${{ github.event.inputs.relayer-tag }}" + test-entry-point: "${{ github.event.inputs.test-entry-point }}" diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 23724d74178..8d8afa75d65 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -30,8 +30,8 @@ on: required: true default: "v2.0.0-rc2" type: string - build-docker-image: - description: "Flag to specify if the docker image should be built beforehand" + build-and-push-docker-image: + description: "Flag to specify if the docker image should be built and pushed beforehand" required: false type: boolean default: false @@ -43,7 +43,7 @@ env: jobs: docker-build: - if: ${{ inputs.build-docker-image }} + if: ${{ inputs.build-and-push-docker-image }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index b1eb4f29c98..b66ec6e5ca6 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -29,15 +29,16 @@ jobs: echo "Using tag $tag" echo "::set-output name=simd-tag::$tag" e2e: + if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} needs: - determine-image-tag uses: ./.github/workflows/e2e-test.yml secrets: inherit with: - build-docker-image: true - chain-a-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} + build-and-push-docker-image: true + chain-a-tag: "${{ needs.determine-image-tag.outputs.simd-tag }}" chain-a-image: ghcr.io/cosmos/ibc-go-simd - chain-b-tag: ${{ needs.determine-image-tag.outputs.simd-tag }} + chain-b-tag: "${{ needs.determine-image-tag.outputs.simd-tag }}" chain-b-image: ghcr.io/cosmos/ibc-go-simd relayer-tag: "v2.0.0-rc2" test-entry-point: "" # run all tests From 6f565b13ade6aae5678c3c3bb62c5cdaafb60ebd Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 14:03:46 +0100 Subject: [PATCH 13/22] chore: moving workflow to subdirectory --- .github/workflows/e2e-manual.yaml | 2 +- .github/workflows/e2e.yaml | 3 +-- .github/workflows/{ => reusable}/e2e-test.yml | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) rename .github/workflows/{ => reusable}/e2e-test.yml (85%) diff --git a/.github/workflows/e2e-manual.yaml b/.github/workflows/e2e-manual.yaml index f7a83b514f1..17cbcf4da32 100644 --- a/.github/workflows/e2e-manual.yaml +++ b/.github/workflows/e2e-manual.yaml @@ -54,7 +54,7 @@ on: jobs: e2e-manual: - uses: ./.github/workflows/e2e-test.yml + uses: ./.github/workflows/reusable/e2e-test.yml with: chain-a-tag: "${{ github.event.inputs.chain-a-tag }}" chain-a-image: "${{ github.event.inputs.chain-a-image }}" diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index b66ec6e5ca6..ecfb5ac2840 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -32,7 +32,7 @@ jobs: if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} needs: - determine-image-tag - uses: ./.github/workflows/e2e-test.yml + uses: ./.github/workflows/reusable/e2e-test.yml secrets: inherit with: build-and-push-docker-image: true @@ -41,4 +41,3 @@ jobs: chain-b-tag: "${{ needs.determine-image-tag.outputs.simd-tag }}" chain-b-image: ghcr.io/cosmos/ibc-go-simd relayer-tag: "v2.0.0-rc2" - test-entry-point: "" # run all tests diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/reusable/e2e-test.yml similarity index 85% rename from .github/workflows/e2e-test.yml rename to .github/workflows/reusable/e2e-test.yml index 8d8afa75d65..5fb9f3ca0f5 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/reusable/e2e-test.yml @@ -3,8 +3,9 @@ on: inputs: test-entry-point: description: 'Test entry point' - required: true + required: false type: string + default: "" # empty string means run all tests chain-a-image: description: 'The image to use for chain A' required: true @@ -42,6 +43,18 @@ env: IMAGE_NAME: ibc-go-simd jobs: + test-details: + runs-on: ubuntu-latest + steps: + - name: Display Inputs + run: | + echo "Chain A Image: ${{ inputs.chain-a-image }}" + echo "Chain A Tag: ${{ inputs.chain-a-tag }}" + echo "Chain B Image: ${{ inputs.chain-b-image }}" + echo "Chain B Tag: ${{ inputs.chain-b-tag }}" + echo "Relayer Tag: ${{ inputs.relayer-tag }}" + echo "Test Entry Point: ${{ inputs.test-entry-point }}" + docker-build: if: ${{ inputs.build-and-push-docker-image }} runs-on: ubuntu-latest From 62cb63dd50219262865ba348814c4d4701d8af9a Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 14:58:43 +0100 Subject: [PATCH 14/22] moved out of separate folder --- .github/workflows/{reusable/e2e-test.yml => _run-e2e-test.yml} | 0 .github/workflows/e2e-manual.yaml | 2 +- .github/workflows/e2e.yaml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{reusable/e2e-test.yml => _run-e2e-test.yml} (100%) diff --git a/.github/workflows/reusable/e2e-test.yml b/.github/workflows/_run-e2e-test.yml similarity index 100% rename from .github/workflows/reusable/e2e-test.yml rename to .github/workflows/_run-e2e-test.yml diff --git a/.github/workflows/e2e-manual.yaml b/.github/workflows/e2e-manual.yaml index 17cbcf4da32..a943fac9c8a 100644 --- a/.github/workflows/e2e-manual.yaml +++ b/.github/workflows/e2e-manual.yaml @@ -54,7 +54,7 @@ on: jobs: e2e-manual: - uses: ./.github/workflows/reusable/e2e-test.yml + uses: ./.github/workflows/_run-e2e-test.yml with: chain-a-tag: "${{ github.event.inputs.chain-a-tag }}" chain-a-image: "${{ github.event.inputs.chain-a-image }}" diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index ecfb5ac2840..08bde464cd7 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -32,7 +32,7 @@ jobs: if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} needs: - determine-image-tag - uses: ./.github/workflows/reusable/e2e-test.yml + uses: ./.github/workflows/_run-e2e-test.yml secrets: inherit with: build-and-push-docker-image: true From 44a47ee9a06351a06e90aabd5344b21c294436b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Thu, 11 Aug 2022 16:09:21 +0200 Subject: [PATCH 15/22] add packet relayed assertion --- e2e/testsuite/testsuite.go | 7 +++++++ e2e/transfer_test.go | 41 +++++++++----------------------------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 979dcb617ce..16132793578 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -292,6 +292,13 @@ func (s *E2ETestSuite) AssertValidTxResponse(resp sdk.TxResponse) { s.Require().NotEmpty(resp.Data, respLogsMsg) } +// AssertPacketRelayed asserts that the packet commitment does not exist on the sending chain. +// The packet commitment will be deleted upon a packet acknowledgement or timeout. +func (s *E2ETestSuite) AssertPacketRelayed(ctx context.Context, chain *cosmos.CosmosChain, portID, channelID string, sequence uint64) { + commitment, _ := s.QueryPacketCommitment(ctx, chain, portID, channelID, sequence) + s.Require().Empty(commitment) +} + // createCosmosChains creates two separate chains in docker containers. // test and can be retrieved with GetChains. func (s *E2ETestSuite) createCosmosChains(chainOptions testconfig.ChainOptions) (*cosmos.CosmosChain, *cosmos.CosmosChain) { diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index 900da6c7989..9d3f0eca4e9 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -1,5 +1,9 @@ package e2e +/* +The TransferTestSuite assumes both chainA and chainB support version ics20-1. +*/ + import ( "context" "fmt" @@ -16,7 +20,6 @@ import ( "github.com/cosmos/ibc-go/e2e/testvalues" transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" - channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ) func TestTransferTestSuite(t *testing.T) { @@ -35,20 +38,6 @@ func (s *TransferTestSuite) Transfer(ctx context.Context, chain *cosmos.CosmosCh return s.BroadcastMessages(ctx, chain, user, msg) } -// QueryPacketCommitment queries the counterparty payee of the given chain and relayer address on the specified channel. -func (s *TransferTestSuite) QueryPacketCommitment(ctx context.Context, chain ibc.Chain, portID, channelID string, sequence uint64) ([]byte, error) { - queryClient := s.GetChainGRCPClients(chain).ChannelQueryClient - res, err := queryClient.PacketCommitment(ctx, &channeltypes.QueryPacketCommitmentRequest{ - PortId: portID, - ChannelId: channelID, - Sequence: sequence, - }) - if err != nil { - return nil, err - } - return res.Commitment, nil -} - // TestMsgTransfer_Succeeds_Nonincentivized will test sending successful IBC transfers from chainA to chainB. // The transfer will occur over a basic transfer channel (non incentivized) and both native and non-native tokens // will be sent forwards and backwards in the IBC transfer timeline (both chains will act as source and receiver chains). @@ -67,15 +56,10 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) chainBAddress := chainBWallet.Bech32Address(chainB.Config().Bech32Prefix) - t.Run("relayer wallets recovered", func(t *testing.T) { - err := s.RecoverRelayerWallets(ctx, relayer) - s.Require().NoError(err) - }) - s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("native IBC token transfer from chainA (source) to chainB, sender is source", func(t *testing.T) { - transferTxResp, err := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.getTimeoutHeight(ctx, chainB), 0) + transferTxResp, err := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0) s.Require().NoError(err) s.AssertValidTxResponse(transferTxResp) }) @@ -95,6 +79,8 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { chainBIBCToken := s.getIBCToken(chainADenom, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID) t.Run("packets are relayed", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1) + actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) s.Require().NoError(err) @@ -103,7 +89,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { }) t.Run("non-native IBC token transfer from chainB to chainA (source), receiver is source", func(t *testing.T) { - transferTxResp, err := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.getTimeoutHeight(ctx, chainA), 0) + transferTxResp, err := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0) s.Require().NoError(err) s.AssertValidTxResponse(transferTxResp) }) @@ -118,8 +104,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA, chainB), "failed to wait for blocks") t.Run("packets are relayed", func(t *testing.T) { - commitment, err := s.QueryPacketCommitment(ctx, chainB, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, 1) - s.Require().Empty(commitment) + s.AssertPacketRelayed(ctx, chainB, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, 1) actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) s.Require().NoError(err) @@ -142,11 +127,3 @@ func transferChannelOptions() func(options *ibc.CreateChannelOptions) { func (s *TransferTestSuite) getIBCToken(fullTokenDenom string, portID, channelID string) transfertypes.DenomTrace { return transfertypes.ParseDenomTrace(fmt.Sprintf("%s/%s/%s", portID, channelID, fullTokenDenom)) } - -// getTimeoutHeight returns a timeout height of 1000 blocks above the current block height -// this function should be used when the timeout is never expected to be reached -func (s *TransferTestSuite) getTimeoutHeight(ctx context.Context, chain *cosmos.CosmosChain) clienttypes.Height { - height, err := chain.Height(ctx) - s.Require().NoError(err) - return clienttypes.NewHeight(clienttypes.ParseChainID(chain.Config().ChainID), uint64(height)+1000) -} From 5f6f0c5f8068b1042952c563c7f691f10a0ca735 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 15:12:18 +0100 Subject: [PATCH 16/22] chore: correctly pass rly tag --- .github/workflows/_run-e2e-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_run-e2e-test.yml b/.github/workflows/_run-e2e-test.yml index 5fb9f3ca0f5..9632ac4d18e 100644 --- a/.github/workflows/_run-e2e-test.yml +++ b/.github/workflows/_run-e2e-test.yml @@ -106,7 +106,7 @@ jobs: CHAIN_A_SIMD_IMAGE: "${{ inputs.chain-a-image }}" CHAIN_B_SIMD_TAG: "${{ inputs.chain-b-tag }}" CHAIN_B_SIMD_IMAGE: "${{ inputs.chain-b-image }}" - RLY_TAG: "{{ inputs.relayer-tag }}" + RLY_TAG: "${{ inputs.relayer-tag }}" strategy: fail-fast: false matrix: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }} From fe15b89e49a45c2509dbfcb8cf6982237cc515b8 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 15:35:47 +0100 Subject: [PATCH 17/22] chore: skipping individual steps instead of full job --- .github/workflows/_run-e2e-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_run-e2e-test.yml b/.github/workflows/_run-e2e-test.yml index 9632ac4d18e..4d971b9f239 100644 --- a/.github/workflows/_run-e2e-test.yml +++ b/.github/workflows/_run-e2e-test.yml @@ -56,11 +56,11 @@ jobs: echo "Test Entry Point: ${{ inputs.test-entry-point }}" docker-build: - if: ${{ inputs.build-and-push-docker-image }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Log in to the Container registry + if: ${{ inputs.build-and-push-docker-image }} uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b with: registry: ${{ env.REGISTRY }} @@ -68,12 +68,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker + if: ${{ inputs.build-and-push-docker-image }} id: meta uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a with: images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} - name: Build and push Docker image + if: ${{ inputs.build-and-push-docker-image }} uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94 with: context: . From e9d0ff34a50e29f48fb77ab49fd1eadf58261970 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 15:36:54 +0100 Subject: [PATCH 18/22] chore: skip checkout --- .github/workflows/_run-e2e-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/_run-e2e-test.yml b/.github/workflows/_run-e2e-test.yml index 4d971b9f239..be74e2f3857 100644 --- a/.github/workflows/_run-e2e-test.yml +++ b/.github/workflows/_run-e2e-test.yml @@ -59,6 +59,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + if: ${{ inputs.build-and-push-docker-image }} - name: Log in to the Container registry if: ${{ inputs.build-and-push-docker-image }} uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b From 2090a2d1c00103e2cb3866bd76bb0b59afd1b452 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 11 Aug 2022 15:43:44 +0100 Subject: [PATCH 19/22] chore: renamed to add -workflow-call.yml --- .github/workflows/e2e-manual.yaml | 2 +- .../{_run-e2e-test.yml => e2e-test-workflow-call.yml} | 3 +++ .github/workflows/e2e.yaml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) rename .github/workflows/{_run-e2e-test.yml => e2e-test-workflow-call.yml} (94%) diff --git a/.github/workflows/e2e-manual.yaml b/.github/workflows/e2e-manual.yaml index a943fac9c8a..9aa3679fc09 100644 --- a/.github/workflows/e2e-manual.yaml +++ b/.github/workflows/e2e-manual.yaml @@ -54,7 +54,7 @@ on: jobs: e2e-manual: - uses: ./.github/workflows/_run-e2e-test.yml + uses: ./.github/workflows/e2e-test-workflow-call.yml with: chain-a-tag: "${{ github.event.inputs.chain-a-tag }}" chain-a-image: "${{ github.event.inputs.chain-a-image }}" diff --git a/.github/workflows/_run-e2e-test.yml b/.github/workflows/e2e-test-workflow-call.yml similarity index 94% rename from .github/workflows/_run-e2e-test.yml rename to .github/workflows/e2e-test-workflow-call.yml index be74e2f3857..7f73ae68c70 100644 --- a/.github/workflows/_run-e2e-test.yml +++ b/.github/workflows/e2e-test-workflow-call.yml @@ -55,6 +55,9 @@ jobs: echo "Relayer Tag: ${{ inputs.relayer-tag }}" echo "Test Entry Point: ${{ inputs.test-entry-point }}" + # we skip individual steps rather than the full job as e2e-tests will not run if this task + # is skipped. But will run if every individual task is skipped. There is no current way of conditionally needing + # a job. docker-build: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 08bde464cd7..8823eec3900 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -32,7 +32,7 @@ jobs: if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} needs: - determine-image-tag - uses: ./.github/workflows/_run-e2e-test.yml + uses: ./.github/workflows/e2e-test-workflow-call.yml secrets: inherit with: build-and-push-docker-image: true From 16660bb6a75ce14a1d296c211ab970e1379d07b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Thu, 11 Aug 2022 17:39:45 +0200 Subject: [PATCH 20/22] add transfer test suite as option to e2e manual --- .github/workflows/e2e-manual.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-manual.yaml b/.github/workflows/e2e-manual.yaml index d8b4be3340c..a048820bc67 100644 --- a/.github/workflows/e2e-manual.yaml +++ b/.github/workflows/e2e-manual.yaml @@ -10,6 +10,7 @@ on: required: true type: choice options: + - TestTransferTestSuite - TestFeeMiddlewareTestSuite chain-a-image: description: 'The image to use for chain A' From bf392b3f0c098f70c395f91373e9cf814d08d9fe Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Fri, 12 Aug 2022 10:33:30 +0100 Subject: [PATCH 21/22] chore: E2E TestMsgTransfer_InvalidAddress_UnescrowsTokens --- e2e/README.md | 2 +- e2e/scripts/run-e2e.sh | 6 ++--- e2e/testvalues/values.go | 5 +++-- e2e/transfer_test.go | 47 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/e2e/README.md b/e2e/README.md index 31e0dde941e..9ac688a2b3f 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -63,7 +63,7 @@ export CHAIN_A_SIMD_TAG="main" # We can also specify different values for the chains if needed. # they will default to the same as chain a. # export CHAIN_B_SIMD_IMAGE="ghcr.io/cosmos/ibc-go-simd" -# export CHAIN_B_SIMD_TAG="pr-1650" +# export CHAIN_B_SIMD_TAG="main" export RLY_TAG="v2.0.0-rc2" make e2e-test suite=FeeMiddlewareTestSuite test=TestMultiMsg_MsgPayPacketFeeSingleSender diff --git a/e2e/scripts/run-e2e.sh b/e2e/scripts/run-e2e.sh index f6e1173123c..a27239d66a5 100755 --- a/e2e/scripts/run-e2e.sh +++ b/e2e/scripts/run-e2e.sh @@ -4,14 +4,14 @@ set -euo pipefail SUITE="${1}" TEST="${2}" -export SIMD_TAG="${CHAIN_A_SIMD_TAG:-latest}" -export SIMD_IMAGE="${CHAIN_A_SIMD_IMAGE:-ibc-go-simd}" +export CHAIN_A_SIMD_TAG="${CHAIN_A_SIMD_TAG:-latest}" +export CHAIN_A_SIMD_IMAGE="${CHAIN_A_SIMD_IMAGE:-ibc-go-simd}" # In CI, the docker images will be built separately. # context for building the image is one directory up. if [ "${CI:-}" != "true" ] then - (cd ..; docker build . -t "${SIMD_IMAGE}:${SIMD_TAG}") + (cd ..; docker build . -t "${CHAIN_A_SIMD_IMAGE}:${CHAIN_A_SIMD_TAG}") fi go test -v ./ --run ${SUITE} -testify.m ^${TEST}$ diff --git a/e2e/testvalues/values.go b/e2e/testvalues/values.go index e281429a9ec..964111e7af1 100644 --- a/e2e/testvalues/values.go +++ b/e2e/testvalues/values.go @@ -8,8 +8,9 @@ import ( ) const ( - StartingTokenAmount int64 = 10_000_000 - IBCTransferAmount int64 = 10_000 + StartingTokenAmount int64 = 10_000_000 + IBCTransferAmount int64 = 10_000 + InvalidAddress string = "" ) // ImmediatelyTimeout returns an ibc.IBCTimeout which will cause an IBC transfer to timeout immediately. diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index 9d3f0eca4e9..186e3cd0c8e 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -114,6 +114,53 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { }) } +// TestMsgTransfer_InvalidAddress_UnescrowsTokens attempts to send an IBC transfer to an invalid address and ensures +// that the tokens on the sending chain are unescrowed. +func (s *TransferTestSuite) TestMsgTransfer_InvalidAddress_UnescrowsTokens() { + t := s.T() + ctx := context.TODO() + + relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, transferChannelOptions()) + chainA, chainB := s.GetChains() + + chainADenom := chainA.Config().Denom + + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainAAddress := chainAWallet.Bech32Address(chainA.Config().Bech32Prefix) + + s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") + + t.Run("native IBC token transfer from chainA to invalid address", func(t *testing.T) { + transferTxResp, err := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, testvalues.InvalidAddress, s.GetTimeoutHeight(ctx, chainB), 0) + s.Require().NoError(err) + s.AssertValidTxResponse(transferTxResp) + }) + + t.Run("tokens are escrowed", func(t *testing.T) { + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + s.Require().NoError(err) + + expected := testvalues.StartingTokenAmount - testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance) + }) + + t.Run("start relayer", func(t *testing.T) { + s.StartRelayer(relayer) + }) + + t.Run("packets are relayed", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1) + }) + + t.Run("token transfer amount unescrowed", func(t *testing.T) { + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + s.Require().NoError(err) + + expected := testvalues.StartingTokenAmount + s.Require().Equal(expected, actualBalance) + }) +} + // transferChannelOptions configures both of the chains to have non-incentivized transfer channels. func transferChannelOptions() func(options *ibc.CreateChannelOptions) { return func(opts *ibc.CreateChannelOptions) { From cb58310ee72afa6d7a16079b6854d3338834cbae Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Fri, 12 Aug 2022 10:34:29 +0100 Subject: [PATCH 22/22] chore: renaming test --- e2e/transfer_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/transfer_test.go b/e2e/transfer_test.go index 186e3cd0c8e..585cf1cc108 100644 --- a/e2e/transfer_test.go +++ b/e2e/transfer_test.go @@ -114,9 +114,9 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { }) } -// TestMsgTransfer_InvalidAddress_UnescrowsTokens attempts to send an IBC transfer to an invalid address and ensures +// TestMsgTransfer_Fails_InvalidAddress attempts to send an IBC transfer to an invalid address and ensures // that the tokens on the sending chain are unescrowed. -func (s *TransferTestSuite) TestMsgTransfer_InvalidAddress_UnescrowsTokens() { +func (s *TransferTestSuite) TestMsgTransfer_Fails_InvalidAddress() { t := s.T() ctx := context.TODO()