mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 07:32:26 +03:00
added const values processing for tuple and array
This commit is contained in:
parent
9808b2fa7f
commit
8542afe838
@ -103,11 +103,18 @@ impl<'a, F: PrimeField, G: GroupType<F>> ConstrainedProgram<'a, F, G> {
|
||||
|
||||
ConstrainedValue::Integer(Integer::new(&const_int))
|
||||
}
|
||||
// TODO: array and tuple values.
|
||||
// InputValue::Array(Vec<InputValue>) => ,
|
||||
// InputValue::Tuple(Vec<InputValue>),
|
||||
// TODO: rework this error to something better fitting into context.
|
||||
_ => return Err(FunctionError::input_not_found(name.to_string(), span)),
|
||||
InputValue::Array(values) => ConstrainedValue::Array(
|
||||
values
|
||||
.iter()
|
||||
.map(|x| self.parse_constant_main_function_input(_cs, _type_, name, Some(x.clone()), span))
|
||||
.collect::<Result<Vec<_>, _>>()?,
|
||||
),
|
||||
InputValue::Tuple(values) => ConstrainedValue::Tuple(
|
||||
values
|
||||
.iter()
|
||||
.map(|x| self.parse_constant_main_function_input(_cs, _type_, name, Some(x.clone()), span))
|
||||
.collect::<Result<Vec<_>, _>>()?,
|
||||
),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user