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