Skip to content

Commit

Permalink
chore(core): Assert files exists
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarth committed Feb 19, 2024
1 parent aac393e commit 5594b3f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mopro-core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fn build_dylib(wasm_path: String, dylib_name: String) -> Result<()> {

Ok(())
}

fn build_circuit(config: &Config) -> Result<()> {
let project_dir = env::var("CARGO_MANIFEST_DIR")?;
let circuit_dir = &config.circuit.dir;
Expand All @@ -91,6 +92,17 @@ fn build_circuit(config: &Config) -> Result<()> {
circuit_dir, circuit_name
));

// TODO: Improve this to be more user-friendly
assert!(
zkey_path.exists(),
"Make sure the zkey file exists. Did you forget to run a trusted setup? Adjust prepare.sh if necessary."
);
assert!(
wasm_path.exists(),
"Make sure the wasm file exists. Did you forget to compile the circuit to wasm? Adjust prepare.sh if necessary."
);
assert!(arkzkey_path.exists(), "Make sure the arkzkey file exists. Did you forget to generate the arkzkey? Adjust prepare.sh if necessary.");

println!("cargo:warning=zkey_file: {}", zkey_path.display());
println!("cargo:warning=wasm_file: {}", wasm_path.display());
println!("cargo:warning=arkzkey_file: {}", arkzkey_path.display());
Expand Down

0 comments on commit 5594b3f

Please sign in to comment.