use super::*;
impl<A: Aleo> Equal<Self> for Future<A> {
type Output = Boolean<A>;
fn is_equal(&self, other: &Self) -> Self::Output {
if self.arguments.len() != other.arguments.len() {
return Boolean::constant(false);
}
let mut equal = Boolean::constant(true);
for (argument_a, argument_b) in self.arguments.iter().zip_eq(other.arguments.iter()) {
equal &= argument_a.is_equal(argument_b);
}
self.program_id.is_equal(&other.program_id) & self.function_name.is_equal(&other.function_name) & equal
}
fn is_not_equal(&self, other: &Self) -> Self::Output {
if self.arguments.len() != other.arguments.len() {
return Boolean::constant(true);
}
let mut not_equal = Boolean::constant(false);
for (argument_a, argument_b) in self.arguments.iter().zip_eq(other.arguments.iter()) {
not_equal |= argument_a.is_not_equal(argument_b);
}
self.program_id.is_not_equal(&other.program_id)
| self.function_name.is_not_equal(&other.function_name)
| not_equal
}
}