Conversation
|
🚀 🚀 🚀 🚀 🚀 |
|
bitcoindevkit/bdk-kyoto#155 I opened this Draft PR (and a related issue) Just using my fork of bdk-kyoto with the change rn |
|
updated to official 3.0 |
|
|
thanks I updated to 0.16.0 and made one small change |
thunderbiscuit
left a comment
There was a problem hiding this comment.
I compiled and ran Rust tests locally today. Just started looking at this and left a few comments. I haven't gone through all files yet (tx_builder, types, wallet left to do). I'll try and migrate the Android app to this potential alpha to see how the migration goes! Looks like it should be pretty smooth.
| [package] | ||
| name = "bdk-ffi" | ||
| version = "2.4.0-alpha.0" | ||
| version = "3.0.0" |
There was a problem hiding this comment.
This one here I think should read 3.0.0-alpha.0 since this would merge on master.
There was a problem hiding this comment.
Ahhh, I guess I did no -alpha just because in my head I was thinking we only bumped to -alpha after the release work was merged to master and the release was cut, but I might have been remembering that wrong.
No strong opinion from me, just wanted to double check w ya, but im good with whatever you comment back on this for me to change it to.
There was a problem hiding this comment.
(go w thunders suggestion here)
| let secp = Secp256k1::new(); | ||
| let (extended_descriptor, key_map) = descriptor.into_wallet_descriptor(&secp, network)?; | ||
| let (extended_descriptor, key_map) = | ||
| descriptor.into_wallet_descriptor(&secp, network.into())?; |
There was a problem hiding this comment.
I still need to get to grips with the NetworkKind type. Are there situations where we'd like to use that instead of the Network for example? Not sure.
There was a problem hiding this comment.
I don’t have any concrete ffi facing cases that come to mind, since NetworkKind only has Main and Test... I’ve been thinking of it as mostly an internal/upstream type for apis that only care about that distinction, where bdk-ffi consumers would usually want the full Network to preserve the actual chain. But I need to keep thinking about it more too so im glad you commented on it here
| #[derive(Debug, Clone, uniffi::Record)] | ||
| pub struct PreV1WalletKeychain { | ||
| /// The wallet keychain. | ||
| pub keychain: bdk_wallet::KeychainKind, |
There was a problem hiding this comment.
Can we use our own KeychainKind from the types module here? I think they're functionally equivalent because it's using remote enums in uniffi, but could still be a tiny cleanup unless I am missing something.
There was a problem hiding this comment.
I think the small uniffi wrinkle i found here was crate::types::KeychainKind isn’t currently usable from this module because the backing alias in types.rs is private so switching this line wasn't a easy one line cleanup, and since the rest of the code was also using bdk_wallet::KeychainKind directly I decided to leave it as is in this PR.
But its definitely something we could do, it just seemed like it might end up needing to be a separate/bigger refactor
| } | ||
|
|
||
| /// Retrieve keychain metadata from a pre-v1 BDK SQLite wallet database. | ||
| pub fn get_pre_v1_wallet_keychains( |
There was a problem hiding this comment.
I'd love to see a test for this one in the Android or Swift parts of the codebase if possible.
There was a problem hiding this comment.
Yeah, that makes sense. I looked around the code and I think we already have Swift/Android persistence tests but I don’t think we had a pre-v1 SQLite database in the repo, so adding a bindings test for this I think would have meant adding that first. And then also I wasn't totally sure if we were going to expose this in 3.0 or not.
But im with you on if we do want to expose this for sure in our ffi 3.0 (or whenever we expose it in a release) that it would be quite nice to have a test for this, and prob worth putting in time to figure out how to test it well
|
|
||
| /// Metadata describing a keychain in a pre-v1 BDK SQLite wallet database. | ||
| #[derive(Debug, Clone, uniffi::Record)] | ||
| pub struct PreV1WalletKeychain { |
There was a problem hiding this comment.
I was looking at the Rust code for this type and I see that the API docs have changed since you added it I think. See here.
There was a problem hiding this comment.
this is deep in the weeds, I love it, good catch!
updated in 6cca30e
|
@thunderbiscuit I rebased onto current master and dropped commits superseded by #978 |
Description
3.0 draft. WIP.
Notes to the reviewers
Documentation
bdk_walletbitcoinuniffiChecklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features:
Bugfixes: