-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat: rpc endpoint to list addresses #1589
Conversation
defp list_accounts(%{page_number: page_number, page_size: page_size}) do | ||
offset = (max(page_number, 1) - 1) * page_size | ||
|
||
# limit is just page_size |
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.
If this number can be provided by client, we should probably define some reasonable limit.
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 maximum page size is capped already, here: https://github.com/poanetwork/blockscout/pull/1589/files#diff-b6f6ac579ae480874463adb5891b5e40L174
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.
It is capped at 10,000
apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/address_controller.ex
Outdated
Show resolved
Hide resolved
Pull Request Test Coverage Report for Build 8f10b4de-bbf3-4300-b6d1-ca4cce5ae9c2
💛 - Coveralls |
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.
There is an error in the test:
** (KeyError) key :placeholder not found in: %{description: "A nonnegative integer that represents the page number to be used for pagination. 'offset' must be provided in conjunction.", key: "page", type: "integer"}
e87d9bc
to
970d941
Compare
970d941
to
5bc627d
Compare
Resolves #1250
Changelog
Enhancements