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

Add query_accounts #53

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

lessless
Copy link
Contributor

Hey @rbino I'd love to contribute by adding the query_accounts function but that will require a bit of hand-holding and guidance.

As the first step I added TigerBeetlex.QueryFilter struct and I guess the next step is to encode it so that it can be passed in the query_accounts.

Is that how you see it?

@lessless lessless changed the title Add query accounts Add query_accounts Oct 31, 2024
@rbino
Copy link
Owner

rbino commented Nov 1, 2024

Hi @lessless, thanks for the interest!
I'm currently taking some time off and I'll be away from my pc, I'll get back to you as soon as I'm active again (should be ~10 days from now). Meanwhile feel free to experiment!

@lessless
Copy link
Contributor Author

lessless commented Nov 2, 2024

Hi @lessless, thanks for the interest! I'm currently taking some time off and I'll be away from my pc, I'll get back to you as soon as I'm active again (should be ~10 days from now). Meanwhile feel free to experiment!

Fantastic!

I wish you a great holiday and am going to leave a few notes for the future reference:

I added .query_accounts by reproducing what I've learned from looking at how lookup_account is implemented and now I am hitting the {:error, :invalid_batch_resource} in the submit_fn.

TigerBeetlex.NifAdapter.query_accounts(client.ref, TigerBeetlex.QueryFilter.encode(%TigerBeetlex.QueryFilter {}))

I guess it might be because lookup_accounts and lookup_transfers operate on ID batches whilst query_accounts and query_transfers operate on the QueryFilter struct.

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.

2 participants