From f4ed2d13bd25d4655ec0b9be027c2c1baff88fe0 Mon Sep 17 00:00:00 2001 From: Dzmitry Hil Date: Wed, 6 Nov 2024 16:26:18 +0300 Subject: [PATCH] Add IBC demon metadata transfer integration test. (#1019) --- integration-tests/ibc/transfer_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/integration-tests/ibc/transfer_test.go b/integration-tests/ibc/transfer_test.go index 986f343cb..052c96df8 100644 --- a/integration-tests/ibc/transfer_test.go +++ b/integration-tests/ibc/transfer_test.go @@ -89,9 +89,12 @@ func TestIBCTransferFromGaiaToCoreumAndBack(t *testing.T) { requireT := require.New(t) ctx, chains := integrationtests.NewChainsTestingContext(t) + coreumChain := chains.Coreum gaiaChain := chains.Gaia + coreumBankClient := banktypes.NewQueryClient(coreumChain.ClientContext) + coreumToGaiaChannelID := coreumChain.AwaitForIBCChannelID( ctx, t, ibctransfertypes.PortID, gaiaChain.ChainContext, ) @@ -134,6 +137,13 @@ func TestIBCTransferFromGaiaToCoreumAndBack(t *testing.T) { ) requireT.NoError(coreumChain.AwaitForBalance(ctx, t, coreumToCoreumSender, expectedBalanceAtCoreum)) + // check that denom metadata is registered + denomMetadataRes, err := coreumBankClient.DenomMetadata(ctx, &banktypes.QueryDenomMetadataRequest{ + Denom: expectedBalanceAtCoreum.Denom, + }) + requireT.NoError(err) + assert.Equal(t, expectedBalanceAtCoreum.Denom, denomMetadataRes.Metadata.Base) + // Send from coreumToCoreumSender to coreumToGaiaSender sendMsg := &banktypes.MsgSend{ FromAddress: coreumToCoreumSender.String(), @@ -148,8 +158,7 @@ func TestIBCTransferFromGaiaToCoreumAndBack(t *testing.T) { ) requireT.NoError(err) - bankClient := banktypes.NewQueryClient(coreumChain.ClientContext) - queryBalanceResponse, err := bankClient.Balance(ctx, &banktypes.QueryBalanceRequest{ + queryBalanceResponse, err := coreumBankClient.Balance(ctx, &banktypes.QueryBalanceRequest{ Address: coreumToGaiaSender.String(), Denom: expectedBalanceAtCoreum.Denom, })