-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ZIP-244 authorizing data commitment (auth_digest)
- Loading branch information
1 parent
f09f2a9
commit 3f61277
Showing
6 changed files
with
168 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use crate::primitives::zcash_primitives::auth_digest; | ||
|
||
use super::Transaction; | ||
|
||
/// An authorizing data commitment hash as specified in [ZIP-244]. | ||
/// | ||
/// [ZIP-244]: https://zips.z.cash/zip-0244.. | ||
#[derive(Copy, Clone, Eq, PartialEq, Debug)] | ||
pub struct AuthDigest(pub [u8; 32]); | ||
|
||
impl<'a> From<&'a Transaction> for AuthDigest { | ||
/// Computes the authorizing data commitment for a transaction. | ||
/// | ||
/// # Panics | ||
/// | ||
/// If passed a pre-v5 transaction. | ||
fn from(transaction: &'a Transaction) -> Self { | ||
auth_digest(transaction) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters