Commit Graph

799 Commits

Author SHA1 Message Date
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
Kris Nuttycombe a81e7ff306 zcash_client_backend: Fix note selection & add more cross-pool tests. 2024-03-13 18:44:36 -06: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
Kris Nuttycombe b2597aa952 zcash_client_backend: Add a test for ZIP 317 cross-pool payments. 2024-03-13 13:54:53 -06:00
Jack Grigg 634ebf51ef Reorder `WalletRead` and `WalletWrite` trait methods for clarity 2024-03-13 16:00:32 +00:00
Jack Grigg 7d603b8c59 zcash_client_backend: Add `proto::service::TreeState::to_chain_state` 2024-03-13 12:54:58 +00:00
Kris Nuttycombe a0460886f4 Fix stray clippy complaint. 2024-03-12 18:27:02 -06:00
Kris Nuttycombe 2ba89a6d16 zcash_client_backend: Fix `scan_cached_blocks` example doc compilation errors. 2024-03-12 18:27:02 -06:00
Kris Nuttycombe f58263e211 zcash_client_backend: Require the tree state for the start of each scanned range.
In order to support constructing the anchor for multiple pools with a
common anchor height, we must be able to checkpoint each note commitment
tree (and consequently compute the root) at that height. Since we may
not have the information in the tree needed to do so, we require that it
be provided.

As a bonus, this change makes it possible to improve the UX around
spendability, because we will no longer require subtree ranges below
received notes to be fully scanned; the inserted frontier provides
sufficient information to make them spendable.
2024-03-12 18:14:11 -06:00
Kris Nuttycombe 0c5a365c60 zcash_client_sqlite: Update to make use of `orchard::note::Rho` 2024-03-12 17:28:10 -06: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 1028894324 zcash_client_sqlite: Minor refactoring for improved debuggability & future Sapling flagging. 2024-03-11 18:58:09 +00:00
Kris Nuttycombe 8dfa836a03 zcash_client_sqlite: Use correct offsets for Orchard commitment positions. 2024-03-11 17:42:23 +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
Kris Nuttycombe de58b5a5b1 zcash_client_sqlite: Add a failing test of cross-pool transfer 2024-03-11 11:36:35 +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
Jack Grigg 075a155a29 Remove `orchard` feature flag from docs.rs builds while not public 2024-03-09 11:37:25 +00:00
Oscar Pepper a63cf37c7b zcash_client_backend: Fixed cargo doc build failure when transparent-inputs feature is not specified
(cherry picked from commit ab701118f3)
2024-03-09 11:37:25 +00:00
Kris Nuttycombe e24d93ccfd
Merge pull request #1228 from Oscar-Pepper/fix_cargo_doc_build_failure
Fixed cargo doc build failure
2024-03-08 15:44:09 -07: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
Oscar Pepper ab701118f3
zcash_client_backend: Fixed cargo doc build failure when transparent-inputs feature is not specified 2024-03-07 11:33:10 +00:00
Kris Nuttycombe 376db4684b Fix incorrect zip321 amount parsing. 2024-03-05 21:50:25 -07:00
Kris Nuttycombe 6b4942f8eb Add failing test for incorrect zip321 amount parsing. 2024-03-05 21:48:05 -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 5675a76f0d zcash_protocol: Use `BalanceError` instead of `()` for monetary range violations. 2024-03-05 13:59:26 -07:00
Kris Nuttycombe a823ed776f Expose address generation errors when constructing default addresses 2024-03-05 13:36:15 -07:00
Kris Nuttycombe 4b18426fcd zcash_address: Use `zcash_protocol::consensus::NetworkType`
This inverts the dependency relationship between `zcash_protocol` and
`zcash_address`, permitting the network constants (primarily the HRPs)
defined in `zcash_protocol` to be used directly in `zcash_address`
instead of being duplicated.
2024-03-05 13:36:15 -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 a35ccfc10b Fix broken intra-doc links after `zcash_protocol` crate extraction. 2024-03-05 09:45:24 -07:00
Kris Nuttycombe eb3c7b479e zcash_protocol: Modify `Zatoshis` to directly wrap a u64 2024-03-05 09:45:24 -07:00
Kris Nuttycombe 5e4d9abbce Move `Amount` and `NonNegativeAmount` types to the `zcash_protocol` crate. 2024-03-05 09:45:24 -07:00
Kris Nuttycombe bacfe3cb9d Move `zcash_primitives::{consensus, constants}` to the `zcash_protocol` crate 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 dbdc88e4d7 Revert "Hide unstable `orchard` feature flag in rustdoc"
Now that the release commits are created, we can unhide this ahead of
the subsequent Orchard-supporting releases.

This reverts commit zcash/librustzcash@6161709441.
2024-03-01 01:17:15 +00:00
Jack Grigg dfb6c65edd zcash_client_backend 0.11.0
Closes zcash/librustzcash#962.
2024-03-01 01:16:04 +00:00