Skip to content

Commit

Permalink
zcash_client_backend: Make AccountId an associated type of `WalletR…
Browse files Browse the repository at this point in the history
…ead`

This PR was extracted from zcash#1175
in order to make the changes to `zcash_client_backend` usable without
the additional generalizations to `zcash_client_sqlite` made by that PR.

Co-authored-by: Andrew Arnott <[email protected]>
  • Loading branch information
nuttycom and AArnott committed Feb 28, 2024
1 parent 5ed788d commit c43b6a1
Show file tree
Hide file tree
Showing 13 changed files with 393 additions and 219 deletions.
35 changes: 34 additions & 1 deletion zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ and this library adheres to Rust's notion of
}`
- `WalletSummary::next_sapling_subtree_index`
- `wallet`:
- `HDSeedAccount`
- `ImportedAccount`
- `Account`
- `propose_standard_transfer_to_address`
- `create_proposed_transactions`
- `input_selection`:
Expand Down Expand Up @@ -96,6 +99,34 @@ and this library adheres to Rust's notion of
- `parse::Param::name`

### Changed
- Several structs and functions had `AccountId` added as a generic type
parameter in order to decouple the concepts of an account identifier
and a ZIP-32 account index. Many APIs that previously referenced `zcash_primitives::zip32::AccountId` now reference the generic type. Impacted types and functions are:
- `zcash_client_backend::data_api::wallet::InputSelector::propose_transaction`
- `zcash_client_backend::data_api::wallet::propose_transfer`
- `zcash_client_backend::data_api::wallet::propose_standard_transfer_to_address`
- `zcash_client_backend::data_api::WalletRead::get_account_birthday`
- `zcash_client_backend::data_api::WalletRead::get_current_address`
- `zcash_client_backend::data_api::WalletRead::get_unified_full_viewing_keys`
- `zcash_client_backend::data_api::WalletRead::get_account_for_ufvk`
- `zcash_client_backend::data_api::WalletRead::get_wallet_summary`
- `zcash_client_backend::data_api::WalletRead::get_sapling_nullifiers`
- `zcash_client_backend::data_api::WalletRead::get_transparent_receivers`
- `zcash_client_backend::data_api::WalletRead::get_transparent_balances`
- `zcash_client_backend::data_api::WalletRead::get_account_ids`
- `zcash_client_backend::data_api::ScannedBlock`
- `zcash_client_backend::data_api::DecryptedTransaction`
- `zcash_client_backend::data_api::SentTransaction`
- `zcash_client_backend::data_api::SentTransactionOutput`
- `zcash_client_backend::data_api::WalletWrite::create_account`
- `zcash_client_backend::data_api::WalletWrite::get_next_available_address`
- `zcash_client_backend::decrypt::DecryptedOutput`
- `zcash_client_backend::decrypt::decrypt_transaction`
- `zcash_client_backend::scanning::scan_block`
- `zcash_client_backend::wallet::Recipient`
- `zcash_client_backend::wallet::WalletTx`
- `zcash_client_backend::wallet::WalletSaplingSpend`
- `zcash_client_backend::wallet::WalletSaplingOutput`
- `zcash_client_backend::data_api`:
- `BlockMetadata::sapling_tree_size` now returns an `Option<u32>` instead of
a `u32` for future consistency with Orchard.
Expand All @@ -114,6 +145,8 @@ and this library adheres to Rust's notion of
- `WalletSummary::new` now takes an additional `next_sapling_subtree_index`
argument.
- Changes to the `WalletRead` trait:
- Added associated type `AccountId`.
- Added `get_account` function.
- `get_checkpoint_depth` has been removed without replacement. This is no
longer needed given the change to use the stored anchor height for
transaction proposal execution.
Expand Down Expand Up @@ -273,7 +306,7 @@ and this library adheres to Rust's notion of
### Removed
- `zcash_client_backend::wallet`:
- `ReceivedSaplingNote` (use `zcash_client_backend::ReceivedNote` instead).
- `input_selection::{Proposal, ProposalError}` (moved to
- `input_selection::{Proposal, ShieldedInputs, ProposalError}` (moved to
`zcash_client_backend::proposal`).
- `SentTransactionOutput::sapling_change_to` - the note created by an internal
transfer is now conveyed in the `recipient` field.
Expand Down
Loading

0 comments on commit c43b6a1

Please sign in to comment.