Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pagination in contract queries #88

Closed
ethanfrey opened this issue Aug 12, 2021 · 0 comments
Closed

Add support for pagination in contract queries #88

ethanfrey opened this issue Aug 12, 2021 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@ethanfrey
Copy link
Contributor

ethanfrey commented Aug 12, 2021

In #85 I introduced a number of list queries in x/poe/contracts/query.go. They all have a limit of 30 and no pagination, which should be fine for the first internal testnet, but not enough for anything public. They should be adjusted to paginate over the response until all results are returned.

In particular:

  • ListValidators
  • QueryTG4MembersByWeight
  • QueryTG4Members

The contract support pagination already. We need to update the query types to pass the relevant data:

type Paginater struct {
	Limit      uint32 `json:"limit,omitempty"`
	StartAfter string `json:"start_after,omitempty"`
}

StartAfter is any raw entry from the returned list. If this can be handled within the contract package that would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants