Commit Graph

255 Commits

Author SHA1 Message Date
Kris Nuttycombe b60600a4c3 zcash_client_sqlite: Use `ZcashAddress` for persistence of sent note addresses
Prior to this change, the recipient of a sent transaction would always
be shown as the protocol-level address, instead of any unified address
intended as the recipient. Now, instead of reencoding the recipient
address, we use the original `ZcashAddress` value from the payment
request.
2024-04-05 16:48:13 -06:00
Kris Nuttycombe 3ea7d84183 zcash_client_backend: Update to use extracted `zip321` crate 2024-04-05 16:25:21 -06:00
Kris Nuttycombe d982d7826a zip321: Replace dependencies on `zcash_keys` types with `zcash_address` 2024-04-05 16:10:22 -06:00
Jack Grigg 24277a6ba4 zcash_client_backend: Implement async wallet synchronization function
This implements the necessary state machine for taking a wallet in some
arbitrary synchronization status, and fully scanning (the remainder of)
the chain.

Closes zcash/librustzcash#1169.
2024-04-02 00:26:08 +00:00
oscar-pepper 25b8404e2d
Add block cache trait (#1192) 2024-04-01 21:55:16 +01:00
Kris Nuttycombe 1cb33c8b06 zcash_client_backend release version 0.12.1 2024-03-27 14:58:12 -06:00
Kris Nuttycombe 777adb871d Release zcash_client_backend version 0.12.0
Closes #1079
2024-03-25 14:03:42 -06:00
Kris Nuttycombe 151e6e526e zcash_client_backend: Track external addresses in inter-account transactions.
Previously, if the funding account for a received transaction output was
determined to be an account known to the wallet, the output was recorded
as though it were sent to an internal (change) address of the wallet.
2024-03-25 07:59:21 -06:00
Kris Nuttycombe 5d3ddabe24 zcash_client_sqlite: Add a test to attempt to simulate the checkpoint conflict bug (not failing.) 2024-03-23 08:37:59 -06:00
Kris Nuttycombe dc4fccf566 zcash_client_sqlite: Modify `TestState` to allow initialization with chain state. 2024-03-20 20:43:49 -06:00
Kris Nuttycombe 4f7c5bd722 zcash_client_sqlite: Fix `scan_complete` tests. 2024-03-19 16:11:57 -06:00
Jack Grigg 3090aff87f Distinguish seed relevance when no derived accounts are present
During wallet migration in particular, the absence of _any_ accounts is
expected, and all seeds should be treated as relevant (because accounts
cannot be added before a wallet is initialized).
2024-03-19 17:53:41 +00:00
Jack Grigg e6bc21b461 Add `WalletRead::is_seed_relevant_to_any_derived_accounts` 2024-03-19 00:34:28 +00:00
Kris Nuttycombe ab3e790bfc zcash_client_backend: Rename `AccountKind` to `AccountSource` 2024-03-15 09:28:35 -06:00
Kris Nuttycombe 46fd6ab0fe zcash_client_backend: Make `WalletRead::get_transaction` return `Result<Option<Transaction>, _>`
This should never have had the behavior of returning an error on a
missing txid in the first place; doing so conflates database corruption
or connectivity errors with the ordinary case where data may not be
available.
2024-03-14 17:38:51 -06:00
Kris Nuttycombe 0bae47b05b zcash_client_backend: Improve API ergonomics for input selection. 2024-03-13 19:33:06 -06:00
Kris Nuttycombe 22f341888f zcash_client_backend: Add `SpendableNotes` type and `NoteRetention` trait. 2024-03-13 19:32:16 -06:00
str4d 2e0a3005de
Merge pull request #1268 from nuttycom/sqlite_wallet/cross_pool_note_selection
zcash_client_backend: Fix note selection & add more multi-pool tests.
2024-03-14 01:12:42 +00:00
Jack Grigg bbb7f36e55 zcash_client_backend: Add `WalletRead::get_account` 2024-03-13 21:00:59 +00:00
Jack Grigg 64aabdc54a Rename `WalletRead::get_seed_account` to `WalletRead::get_derived_account` 2024-03-13 21:00:59 +00:00
Jack Grigg 5f3d5e9f4a zcash_client_sqlite: Use `wallet::Account` for `WalletRead::Account` 2024-03-13 21:00:59 +00:00
Jack Grigg 65093487c3 zcash_client_backend: Expose the kind of an `Account` 2024-03-13 21:00:59 +00:00
Kris Nuttycombe dd63a6e3dd zcash_client_backend: Remove unnecessary `ReceivedNote::traverse_opt` 2024-03-13 14:19:26 -06:00
Jack Grigg 7d603b8c59 zcash_client_backend: Add `proto::service::TreeState::to_chain_state` 2024-03-13 12:54:58 +00:00
Kris Nuttycombe 33e943d14a zcash_client_backend: Add `WalletRead::get_seed_account` 2024-03-12 11:21:04 -06:00
Kris Nuttycombe 5e810d3689
Merge pull request #1258 from nuttycom/sqlite_wallet/fuzzy_key_matching
Return partial matches when using `WalletRead::get_account_for_ufvk`.
2024-03-12 11:12:34 -06:00
Kris Nuttycombe 09181f458c zcash_client_sqlite: Return a backend-specific `Account` type from get_account_by_ufvk. 2024-03-12 08:59:53 -06:00
Jack Grigg 5a6057b8fb zcash_client_backend: Detect Orchard dust in `zip317::SingleOutputChangeStrategy` 2024-03-11 18:58:09 +00:00
Kris Nuttycombe 374ed8cf94 zcash_client_sqlite: Add backend impl for the Orchard note commitment tree 2024-03-11 16:35:01 +00:00
Jack Grigg c4abcba343 zcash_client_backend: Add Orchard change output support to proposals 2024-03-10 21:47:40 +00:00
Kris Nuttycombe 19868af84a
Merge pull request #1246 from zcash/zcb-0.11-zcs-0.9-doc-fixes
`zcash_client_backend 0.11.1`, `zcash_client_sqlite 0.9.1` with doc fixes
2024-03-09 08:19:41 -07:00
Jack Grigg 7f38b79c3c zcash_client_backend 0.11.1 2024-03-09 11:38:33 +00:00
Kris Nuttycombe 78e4916899 zcash_client_backend: Generalize `DecryptedOutput` to support Orchard 2024-03-08 13:48:30 -07:00
Kris Nuttycombe 4c5ce32dee zcash_client_backend: Use `NonNegativeAmount` for `select_spendable_notes` 2024-03-08 13:48:30 -07:00
Kris Nuttycombe 8f4de9b235
Merge pull request #1235 from zcash/diverse_accounts
zcash_client_sqlite: Rework accounts to support imported viewing keys
2024-03-08 13:39:08 -07:00
Andrew Arnott 0c80893ce0 zcash_client_sqlite: Rework accounts to support imported viewing keys 2024-03-08 18:55:18 +00:00
Kris Nuttycombe 4532520670 zcash_client_backend: Add Orchard frontier to `AccountBirthday` 2024-03-07 14:45:23 -07:00
Kris Nuttycombe 376db4684b Fix incorrect zip321 amount parsing. 2024-03-05 21:50:25 -07:00
Kris Nuttycombe eaabc0f514 Apply suggestions from code review
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>
2024-03-05 20:03:46 -07:00
Kris Nuttycombe 64454100c5 zcash_client_backend: Move the `ShieldedProtocol` and `PoolType` types to `zcash_protocol` 2024-03-05 09:46:03 -07:00
Kris Nuttycombe eb3c7b479e zcash_protocol: Modify `Zatoshis` to directly wrap a u64 2024-03-05 09:45:24 -07:00
Kris Nuttycombe 0d430ba62c Apply documentation suggestions from code review.
Co-authored-by: str4d <thestr4d@gmail.com>
2024-03-04 13:32:26 -07:00
Kris Nuttycombe e4c0b0e63f zcash_client_backend: Add `WalletRead::validate_seed`
This adds a mechanism that allows a caller to verify that a given seed
generates the viewing key that is stored in the wallet for a specified
account.

Fixes #1189
2024-03-04 10:59:56 -07:00
Jack Grigg dfb6c65edd zcash_client_backend 0.11.0
Closes zcash/librustzcash#962.
2024-03-01 01:16:04 +00:00
Kris Nuttycombe e44ddee8ad zcash_client_backend: Add documentation for the `data_api` module.
Fixes #1209
2024-03-01 00:47:15 +00:00
Kris Nuttycombe a4b951d193 Apply suggestions from code review
Co-authored-by: str4d <thestr4d@gmail.com>
2024-02-29 15:19:07 -07:00
Kris Nuttycombe 27f6207a7c zcash_client_backend: Pass nullifiers separately from scanning keys. 2024-02-29 12:06:22 -07:00
Kris Nuttycombe 7e8723bea9 zcash_client_backend: Add Orchard support to batch scanning. 2024-02-29 12:04:53 -07:00
Kris Nuttycombe 880c24c45d zcash_client_backend: Generalize key source metadata. 2024-02-29 11:55:44 -07:00
Kris Nuttycombe 802c01002a zcash_client_backend: Rework scanning key identifiers.
In the process of making the internals of `scan_block_with_runner`
reusable across Sapling and Orchard, it became evident that key
identifier abstraction along the lines of #1175 is needed more
generally. This commit refactors the use of ZIP 32 account identifiers
and key scopes to better separate scanning concerns from ZIP 32 key
derivation. In the process, this removes a fair amount of unnecessary
polymorphism from `zcash_client_backend::wallet::WalletTx` and related
types.
2024-02-29 11:55:25 -07:00