Merge pull request #137 from nuttycom/orchard_domain_for_action

Add for_action method for constructing an OrchardDomain
This commit is contained in:
Kris Nuttycombe 2021-06-30 12:07:22 -06:00 committed by GitHub
commit 541898d22b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,13 @@ pub struct OrchardDomain {
rho: Nullifier,
}
impl OrchardDomain {
/// Constructs a domain that can be used to trial-decrypt this action's output note.
pub fn for_action<T>(act: &Action<T>) -> Self {
OrchardDomain { rho: *act.nullifier() }
}
}
impl Domain for OrchardDomain {
type EphemeralSecretKey = EphemeralSecretKey;
type EphemeralPublicKey = EphemeralPublicKey;