-
Notifications
You must be signed in to change notification settings - Fork 17
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
indexer and api: track accounts, balances #1135
Conversation
Pull Request Test Coverage Report for Build 6786885591Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
4e49611
to
f40ede1
Compare
27cc966
to
4acddf8
Compare
4acddf8
to
f8aae38
Compare
@mvdan could you please review this PR when you have a chance? thanks 🙌 |
60900b3
to
be2fe43
Compare
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.
i didn't finish the review yet but leaving here some thought about names
be2fe43
to
dd5e0fc
Compare
dd5e0fc
to
a082c75
Compare
623fc56
to
68eeb23
Compare
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.
a couple more comments about names consistency, since i see in your commit message:
add new queries in token_transfers: GetTokenTransfersByToAccount, GetTokenTransfersByAccount, CountTokenTransfersByAccount
which sounds excellent and consistent,
yet in the code i see you missed the "By" in GetTokenTransfersAccount, CountTokenTransfersAccount. i pointed out the ones i spotted, maybe there are more
@mariajdab could you resolve and close the pending comments please? |
83eb460
to
7ab05ad
Compare
Done 🙌 |
It LGTM, good job @mariajdab |
@mvdan it would be nice if you can take a look, however if that's not possible, we'll merge this into main, since other changes to the indexer are pending and would conflict with this one. |
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.
SGTM
…psertAccount add new queries in token_transfers: GetTokenTransfersByToAccount, GetTokenTransfersByAccount, CountTokenTransfersByAccount indexer: update method onSetAccount integration test: update TestaccountAPI, add new test TestAPIAccountTokentxs end2end: update tokenxs test api: update GetTransfers, add countAccounts swagger documentation
7ab05ad
to
fdafc96
Compare
The last step is: open the issue in Interoperability announcing the changes to the API, so the SDK and documentation can incorporate them. Just to confirm that needs to be done before or after merge this PR ? @p4u |
You can do it after. Just document the new endpoints so at some point they can be incorporated into the SDK https://github.com/vocdoni/interoperability/issues |
I will merge this PR. Thanks for your work @mariajdab |
Note:
The proposal approach use upsert operation to insert or update an account, due the currently approach calls
OnSetAccount
Listener when an account is created and also when the balance is updated. This approach was tested in the indexer and integration test. Suggestions are welcome.to_account
to_account
is the provided address and where thefrom_account
is the provided address/accounts/page/:num
/accounts/count
/accounts/{accountID}/transfers/count
to provide the total number of sent and received transactions/accounts/{accountID}/transfers/page/:page
extended so it contains thereceived
andsent
transfers.test/api_test.go