Skip to content

Commit

Permalink
chore: pass keys to save_key_to_dir as slice (#1002)
Browse files Browse the repository at this point in the history
chore: pass keys to be saved to file as slice
  • Loading branch information
TomAFrench authored Mar 17, 2023
1 parent 29b1f7d commit 98ddd35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/nargo/src/cli/fs/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use acvm::{acir::circuit::Circuit, hash_constraint_system};
use std::path::{Path, PathBuf};

pub(crate) fn save_key_to_dir<P: AsRef<Path>>(
key: Vec<u8>,
key: &[u8],
key_name: &str,
key_dir: P,
is_proving_key: bool,
Expand Down Expand Up @@ -80,8 +80,8 @@ mod tests {
// These values are not meaningful, we just need distinct values.
let pk: Vec<u8> = vec![0];
let vk: Vec<u8> = vec![1, 2];
save_key_to_dir(pk.clone(), circuit_name, &circuit_build_path, true).unwrap();
save_key_to_dir(vk.clone(), circuit_name, &circuit_build_path, false).unwrap();
save_key_to_dir(&pk, circuit_name, &circuit_build_path, true).unwrap();
save_key_to_dir(&vk, circuit_name, &circuit_build_path, false).unwrap();

save_acir_hash_to_dir(&circuit, circuit_name, &circuit_build_path);
circuit_build_path.push(circuit_name);
Expand Down
4 changes: 2 additions & 2 deletions crates/nargo/src/cli/preprocess_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub(crate) fn preprocess_with_path<P: AsRef<Path>>(
// If hash doesn't match then the circuit has been updated and keys are stale.
save_acir_hash_to_dir(circuit, key_name, &preprocess_dir);

let pk_path = save_key_to_dir(proving_key, key_name, &preprocess_dir, true)?;
let vk_path = save_key_to_dir(verification_key, key_name, preprocess_dir, false)?;
let pk_path = save_key_to_dir(&proving_key, key_name, &preprocess_dir, true)?;
let vk_path = save_key_to_dir(&verification_key, key_name, preprocess_dir, false)?;

Ok((pk_path, vk_path))
}

0 comments on commit 98ddd35

Please sign in to comment.