Use the `zip32::Scope` type

This commit is contained in:
Jack Grigg 2024-01-26 03:05:42 +00:00
parent c5dea4e33b
commit a55fbf1fda
2 changed files with 2 additions and 20 deletions

View File

@ -26,7 +26,7 @@ and this project adheres to Rust's notion of
### Changed
- Migrated to the `zip32` crate. The following types have been replaced by the
equivalent ones in that crate are now re-exported from there:
- `orchard::keys::DiversifierIndex`
- `orchard::keys::{DiversifierIndex, Scope}`
- `orchard::zip32::ChildIndex`
- `orchard::builder`:
- `Builder::new` now takes the bundle type to be used in bundle construction,

View File

@ -27,7 +27,7 @@ use crate::{
zip32::{self, ExtendedSpendingKey},
};
pub use ::zip32::DiversifierIndex;
pub use ::zip32::{DiversifierIndex, Scope};
const KDF_ORCHARD_PERSONALIZATION: &[u8; 16] = b"Zcash_OrchardKDF";
const ZIP32_PURPOSE: u32 = 32;
@ -288,24 +288,6 @@ impl CommitIvkRandomness {
}
}
/// The scope of a viewing key or address.
///
/// A "scope" narrows the visibility or usage to a level below "full".
///
/// Consistent usage of `Scope` enables the user to provide consistent views over a wallet
/// to other people. For example, a user can give an external [`IncomingViewingKey`] to a
/// merchant terminal, enabling it to only detect "real" transactions from customers and
/// not internal transactions from the wallet.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Scope {
/// A scope used for wallet-external operations, namely deriving addresses to give to
/// other users in order to receive funds.
External,
/// A scope used for wallet-internal operations, such as creating change notes,
/// auto-shielding, and note management.
Internal,
}
/// A key that provides the capability to view incoming and outgoing transactions.
///
/// This key is useful anywhere you need to maintain accurate balance, but do not want the