Skip to content

Commit

Permalink
remove if false for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jp4g committed Aug 2, 2023
1 parent 90c52b3 commit a2ec26e
Showing 1 changed file with 34 additions and 38 deletions.
72 changes: 34 additions & 38 deletions crates/noir_halo2_backend_pse/tests/test_pse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,49 +44,45 @@ fn evm_verify(deployment_code: Vec<u8>, instances: Vec<Vec<Fr>>, proof: Vec<u8>)

#[test]
fn test_pse_verifier_contracts_no_public_io() {
if false {
let test_program_dirs = configure_test_dirs();
// Pass in PSE Halo2 Backend as argument
install_nargo("pse_halo2_backend");
for test_program in &test_program_dirs[0..8] {
// Generate necessary files
gen_nargo_files(test_program.clone());
// Paths to relevant nargo generated files
let contract_path = format!("{}/contract/plonk_vk.sol", test_program.display());
let proof_path = format!("{}/proofs/my_test_proof.proof", test_program.display());

let yul_code = read_to_string(contract_path);
let deployment_code = compile_yul(&yul_code.unwrap());

let proof = hex::decode(read(proof_path).unwrap()).unwrap();
evm_verify(deployment_code, vec![vec![]], proof);
}
let test_program_dirs = configure_test_dirs();
// Pass in PSE Halo2 Backend as argument
install_nargo("pse_halo2_backend");
for test_program in &test_program_dirs[0..8] {
// Generate necessary files
gen_nargo_files(test_program.clone());
// Paths to relevant nargo generated files
let contract_path = format!("{}/contract/plonk_vk.sol", test_program.display());
let proof_path = format!("{}/proofs/my_test_proof.proof", test_program.display());

let yul_code = read_to_string(contract_path);
let deployment_code = compile_yul(&yul_code.unwrap());

let proof = hex::decode(read(proof_path).unwrap()).unwrap();
evm_verify(deployment_code, vec![vec![]], proof);
}
}

#[test]
fn test_pse_verifier_contracts_public_io() {
if false {
let test_program_dirs = configure_test_dirs();
// Pass in PSE Halo2 Backend as argument
install_nargo("pse_halo2_backend");
let pub_inputs = vec![vec![Fr::from(7)], vec![Fr::from(341), Fr::from(219), Fr::from(499)]];
let program_indexes = vec![8, 9];
// for test_program in &test_program_dirs[8..] {
for i in 0..2 {
// Generate necessary files
let test_program = &test_program_dirs[program_indexes[i]]; // 8, 9 are
gen_nargo_files(test_program.clone());
// Paths to relevant nargo generated files
let contract_path = format!("{}/contract/plonk_vk.sol", test_program.display());
let proof_path = format!("{}/proofs/my_test_proof.proof", test_program.display());

let yul_code = read_to_string(contract_path);
let deployment_code = compile_yul(&yul_code.unwrap());

let proof = hex::decode(read(proof_path).unwrap()).unwrap();
evm_verify(deployment_code, vec![pub_inputs[i].clone()], proof);
}
let test_program_dirs = configure_test_dirs();
// Pass in PSE Halo2 Backend as argument
install_nargo("pse_halo2_backend");
let pub_inputs = vec![vec![Fr::from(7)], vec![Fr::from(341), Fr::from(219), Fr::from(499)]];
let program_indexes = vec![8, 9];
// for test_program in &test_program_dirs[8..] {
for i in 0..2 {
// Generate necessary files
let test_program = &test_program_dirs[program_indexes[i]]; // 8, 9 are
gen_nargo_files(test_program.clone());
// Paths to relevant nargo generated files
let contract_path = format!("{}/contract/plonk_vk.sol", test_program.display());
let proof_path = format!("{}/proofs/my_test_proof.proof", test_program.display());

let yul_code = read_to_string(contract_path);
let deployment_code = compile_yul(&yul_code.unwrap());

let proof = hex::decode(read(proof_path).unwrap()).unwrap();
evm_verify(deployment_code, vec![pub_inputs[i].clone()], proof);
}
}

Expand Down

0 comments on commit a2ec26e

Please sign in to comment.