Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
toteki committed Dec 27, 2023
1 parent 8130034 commit 97b4b93
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions x/leverage/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 97b4b93

Please sign in to comment.