Skip to content

Commit

Permalink
fix: remove pagination on liquid-validators
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsam committed Feb 28, 2022
1 parent 5e4ef3b commit 396e25e
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 300 deletions.
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

94 changes: 0 additions & 94 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4466,24 +4466,6 @@ paths:
description: >-
LiquidValidatorState is type LiquidValidator with state
added to return to query results.
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
title: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: >-
QueryLiquidValidatorsResponse is the response type for the
Query/LiquidValidators RPC method.
Expand All @@ -4509,64 +4491,6 @@ paths:
value:
type: string
format: byte
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.
It is less efficient than using key. Only one of offset or key
should
be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.
If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include
a count of the total number of items available for pagination in
UIs.
count_total is only respected when offset is used. It is ignored
when key
is set.
in: query
required: false
type: boolean
format: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending
order.
in: query
required: false
type: boolean
format: boolean
tags:
- Query
externalDocs:
Expand Down Expand Up @@ -7112,24 +7036,6 @@ definitions:
description: >-
LiquidValidatorState is type LiquidValidator with state added to
return to query results.
pagination:
description: pagination defines the pagination in the response.
type: object
properties:
next_key:
type: string
format: byte
title: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total
was set, its value is undefined otherwise
description: >-
QueryLiquidValidatorsResponse is the response type for the
Query/LiquidValidators RPC method.
Expand Down
9 changes: 1 addition & 8 deletions proto/squad/liquidstaking/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";
package squad.liquidstaking.v1beta1;

import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "squad/liquidstaking/v1beta1/liquidstaking.proto";
import "gogoproto/gogo.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
Expand Down Expand Up @@ -75,17 +74,11 @@ message QueryParamsResponse {
}

// QueryLiquidValidatorsRequest is the request type for the Query/LiquidValidators RPC method.
message QueryLiquidValidatorsRequest {
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
message QueryLiquidValidatorsRequest {}

// QueryLiquidValidatorsResponse is the response type for the Query/LiquidValidators RPC method.
message QueryLiquidValidatorsResponse {
repeated LiquidValidatorState liquid_validators = 1 [(gogoproto.nullable) = false];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryStatesRequest is the request type for the Query/States RPC method.
Expand Down
5 changes: 1 addition & 4 deletions x/liquidstaking/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,13 @@ $ %s query %s liquid-validators
}

queryClient := types.NewQueryClient(clientCtx)
pageReq, err := client.ReadPageRequest(cmd.Flags())
if err != nil {
return err
}

res, err := queryClient.LiquidValidators(
cmd.Context(),
&types.QueryLiquidValidatorsRequest{
Pagination: pageReq,
},
&types.QueryLiquidValidatorsRequest{},
)
if err != nil {
return err
Expand Down
Loading

0 comments on commit 396e25e

Please sign in to comment.