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

feat: rpc endpoint to list addresses #1589

Merged
merged 2 commits into from
Mar 19, 2019
Merged

feat: rpc endpoint to list addresses #1589

merged 2 commits into from
Mar 19, 2019

Conversation

zachdaniel
Copy link
Contributor

Resolves #1250

Changelog

Enhancements

  • Add an RPC endpoint that returns addresses, paginated, ordered by inserted_at

@ghost ghost assigned zachdaniel Mar 18, 2019
@ghost ghost added the in progress label Mar 18, 2019
@zachdaniel zachdaniel changed the title feat: rpc address to list addresses feat: rpc endpoint to list addresses Mar 18, 2019
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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

@ghost ghost assigned vbaranov Mar 19, 2019
@coveralls
Copy link

coveralls commented Mar 19, 2019

Pull Request Test Coverage Report for Build 8f10b4de-bbf3-4300-b6d1-ca4cce5ae9c2

  • 10 of 12 (83.33%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 82.401%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/explorer/lib/explorer/chain.ex 0 2 0.0%
Totals Coverage Status
Change from base Build afacb8a5-94a3-4deb-992f-b444a4d9908d: 0.2%
Covered Lines: 4228
Relevant Lines: 5131

💛 - Coveralls

Copy link
Member

@vbaranov vbaranov left a 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"}

@vbaranov vbaranov self-requested a review March 19, 2019 15:06
@vbaranov vbaranov merged commit 44f523e into master Mar 19, 2019
@vbaranov vbaranov deleted the rpc-list-accounts branch March 19, 2019 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants