From 42a1de5a20007050fd3169b5da1cc28962dcb258 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Thu, 5 Dec 2024 09:09:21 -0700 Subject: [PATCH] Add `DiversifiableFullViewingKey::to_internal_fvk`. This is needed in order to permit spending of internal notes after the previous change to `Builder::add_spend`. --- CHANGELOG.md | 1 + src/zip32.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a6e53c..d3d7af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this library adheres to Rust's notion of - `SpendAuthorizingKey::to_bytes` - `SpendValidatingKey::to_bytes` - `sapling_crypto::value::ValueSum::to_raw` +- `sapling_crypto::zip32::DiversifiableFullViewingKey::to_internal_fvk` ### Fixed - `sapling_crypto::prover::OutputProver::prepare_circuit` now takes `esk` as an diff --git a/src/zip32.rs b/src/zip32.rs index c2b7ea6..ea744f4 100644 --- a/src/zip32.rs +++ b/src/zip32.rs @@ -705,6 +705,11 @@ impl DiversifiableFullViewingKey { &self.fvk } + /// Returns the internal [`FullViewingKey`] component of this diversifiable full viewing key. + pub fn to_internal_fvk(&self) -> FullViewingKey { + self.derive_internal().fvk + } + /// Derives a nullifier-deriving key for the provided scope. /// /// This API is provided so that nullifiers for change notes can be correctly computed.