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 4dd601f
Show file tree
Hide file tree
Showing 13 changed files with 398 additions and 219 deletions.
40 changes: 39 additions & 1 deletion zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ and this library adheres to Rust's notion of
}`
- `WalletSummary::next_sapling_subtree_index`
- `wallet`:
- `Account`
- `propose_standard_transfer_to_address`
- `create_proposed_transactions`
- `input_selection`:
Expand Down Expand Up @@ -96,6 +97,41 @@ and this library adheres to Rust's notion of
- `parse::Param::name`

### Changed
- Several structs and functions now take an `AccountId` type parameter
parameter in order to decouple the concept of an account identifier from
the 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`:
- `WalletRead::{
get_account_birthday,
get_current_address,
get_unified_full_viewing_keys,
get_account_for_ufvk,
get_wallet_summary,
get_sapling_nullifiers,
get_transparent_receivers,
get_transparent_balances,
get_account_ids
}`
- `ScannedBlock`
- `DecryptedTransaction`
- `SentTransaction`
- `SentTransactionOutput`
- `WalletWrite::create_account`
- `WalletWrite::get_next_available_address`
- `wallet::InputSelector::propose_transaction`
- `wallet::propose_transfer`
- `wallet::propose_standard_transfer_to_address`
- `zcash_client_backend::decrypt`
- `DecryptedOutput`
- `decrypt_transaction`
- `zcash_client_backend::scanning::scan_block`
- `zcash_client_backend::wallet`:
- `Recipient`
- `WalletTx`
- `WalletSaplingSpend`
- `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 +150,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 +311,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 4dd601f

Please sign in to comment.