diff --git a/zebra-chain/src/notes/sapling.rs b/zebra-chain/src/notes/sapling.rs index e78bab71..788033f4 100644 --- a/zebra-chain/src/notes/sapling.rs +++ b/zebra-chain/src/notes/sapling.rs @@ -109,6 +109,15 @@ impl ZcashDeserialize for NoteCommitment { } } +impl NoteCommitment { + /// Hash Extractor for Jubjub (?) + /// + /// https://zips.z.cash/protocol/protocol.pdf#concreteextractorjubjub + pub fn extract_u(self) -> jubjub::Fq { + self.0.get_u() + } +} + /// The decrypted form of encrypted Sapling notes on the blockchain. pub struct NotePlaintext { diversifier: Diversifier, diff --git a/zebra-chain/src/transaction/tests/arbitrary.rs b/zebra-chain/src/transaction/tests/arbitrary.rs index e4aeef75..7aba6e3b 100644 --- a/zebra-chain/src/transaction/tests/arbitrary.rs +++ b/zebra-chain/src/transaction/tests/arbitrary.rs @@ -106,7 +106,7 @@ impl Arbitrary for Output { .prop_map( |(cv, cm, ephemeral_key_bytes, enc_ciphertext, out_ciphertext, zkproof)| Self { cv, - cm_u: cm.0.get_u(), + cm_u: cm.extract_u(), ephemeral_key: jubjub::AffinePoint::from_bytes(ephemeral_key_bytes).unwrap(), enc_ciphertext, out_ciphertext,