zcash / librustzcash

Rust-language assets for Zcash
Other
324 stars 242 forks source link

Add support for importing accounts by UFVK #1425

Open AArnott opened 2 weeks ago

AArnott commented 2 weeks ago

Add import_account_hd and import_account_ufvk methods to the WalletWrite trait and implements them for the zcash_client_sqlite crate.

Also fix wallet::add_account to not fail when the UFVK contains fewer keys than librustzcash was compiled to support. For example, a UFVK that lacks a transparent key will no longer be rejected.

Partially fulfills #1075

Open questions

TODO

AArnott commented 1 week ago

I've manually tested this in my app and it works. I'd prefer to add unit tests to this PR only after I get a thumbs up on the API changes so that I know I'm testing the right thing.

AArnott commented 1 week ago

I rebased my commits and removed the merges (which brought back merge conflicts) so that I can use these same commits in my fork without bringing in the #1431 regression. Once approved, I can do a final merge with main to resolve conflicts.