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

adds filtering to wallet/getNotes endpoint #3867

Merged
merged 4 commits into from
May 9, 2023

Conversation

hughy
Copy link
Contributor

@hughy hughy commented Apr 28, 2023

Summary

supports filtering notes by value, assetId, assetName, memo, sender, noteHash, transactionHash, index, and spent.

implements naive filtering: iterates over all notes and includes notes that meet the filter criteria. this doesn't make use of walletDb indexes that could be helpful depending on the filter. for example, if 'spent = false', we could use 'unspentNoteHashes' to avoid iterating over all of the spent notes.

Testing Plan

  • adds unit tests

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[X] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@hughy hughy force-pushed the feature/ifl-769/getnotes-filter branch from 5a0c190 to 2e8ab76 Compare May 1, 2023 20:25
@hughy hughy force-pushed the feature/ifl-770/wallet-getnotes branch 2 times, most recently from 9439e5f to 6430e27 Compare May 3, 2023 23:21
@hughy hughy force-pushed the feature/ifl-769/getnotes-filter branch from 2e8ab76 to abeb00a Compare May 4, 2023 00:13
Base automatically changed from feature/ifl-770/wallet-getnotes to staging May 8, 2023 21:27
hughy added 3 commits May 8, 2023 14:41
supports filtering notes by value, assetId, assetName, memo, sender, noteHash,
transactionHash, index, and spent.

implements naive filtering: iterates over all notes and includes notes that meet
the filter criteria. this doesn't make use of walletDb indexes that could be
helpful depending on the filter. for example, if 'spent = false', we could use
'unspentNoteHashes' to avoid iterating over all of the spent notes.
filtering by note owner address seems unnecessary since we already filter by
account
nests all filter fields in a 'filter' object in the request
@hughy hughy force-pushed the feature/ifl-769/getnotes-filter branch from abeb00a to f3a051a Compare May 8, 2023 21:46
@hughy hughy marked this pull request as ready for review May 8, 2023 21:46
@hughy hughy requested a review from a team as a code owner May 8, 2023 21:46
@dguenther dguenther merged commit 0677fd9 into staging May 9, 2023
@dguenther dguenther deleted the feature/ifl-769/getnotes-filter branch May 9, 2023 18:07
@dguenther dguenther mentioned this pull request May 9, 2023
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