Skip to content

Commit

Permalink
zcash_client_backend: Remove WalletSaplingOutput::cmu as redundant
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Feb 26, 2024
1 parent 6d307ce commit 333027b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
1 change: 1 addition & 0 deletions zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ and this library adheres to Rust's notion of
- `SentTransactionOutput::sapling_change_to` - the note created by an internal
transfer is now conveyed in the `recipient` field.
- `WalletSaplingSpend` use the generic `WalletSpend` instead.
- `WalletSaplingOutput::cmu` obtain `cmu` from the `Note` instead.
- `zcash_client_backend::data_api`:
- `{PoolType, ShieldedProtocol}` (moved to `zcash_client_backend`).
- `{NoteId, Recipient}` (moved to `zcash_client_backend::wallet`).
Expand Down
2 changes: 0 additions & 2 deletions zcash_client_backend/src/scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,6 @@ pub(crate) fn scan_block_with_runners<
|output_idx, output, note, is_change, position, nf, key_source| {
WalletSaplingOutput::from_parts(
output_idx,
output.cmu,
output.ephemeral_key.clone(),
note,
is_change,
Expand Down Expand Up @@ -786,7 +785,6 @@ pub(crate) fn scan_block_with_runners<
|output_idx, output, note, is_change, position, nf, key_source| {
WalletOrchardOutput::from_parts(
output_idx,
output.cmx(),
output.ephemeral_key(),
note,
is_change,
Expand Down
20 changes: 2 additions & 18 deletions zcash_client_backend/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ impl KeySource {
/// [`OutputDescription`]: sapling::bundle::OutputDescription
pub struct WalletSaplingOutput {
index: usize,
cmu: sapling::note::ExtractedNoteCommitment,
ephemeral_key: EphemeralKeyBytes,
note: sapling::Note,
is_change: bool,
Expand All @@ -289,7 +288,6 @@ impl WalletSaplingOutput {
#[allow(clippy::too_many_arguments)]
pub fn from_parts(
index: usize,
cmu: sapling::note::ExtractedNoteCommitment,
ephemeral_key: EphemeralKeyBytes,
note: sapling::Note,
is_change: bool,
Expand All @@ -299,7 +297,6 @@ impl WalletSaplingOutput {
) -> Self {
Self {
index,
cmu,
ephemeral_key,
note,
is_change,
Expand All @@ -313,12 +310,7 @@ impl WalletSaplingOutput {
pub fn index(&self) -> usize {
self.index
}
/// The [`sapling::note::ExtractedNoteCommitment`] for the `sapling::Note` created
/// by this output.
pub fn cmu(&self) -> &sapling::note::ExtractedNoteCommitment {
&self.cmu
}
/// The [`EphemeralKeyBytes`] used in the decryption of this [`sapling::Note`].
/// The [`EphemeralKeyBytes`] of the transaction output.
pub fn ephemeral_key(&self) -> &EphemeralKeyBytes {
&self.ephemeral_key
}
Expand Down Expand Up @@ -348,7 +340,6 @@ impl WalletSaplingOutput {
#[cfg(feature = "orchard")]
pub struct WalletOrchardOutput {
index: usize,
cmx: orchard::note::ExtractedNoteCommitment,
ephemeral_key: EphemeralKeyBytes,
note: orchard::note::Note,
is_change: bool,
Expand All @@ -366,7 +357,6 @@ impl WalletOrchardOutput {
#[allow(clippy::too_many_arguments)]
pub fn from_parts(
index: usize,
cmx: orchard::note::ExtractedNoteCommitment,
ephemeral_key: EphemeralKeyBytes,
note: orchard::note::Note,
is_change: bool,
Expand All @@ -376,7 +366,6 @@ impl WalletOrchardOutput {
) -> Self {
Self {
index,
cmx,
ephemeral_key,
note,
is_change,
Expand All @@ -390,12 +379,7 @@ impl WalletOrchardOutput {
pub fn index(&self) -> usize {
self.index
}
/// The [`orchard::note::ExtractedNoteCommitment`] for the `orchard::note::Note` created by
/// the associated action.
pub fn cmx(&self) -> &orchard::note::ExtractedNoteCommitment {
&self.cmx
}
/// The [`EphemeralKeyBytes`] used in the decryption of this [`sapling::Note`].
/// The [`EphemeralKeyBytes`] of the transaction output.
pub fn ephemeral_key(&self) -> &EphemeralKeyBytes {
&self.ephemeral_key
}
Expand Down

0 comments on commit 333027b

Please sign in to comment.