From 1e95360a7417f6b85de1eec887819dd02bb61be3 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 30 Jun 2021 11:21:07 -0600 Subject: [PATCH] Add for_action method for constructing an OrchardDomain --- src/note_encryption.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/note_encryption.rs b/src/note_encryption.rs index 8f34d603..1570cebd 100644 --- a/src/note_encryption.rs +++ b/src/note_encryption.rs @@ -84,6 +84,12 @@ pub struct OrchardDomain { rho: Nullifier, } +impl OrchardDomain { + pub fn for_action(act: &Action) -> Self { + OrchardDomain { rho: *act.nullifier() } + } +} + impl Domain for OrchardDomain { type EphemeralSecretKey = EphemeralSecretKey; type EphemeralPublicKey = EphemeralPublicKey;