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

api: implement pagination and query params for /chain/transfers #1359

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

altergui
Copy link
Contributor

@altergui altergui commented Aug 6, 2024

add a new endpoint, that includes pagination field in reply, and accepts QueryParams:

  • GET /chain/transfers

    • page
    • limit
    • accountId
    • accountIdFrom
    • accountIdTo
  • mark all of these endpoints as deprecated on swagger docs:

    • /accounts/{accountId}/transfers/page/{page}
    • /accounts/{accountId}/fees/page/{page}
  • api: add TransfersList struct

  • indexer: replace GetTokenTransfersBy*Account methods with a new TokenTransfersList

Copy link
Member

@elboletaire elboletaire left a comment

Choose a reason for hiding this comment

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

LGTM but an additional review from a Go expert would be more than welcome.

@altergui altergui force-pushed the feat/api-transfers-pagination branch 2 times, most recently from 856bdf7 to e3da561 Compare August 6, 2024 12:52
@coveralls
Copy link

coveralls commented Aug 6, 2024

Pull Request Test Coverage Report for Build 10282805123

Details

  • 161 of 198 (81.31%) changed or added relevant lines in 11 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.6%) to 62.562%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/end2endtest/account.go 1 2 50.0%
apiclient/account.go 4 7 57.14%
vochain/indexer/process.go 8 12 66.67%
vochain/indexer/indexer.go 30 37 81.08%
api/chain.go 51 61 83.61%
vochain/indexer/db/db.go 27 39 69.23%
Files with Coverage Reduction New Missed Lines %
apiclient/account.go 1 38.32%
cmd/end2endtest/account.go 1 60.84%
Totals Coverage Status
Change from base Build 10110897012: 0.6%
Covered Lines: 16417
Relevant Lines: 26241

💛 - Coveralls

…rams

add a new endpoint, that includes `pagination` field in reply, and accepts QueryParams:
 * GET /chain/transfers
   * page
   * limit
   * accountId
   * accountIdFrom
   * accountIdTo

* mark all of these endpoints as deprecated on swagger docs:
  * /accounts/{accountId}/transfers/page/{page}
  * /accounts/{accountId}/fees/page/{page}

* introduced a breaking change in the endpoint `/accounts/{accountId}/transfers/page/{page}`
  since now the returned json structure changed.
  now it's a plain list of transfers instead of "received" and "sent"
  also fixed the encoding of the txHash field, now is base16 instead of base64

* api: add structs TransfersList, TransfersParams

* indexer: replace GetTokenTransfersBy*Account methods with a new TokenTransfersList
@altergui altergui force-pushed the feat/api-transfers-pagination branch from e3da561 to 1c62c0c Compare August 7, 2024 09:48
…tFound, ErrOrgNotFound

 * add tests to avoid regressions
@altergui altergui force-pushed the feat/api-transfers-pagination branch from 1c62c0c to ca3f738 Compare August 7, 2024 10:40
@altergui altergui merged commit ca3f738 into main Aug 7, 2024
16 checks passed
@altergui altergui deleted the feat/api-transfers-pagination branch August 7, 2024 11: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.

3 participants