diff --git a/brillig_bytecode/src/lib.rs b/brillig_bytecode/src/lib.rs index 882678368..4962c2f75 100644 --- a/brillig_bytecode/src/lib.rs +++ b/brillig_bytecode/src/lib.rs @@ -137,8 +137,7 @@ impl VM { current_value_index += 1 } OracleOutput::Array { start, length } => { - let array_id = - self.registers.get(RegisterMemIndex::Register(start)); + let array_id = self.registers.get(start); let heap = &mut self.memory.entry(array_id).or_default().memory_map; for (i, value) in data.output_values.iter().enumerate() { heap.insert(i, (*value).into()); @@ -690,7 +689,8 @@ mod tests { let oracle_input = OracleInput::RegisterMemIndex(RegisterMemIndex::Register(RegisterIndex(0))); - let oracle_output = OracleOutput::Array { start: RegisterIndex(3), length: 2 }; + let oracle_output = + OracleOutput::Array { start: RegisterMemIndex::Register(RegisterIndex(3)), length: 2 }; let mut oracle_data = OracleData { name: "get_notes".to_owned(), diff --git a/brillig_bytecode/src/opcodes.rs b/brillig_bytecode/src/opcodes.rs index b704f85c3..36b7d631c 100644 --- a/brillig_bytecode/src/opcodes.rs +++ b/brillig_bytecode/src/opcodes.rs @@ -126,7 +126,7 @@ pub enum OracleInput { #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum OracleOutput { RegisterIndex(RegisterIndex), - Array { start: RegisterIndex, length: usize }, + Array { start: RegisterMemIndex, length: usize }, } #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]