From 90d1ad49c59ed2b6b45d09da24ded7836a6e1193 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 16 Jun 2023 23:25:11 +0100 Subject: [PATCH] fix: Oracle output resolution (#1740) silly fix until we use enums for foreign call results --- crates/nargo/src/ops/execute.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/nargo/src/ops/execute.rs b/crates/nargo/src/ops/execute.rs index c3b27f63600..d63ae45d3d8 100644 --- a/crates/nargo/src/ops/execute.rs +++ b/crates/nargo/src/ops/execute.rs @@ -34,9 +34,9 @@ pub fn execute_circuit( if foreign_call_wait_info.function == "oracle_print_impl" { let values = &foreign_call_wait_info.inputs[0]; println!("{:?}", values[0].to_field().to_hex()); - brillig - .foreign_call_results - .push(ForeignCallResult { values: foreign_call_wait_info.inputs }); + brillig.foreign_call_results.push(ForeignCallResult { + values: vec![vec![foreign_call_wait_info.inputs[0][0]]], + }); } else if foreign_call_wait_info.function == "oracle_print_array_impl" { let mut outputs_hex = Vec::new(); for value in foreign_call_wait_info.inputs.clone() { @@ -46,9 +46,9 @@ pub fn execute_circuit( let comma_separated_elements = outputs_hex.join(", "); let output_witnesses_string = "[".to_owned() + &comma_separated_elements + "]"; println!("{output_witnesses_string}"); - brillig - .foreign_call_results - .push(ForeignCallResult { values: foreign_call_wait_info.inputs }); + brillig.foreign_call_results.push(ForeignCallResult { + values: vec![vec![foreign_call_wait_info.inputs[0][0]]], + }); } let mut next_opcodes_for_solving = vec![Opcode::Brillig(brillig)];