Merge pull request #320 from zcash/243-compact-action-nullifier

Add nullifier field to `CompactAction`
This commit is contained in:
str4d 2022-05-04 16:27:03 +01:00 committed by GitHub
commit dc89386df1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -268,8 +268,9 @@ impl<T> ShieldedOutput<OrchardDomain, ENC_CIPHERTEXT_SIZE> for Action<T> {
/// A compact Action for light clients. /// A compact Action for light clients.
pub struct CompactAction { pub struct CompactAction {
ephemeral_key: EphemeralKeyBytes, nullifier: Nullifier,
cmx: ExtractedNoteCommitment, cmx: ExtractedNoteCommitment,
ephemeral_key: EphemeralKeyBytes,
enc_ciphertext: [u8; 52], enc_ciphertext: [u8; 52],
} }
@ -282,8 +283,9 @@ impl fmt::Debug for CompactAction {
impl<T> From<&Action<T>> for CompactAction { impl<T> From<&Action<T>> for CompactAction {
fn from(action: &Action<T>) -> Self { fn from(action: &Action<T>) -> Self {
CompactAction { CompactAction {
ephemeral_key: action.ephemeral_key(), nullifier: *action.nullifier(),
cmx: *action.cmx(), cmx: *action.cmx(),
ephemeral_key: action.ephemeral_key(),
enc_ciphertext: action.encrypted_note().enc_ciphertext[..52] enc_ciphertext: action.encrypted_note().enc_ciphertext[..52]
.try_into() .try_into()
.unwrap(), .unwrap(),