diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index 251fa661e63..d2dd81c4659 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -105,6 +105,16 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().Equal(expected, actualBalance.Int64()) }) + if testvalues.TokenMetadataFeatureReleases.IsSupported(chainBVersion) { + t.Run("metadata for token exists on chainB", func(t *testing.T) { + balances, err := s.QueryAllBalances(ctx, chainB, chainBAddress, true) + s.Require().NoError(err) + + // balance for IBC token returns a human-readable denomination + s.Require().Equal(chainBIBCToken.GetFullDenomPath(), balances[1].Denom) + }) + } + t.Run("non-native IBC token transfer from chainB to chainA, receiver is source of tokens", func(t *testing.T) { transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") s.AssertTxSuccess(transferTxResp) diff --git a/e2e/testsuite/grpc_query.go b/e2e/testsuite/grpc_query.go index c89d340abd8..fb71017aa6e 100644 --- a/e2e/testsuite/grpc_query.go +++ b/e2e/testsuite/grpc_query.go @@ -18,6 +18,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/authz" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" grouptypes "github.com/cosmos/cosmos-sdk/x/group" @@ -47,6 +48,7 @@ type GRPCClients struct { // InterTxQueryClient intertxtypes.QueryClient // SDK query clients + BankQueryClient banktypes.QueryClient GovQueryClient govtypesv1beta1.QueryClient GovQueryClientV1 govtypesv1.QueryClient GroupsQueryClient grouptypes.QueryClient @@ -86,6 +88,7 @@ func (s *E2ETestSuite) InitGRPCClients(chain *cosmos.CosmosChain) { ICAControllerQueryClient: controllertypes.NewQueryClient(grpcConn), ICAHostQueryClient: hosttypes.NewQueryClient(grpcConn), // InterTxQueryClient: intertxtypes.NewQueryClient(grpcConn), + BankQueryClient: banktypes.NewQueryClient(grpcConn), GovQueryClient: govtypesv1beta1.NewQueryClient(grpcConn), GovQueryClientV1: govtypesv1.NewQueryClient(grpcConn), GroupsQueryClient: grouptypes.NewQueryClient(grpcConn), @@ -276,6 +279,20 @@ func (s *E2ETestSuite) QueryCounterPartyPayee(ctx context.Context, chain ibc.Cha return res.CounterpartyPayee, nil } +// QueryBalances returns all the balances on the given chain for the provided address. +func (s *E2ETestSuite) QueryAllBalances(ctx context.Context, chain ibc.Chain, address string, resolveDenom bool) (sdk.Coins, error) { + queryClient := s.GetChainGRCPClients(chain).BankQueryClient + res, err := queryClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{ + Address: address, + ResolveDenom: resolveDenom, + }) + if err != nil { + return sdk.Coins{}, err + } + + return res.Balances, nil +} + // QueryProposalV1Beta1 queries the governance proposal on the given chain with the given proposal ID. func (s *E2ETestSuite) QueryProposalV1Beta1(ctx context.Context, chain ibc.Chain, proposalID uint64) (govtypesv1beta1.Proposal, error) { queryClient := s.GetChainGRCPClients(chain).GovQueryClient diff --git a/e2e/testvalues/values.go b/e2e/testvalues/values.go index 8122828015c..5c9de12dbe0 100644 --- a/e2e/testvalues/values.go +++ b/e2e/testvalues/values.go @@ -48,6 +48,11 @@ func SolomachineClientID(id int) string { return fmt.Sprintf("06-solomachine-%d", id) } +// TokenMetadataFeatureReleases represents the releases the token metadata was released in. +var TokenMetadataFeatureReleases = semverutil.FeatureReleases{ + MajorVersion: "v8", +} + // GovGenesisFeatureReleases represents the releases the governance module genesis // was upgraded from v1beta1 to v1. var GovGenesisFeatureReleases = semverutil.FeatureReleases{