diff --git a/x/leverage/keeper/grpc_query_test.go b/x/leverage/keeper/grpc_query_test.go index 41057ba60c..366633ccca 100644 --- a/x/leverage/keeper/grpc_query_test.go +++ b/x/leverage/keeper/grpc_query_test.go @@ -99,6 +99,29 @@ func (s *IntegrationTestSuite) TestQuerier_MarketSummary() { require.Equal(expected, *resp) } +func (s *IntegrationTestSuite) TestQuerier_TokenMarkets() { + require := s.Require() + + req := &types.QueryRegisteredTokenMarkets{} + resp, err := s.queryClient.RegisteredTokenMarkets(context.Background(), req) + require.NoError(err) + + expected := types.QueryRegisteredTokenMarketsResponse{ + Markets: []types.TokenMarket{}, + } + tokens := s.tk.GetAllRegisteredTokens(s.ctx) + for _, token := range tokens { + ms, err := s.queryClient.MarketSummary(context.Background(), &types.QueryMarketSummary{Denom: token.BaseDenom}) + require.NoError(err) + expected.Markets = append(expected.Markets, types.TokenMarket{ + Token: &token, + Market: ms, + }) + } + + require.Equal(expected, *resp) +} + func (s *IntegrationTestSuite) TestQuerier_AccountBalances() { ctx, require := s.ctx, s.Require()