Skip to content

Commit

Permalink
fix(nargo): Switch order of writing acir file and acir checksum file (#…
Browse files Browse the repository at this point in the history
…895)

switch order of writing acir file and acir checksum file
  • Loading branch information
vezenovm authored Feb 21, 2023
1 parent db5c588 commit 4fc94dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/nargo/src/cli/compile_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ fn save_acir_to_dir<P: AsRef<Path>>(
let mut circuit_path = create_named_dir(circuit_dir.as_ref(), "target");
circuit_path.push(circuit_name);

// Save a checksum of the circuit to compare against during proving and verification
let acir_hash = hash_constraint_system(circuit);
circuit_path.set_extension(ACIR_EXT.to_owned() + ".sha256");
write_to_file(hex::encode(acir_hash).as_bytes(), &circuit_path);

let mut serialized = Vec::new();
circuit.write(&mut serialized).expect("could not serialize circuit");

circuit_path.set_extension(ACIR_EXT);
write_to_file(serialized.as_slice(), &circuit_path);

// Save a checksum of the circuit to compare against during proving and verification
let acir_hash = hash_constraint_system(circuit);
circuit_path.set_extension(ACIR_EXT.to_owned() + ".sha256");
write_to_file(hex::encode(acir_hash).as_bytes(), &circuit_path);

circuit_path
}

Expand Down

0 comments on commit 4fc94dc

Please sign in to comment.