diff --git a/crates/nargo/tests/test_data/main_bool_arg/Prover.toml b/crates/nargo/tests/test_data/main_bool_arg/Prover.toml index 5d3628fc238..f932e0b4817 100644 --- a/crates/nargo/tests/test_data/main_bool_arg/Prover.toml +++ b/crates/nargo/tests/test_data/main_bool_arg/Prover.toml @@ -1 +1,2 @@ x = true +y = [true, false] \ No newline at end of file diff --git a/crates/nargo/tests/test_data/main_bool_arg/src/main.nr b/crates/nargo/tests/test_data/main_bool_arg/src/main.nr index 21359d019b7..91a8db03ff3 100644 --- a/crates/nargo/tests/test_data/main_bool_arg/src/main.nr +++ b/crates/nargo/tests/test_data/main_bool_arg/src/main.nr @@ -1,6 +1,8 @@ -fn main(x : bool) { +fn main(x : bool, y: [bool;2]) { if x { constrain 1 != 2; } + constrain x; + constrain y[0] != y[1]; } diff --git a/crates/noirc_abi/src/input_parser/toml.rs b/crates/noirc_abi/src/input_parser/toml.rs index 8a8a8d867ac..c3510f3db6c 100644 --- a/crates/noirc_abi/src/input_parser/toml.rs +++ b/crates/noirc_abi/src/input_parser/toml.rs @@ -60,6 +60,8 @@ enum TomlTypes { ArrayNum(Vec), // Array of hexadecimal integers ArrayString(Vec), + // Array of hexadecimal integers + ArrayBool(Vec), // Struct of TomlTypes Table(BTreeMap), } @@ -119,6 +121,18 @@ impl InputValue { InputValue::Vec(array_elements) } + TomlTypes::ArrayBool(arr_bool) => { + let array_elements = vecmap(arr_bool, |elem_bool| { + if elem_bool { + FieldElement::one() + } else { + FieldElement::zero() + } + }); + + InputValue::Vec(array_elements) + } + TomlTypes::Table(table) => { let fields = match param_type { AbiType::Struct { fields } => fields,