-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix: limit pagination #25828
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
base: main
Are you sure you want to change the base?
fix: limit pagination #25828
Conversation
This comment has been minimized.
This comment has been minimized.
| // if the custom limit is greater than the default limit, adjust it back down | ||
| if limit > query.DefaultLimit { | ||
| limit = query.DefaultLimit | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment for DefaultLimit only says it is used when no limit is supplied. we should either:
- update comment
or
- make a new variable, MaxLimit, to make the code more self-documenting. there is a
PaginationMaxLimit, however, it's only used in tests and here:So we can probably just update these usages to usecosmos-sdk/x/bank/keeper/genesis.go
Line 60 in 7fd79df
totalSupply, _, err := k.GetPaginatedTotalSupply(ctx, &query.PageRequest{Limit: query.PaginationMaxLimit}) math.MaxUint64directly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25828 +/- ##
=======================================
Coverage 68.23% 68.24%
=======================================
Files 894 894
Lines 58150 58152 +2
=======================================
+ Hits 39680 39684 +4
+ Misses 18470 18468 -2
🚀 New features to boost your workflow:
|
Limits pagination to the default limit if provided limit exceeds.