use super::*;
impl<N: Network> Eq for Future<N> {}
impl<N: Network> PartialEq for Future<N> {
fn eq(&self, other: &Self) -> bool {
*self.is_equal(other)
}
}
impl<N: Network> Equal<Self> for Future<N> {
type Output = Boolean<N>;
fn is_equal(&self, other: &Self) -> Self::Output {
if self.arguments.len() != other.arguments.len() {
return Boolean::new(false);
}
if !(*self.program_id.is_equal(&other.program_id) && *self.function_name.is_equal(&other.function_name)) {
return Boolean::new(false);
}
if self
.arguments
.iter()
.zip_eq(other.arguments.iter())
.all(|(argument_a, argument_b)| *argument_a.is_equal(argument_b))
{
Boolean::new(true)
} else {
Boolean::new(false)
}
}
fn is_not_equal(&self, other: &Self) -> Self::Output {
!self.is_equal(other)
}
}