use super::*;
impl<N: Network> Record<N, Plaintext<N>> {
pub fn to_commitment(&self, program_id: &ProgramID<N>, record_name: &Identifier<N>) -> Result<Field<N>> {
let mut input = program_id.to_bits_le();
input.extend(record_name.to_bits_le());
input.extend(self.to_bits_le());
N::hash_bhp1024(&input)
}
}
impl<N: Network> Record<N, Ciphertext<N>> {
pub fn to_commitment(&self, _program_id: &ProgramID<N>, _record_name: &Identifier<N>) -> Result<Field<N>> {
bail!("Illegal operation: Record::to_commitment() cannot be invoked on the `Ciphertext` variant.")
}
}