diff --git a/zebra-chain/src/sapling/note/ciphertexts.rs b/zebra-chain/src/sapling/note/ciphertexts.rs index b1f8090c1..47f9309d7 100644 --- a/zebra-chain/src/sapling/note/ciphertexts.rs +++ b/zebra-chain/src/sapling/note/ciphertexts.rs @@ -7,11 +7,11 @@ use crate::serialization::{serde_helpers, SerializationError, ZcashDeserialize, /// A ciphertext component for encrypted output notes. #[derive(Deserialize, Serialize)] -pub struct EncryptedCiphertext(#[serde(with = "serde_helpers::BigArray")] pub [u8; 580]); +pub struct EncryptedNote(#[serde(with = "serde_helpers::BigArray")] pub [u8; 580]); -impl fmt::Debug for EncryptedCiphertext { +impl fmt::Debug for EncryptedNote { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_tuple("EncryptedCiphertext") + f.debug_tuple("EncryptedNote") .field(&hex::encode(&self.0[..])) .finish() } @@ -19,9 +19,9 @@ impl fmt::Debug for EncryptedCiphertext { // These impls all only exist because of array length restrictions. -impl Copy for EncryptedCiphertext {} +impl Copy for EncryptedNote {} -impl Clone for EncryptedCiphertext { +impl Clone for EncryptedNote { fn clone(&self) -> Self { let mut bytes = [0; 580]; bytes[..].copy_from_slice(&self.0[..]); @@ -29,22 +29,22 @@ impl Clone for EncryptedCiphertext { } } -impl PartialEq for EncryptedCiphertext { +impl PartialEq for EncryptedNote { fn eq(&self, other: &Self) -> bool { self.0[..] == other.0[..] } } -impl Eq for EncryptedCiphertext {} +impl Eq for EncryptedNote {} -impl ZcashSerialize for EncryptedCiphertext { +impl ZcashSerialize for EncryptedNote { fn zcash_serialize(&self, mut writer: W) -> Result<(), io::Error> { writer.write_all(&self.0[..])?; Ok(()) } } -impl ZcashDeserialize for EncryptedCiphertext { +impl ZcashDeserialize for EncryptedNote { fn zcash_deserialize(mut reader: R) -> Result { let mut bytes = [0; 580]; reader.read_exact(&mut bytes[..])?; @@ -103,13 +103,13 @@ impl ZcashDeserialize for OutCiphertext { proptest! { #[test] - fn encrypted_ciphertext_roundtrip(ec in any::()) { + fn encrypted_ciphertext_roundtrip(ec in any::()) { let mut data = Vec::new(); - ec.zcash_serialize(&mut data).expect("EncryptedCiphertext should serialize"); + ec.zcash_serialize(&mut data).expect("EncryptedNote should serialize"); - let ec2 = EncryptedCiphertext::zcash_deserialize(&data[..]).expect("randomized EncryptedCiphertext should deserialize"); + let ec2 = EncryptedNote::zcash_deserialize(&data[..]).expect("randomized EncryptedNote should deserialize"); prop_assert_eq![ec, ec2]; }