diff --git a/zcash_client_sqlite/src/wallet.rs b/zcash_client_sqlite/src/wallet.rs index b75f7f0e53..650964a2fe 100644 --- a/zcash_client_sqlite/src/wallet.rs +++ b/zcash_client_sqlite/src/wallet.rs @@ -287,14 +287,15 @@ pub(crate) fn seed_matches_derived_account( ) })? == seed_fingerprint; - // Keys are not comparable with `Eq`, but addresses are, so we derive what should - // be equivalent addresses for each key and use those to check for key equality. + // `UnifiedIncomingViewingKey`s are not comparable with `Eq`, but Unified Address + // components are, so we derive corresponding addresses for each key and use + // those to check whether any components match. let uivk_match = { let usk = UnifiedSpendingKey::from_seed(params, &seed.expose_secret()[..], account_index) .map_err(|_| SqliteClientError::KeyDerivationError(account_index))?; let (seed_addr, _) = usk.to_unified_full_viewing_key().default_address(Some( - UnifiedAddressRequest::all().expect("At least one supported pool feature ie enabled."), + UnifiedAddressRequest::all().expect("At least one supported pool feature is enabled."), ))?; let (uivk_addr, _) = uivk.default_address(None)?; diff --git a/zcash_keys/src/keys.rs b/zcash_keys/src/keys.rs index fec6951e10..698294a5fd 100644 --- a/zcash_keys/src/keys.rs +++ b/zcash_keys/src/keys.rs @@ -903,9 +903,10 @@ impl UnifiedFullViewingKey { self.to_unified_incoming_viewing_key().address(j, request) } - /// Searches the diversifier space starting at diversifier index `j` for one which will - /// produce a valid diversifier, and return the Unified Address constructed using that - /// diversifier along with the index at which the valid diversifier was found. + /// Searches the diversifier space starting at diversifier index `j` for one which will produce + /// a valid diversifier, and return the Unified Address constructed using that diversifier + /// along with the index at which the valid diversifier was found. If `request` is None, the + /// address should be derived to contain a receiver for each item in this UFVK. /// /// Returns an `Err(AddressGenerationError)` if no valid diversifier exists or if the features /// required to satisfy the unified address request are not properly enabled. @@ -919,7 +920,8 @@ impl UnifiedFullViewingKey { } /// Find the Unified Address corresponding to the smallest valid diversifier index, along with - /// that index. + /// that index. If `request` is None, the address should be derived to contain a receiver for + /// each item in this UFVK. /// /// Returns an `Err(AddressGenerationError)` if no valid diversifier exists or if the features /// required to satisfy the unified address request are not properly enabled. @@ -1113,8 +1115,9 @@ impl UnifiedIncomingViewingKey { &self.orchard } - /// Attempts to derive the Unified Address for the given diversifier index and - /// receiver types. + /// Attempts to derive the Unified Address for the given diversifier index and receiver types. + /// If `request` is None, the address should be derived to contain a receiver for each item in + /// this UFVK. /// /// Returns `None` if the specified index does not produce a valid diversifier. pub fn address( @@ -1245,7 +1248,8 @@ impl UnifiedIncomingViewingKey { } /// Find the Unified Address corresponding to the smallest valid diversifier index, along with - /// that index. + /// that index. If `request` is None, the address should be derived to contain a receiver for + /// each item in this UFVK. /// /// Returns an `Err(AddressGenerationError)` if no valid diversifier exists or if the features /// required to satisfy the unified address request are not properly enabled.