Skip to content

Commit 9963303

Browse files
committed
fix copilot
1 parent 1fec997 commit 9963303

File tree

4 files changed

+960
-5
lines changed

4 files changed

+960
-5
lines changed

groth16_verifier/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

groth16_verifier/contracts/circom_verifier/src/test.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@ fn test() {
7070
// Create the contract client
7171
let client = create_client(&env);
7272

73-
// Test Case 1: Verify the proof with the correct public output (33, copied from `data/circom/public.json`)
74-
let output = Vec::from_array(&env, [Fr::from_u256(U256::from_u32(&env, 33))]);
73+
// // Test Case 1: Verify the proof with the correct public output loaded from `data/circom/public.json`
74+
let public_json_str = include_str!("../../../data/circom/public.json");
75+
let public_signals: std::vec::Vec<std::string::String> =
76+
serde_json::from_str(public_json_str).unwrap();
77+
let expected_output: u32 = public_signals[0].parse().unwrap();
78+
let output = Vec::from_array(&env, [Fr::from_u256(U256::from_u32(&env, expected_output))]);
7579
let res = client.verify_proof(&proof, &output);
7680
assert_eq!(res, true);
7781

0 commit comments

Comments
 (0)