use return value only when witness are all solved
@@ -142,9 +142,6 @@ pub fn solve_witness<P: AsRef<Path>>(
let backend = crate::backends::ConcreteBackend;
let solver_res = backend.solve(&mut solved_witness, compiled_program.circuit.gates.clone());
- // (over)writes verifier.toml
- export_public_inputs(rv, &solved_witness, &witness_map, abi, &program_dir)
- .map_err(CliError::from)?;
match solver_res {
GateResolution::UnsupportedOpcode(opcode) => return Err(CliError::Generic(format!(
@@ -158,6 +155,10 @@ pub fn solve_witness<P: AsRef<Path>>(
_ => unreachable!(),
}
+ // (over)writes verifier.toml
+ export_public_inputs(rv, &solved_witness, &witness_map, abi, &program_dir)
+ .map_err(CliError::from)?;
+
Ok(solved_witness)
}
