ACVM
Refactor to match ACIR update
-use std::collections::BTreeMap;
+use std::{collections::BTreeMap, thread::current};
use acir::{
circuit::{Circuit, Gate},
@@ -22,25 +22,26 @@ pub fn compile(acir: Circuit, backend: BackendPointer) -> Circuit {
// Optimise the arithmetic gates by reducing them into the correct width and
// creating intermediate variables when necessary
- let num_witness = acir.num_witnesses + 1;
+ let next_witness_index = acir.current_witness_index + 1;
let mut optimised_arith_gates: Vec<_> = acir
.gates
.into_iter()
.map(|gate| match gate {
Gate::Arithmetic(arith) => {
- let arith = optimiser.optimise(arith, &mut intermediate_variables, num_witness);
+ let arith =
+ optimiser.optimise(arith, &mut intermediate_variables, next_witness_index);
Gate::Arithmetic(arith)
}
other_gates => other_gates,
})
.collect();
- let num_witnesses = acir.num_witnesses + intermediate_variables.len() as u32;
+ let current_witness_index = acir.current_witness_index + intermediate_variables.len() as u32;
for (_, gate) in intermediate_variables {
optimised_arith_gates.push(Gate::Arithmetic(gate));
}
Circuit {
- num_witnesses,
+ current_witness_index,
gates: optimised_arith_gates,
public_inputs: acir.public_inputs, // The optimiser does not add public inputs
}
