From c6ff554d10b8db9f1e23090ce6146910b60e2e05 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Sat, 23 Mar 2024 10:23:55 -0600 Subject: [PATCH] Add `IncomingViewingKey::prepare` convenience method. --- CHANGELOG.md | 1 + src/keys.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99565489..496c3b3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to Rust's notion of ## [Unreleased] ### Added +- `orchard::keys::IncomingViewingKey::prepare` - `orchard::note::Rho` - `orchard::action::Action::rho` - `orchard::note_encryption::CompactAction::rho` diff --git a/src/keys.rs b/src/keys.rs index 8b85bdce..f5bae6cb 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -663,6 +663,11 @@ impl IncomingViewingKey { pub fn address(&self, d: Diversifier) -> Address { self.ivk.address(d) } + + /// Returns the [`PreparedIncomingViewingKey`] for this [`IncomingViewingKey`]. + pub fn prepare(&self) -> PreparedIncomingViewingKey { + PreparedIncomingViewingKey::new(self) + } } /// An Orchard incoming viewing key that has been precomputed for trial decryption.