-
Notifications
You must be signed in to change notification settings - Fork 45
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
Wallet persistence #436
Wallet persistence #436
Conversation
be37667
to
17d0044
Compare
02b7ee6
to
ea881e3
Compare
ea881e3
to
53405d1
Compare
7237407
to
ebf237c
Compare
Getting persistence to work with uniffi has been difficult, and a persistent PITA (see what I did there? 😆). Here is a writeup of the decisions and tradeoffs that I am contemplating at the moment. Note that as of this morning I decided that having an no-persistence wallet was a nice-to-have, but the burden of all the problems below come down to this idea of having multiple types of wallets (WalletNoPersist, Wallet, WalletSqlite, etc.), one for each of the generics for the Store type, so for now if I have to choose between two wallets I'd rather have the persisted one, and we can work on exposing a WalletNoPersist over time (this would at least unlock this PR and allow us to release a version with persistence). Core IssueThe basic problem we are facing is that the BDK Explored SolutionsApproach 1: Defining a
|
0a165c2
to
1fd28ef
Compare
1fd28ef
to
69d1837
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 tested this bdk-ffi PR locally, looks good! Is there any testing on iOS you’d like me to do (if you already did testing on Android or anything I’m cool with that).
I remember there was mention of trying an alternative enum approach to Approach 2, is that something you tried as well (just wondering if I need to wait on anything from that experiment or anything before I ACK)
Thanks for adding in the errors, just wondering if you were planning on exposing them any further in this PR or if that was for a follow up PR? I see they are exposed but just turn into Alpha3Error Generic’s I think. I’m cool either way since it would be nice to have but I also know sometimes exposing these errors gets hairy and this is already a PR that is “a persistent PITA” as you said ha.
Looks like kuutamo worked out well for you instead of mempool, glad that was helpful for those tests, are you thinking we want to for sure switch all the tests to use it now instead of mempool for the time being?
Good job getting all the set up and tear down for db done across all platforms (iOS, Android, Python) tests, amazing! I’m sure that was no small feat, kudos.
I’ll wait for your feedback on any of my comments in this review, or if there is anything else you might be thinking about this PR, but overall I am ready to ACK. Great job working thru all of this and looking at all the angles.
Update @reez: I have finally brought the errors out. A few things to note: our wallet constructor goes through actually two BDK functions:
Each of them returns a different error type, so I had to combine them into one, which I called We could eventually decide to expose the Store itself as a type and its constructor, but I think it's not super useful at this point. At this point I think this is ready to merge/iterate further in other PRs. |
whoa way to bring the errors out! yeah let me just pull it down locally and to a quick check again and then I will ACK in a few minutes |
7d1553e
to
43c1ca6
Compare
ACK 43c1ca6 |
This PR brings in the flat file persistence feature.
Notes:
3. I found errors related to the creating the file common, so I decided to expose that error as part of this PR.