Skip to content

Commit

Permalink
tendermint#262 Fix tx search pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
ackratos committed Nov 26, 2018
1 parent 4f6dfec commit 0f8d95e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rpc/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ make rpc-docs
## Pagination

Requests that return multiple items will be paginated to 30 items by default.
You can specify further pages with the ?page parameter. You can also set a
custom page size up to 100 with the ?per_page parameter.
You can specify further pages with the `?page` parameter. You can also set a
custom page size up to 10000 with the `?per_page` parameter.
3 changes: 2 additions & 1 deletion rpc/core/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
const (
// see README
defaultPerPage = 30
maxPerPage = 100
maxPerPage = 10000
)

var subscribeTimeout = 5 * time.Second
Expand Down Expand Up @@ -151,6 +151,7 @@ func validatePage(page, perPage, totalCount int) int {

func validatePerPage(perPage int) int {
if perPage < 1 || perPage > maxPerPage {
logger.Error("Wrong perPage parameter", "perPage", perPage, "defaultPerPage", defaultPerPage)
return defaultPerPage
}
return perPage
Expand Down

0 comments on commit 0f8d95e

Please sign in to comment.