From 00aee09662f607f53eb0467818c398460ee74245 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Fri, 21 Jan 2022 14:02:51 -0700 Subject: [PATCH] Add accessors for the ExtendedPubKey wrapped by AccountPubKey --- zcash_client_backend/src/keys.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zcash_client_backend/src/keys.rs b/zcash_client_backend/src/keys.rs index 711f72b8f..6f8324fd4 100644 --- a/zcash_client_backend/src/keys.rs +++ b/zcash_client_backend/src/keys.rs @@ -113,6 +113,14 @@ pub mod transparent { .derive_public_key(KeyIndex::Normal(child_index)) .map(ExternalPubKey) } + + pub fn from_extended_pubkey(extpubkey: ExtendedPubKey) -> Self { + AccountPubKey(extpubkey) + } + + pub fn extended_pubkey(&self) -> &ExtendedPubKey { + &self.0 + } } /// A type representing a private key at the BIP-44 external child