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

docs: Enhanced the ParsePagination method documentation #20385

Merged
merged 7 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (server) [#19966](https://github.com/cosmos/cosmos-sdk/pull/19966) Return BlockHeader by shallow copy in server Context.
* (proto) [#20098](https://github.com/cosmos/cosmos-sdk/pull/20098) Use cosmos_proto added_in annotation instead of // Since comments.
* (baseapp) [#20208](https://github.com/cosmos/cosmos-sdk/pull/20208) Skip running validateBasic for rechecking txs.
* (query) [#20385](https://github.com/cosmos/cosmos-sdk/pull/20385) Enhanced the ParsePagination method documentation.
lucaslopezf marked this conversation as resolved.
Show resolved Hide resolved

### Bug Fixes

Expand Down
5 changes: 5 additions & 0 deletions types/query/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const DefaultLimit = 100
var PaginationMaxLimit uint64 = math.MaxUint64

// ParsePagination validate PageRequest and returns page number & limit.
// Note: cometBFT enforces a maximum query limit of 100 to avoid node overload.
lucaslopezf marked this conversation as resolved.
Show resolved Hide resolved
// Queries above this limit will return the first 100 items.
// To retrieve subsequent pages, use an offset equal to the
// total number of results retrieved so far. For example, if you have retrieved 100 results and want to
// retrieve the next set of results, set the offset to 100 and the appropriate limit.
func ParsePagination(pageReq *PageRequest) (page, limit int, err error) {
offset := 0
limit = DefaultLimit
Expand Down
Loading