From a55fbf1fda19dce9033cfec654926e0434ca4f21 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 26 Jan 2024 03:05:42 +0000 Subject: [PATCH] Use the `zip32::Scope` type --- CHANGELOG.md | 2 +- src/keys.rs | 20 +------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4976deaf..41acadb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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, diff --git a/src/keys.rs b/src/keys.rs index 8100a22c..3189e4e2 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -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