diff --git a/types/query/pagination.go b/types/query/pagination.go index de984dd2f8..bef2cd6575 100644 --- a/types/query/pagination.go +++ b/types/query/pagination.go @@ -81,9 +81,8 @@ func Paginate( if limit == 0 { limit = DefaultLimit - - // count total results when the limit is zero/not supplied - countTotal = true + // do not count total results when the limit is zero/not supplied + // countTotal = true } else if limit > DefaultLimit { // limit to protect the node would not be Query DoS limit = DefaultLimit diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 4228b0cde9..a8119361d1 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -122,7 +122,8 @@ func (s *paginationTestSuite) TestPagination() { request := types.NewQueryAllBalancesRequest(addr1, pageReq) res, err := queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) - s.Require().Equal(res.Pagination.Total, uint64(numBalances)) + // default page request will not return total count + // s.Require().Equal(res.Pagination.Total, uint64(numBalances)) s.Require().NotNil(res.Pagination.NextKey) s.Require().LessOrEqual(res.Balances.Len(), defaultLimit)