Skip to content

Commit f93e8da

Browse files
committed
test: pico deserialization error
1 parent f114f03 commit f93e8da

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Binary file not shown.

zkvm_execution_layer/src/verifiers/pico.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,38 @@ impl ProofVerifier for PicoVerifier {
9696
#[cfg(test)]
9797
mod tests {
9898
use super::*;
99+
use std::path::PathBuf;
99100

100101
#[test]
101102
fn test_pico_verifier_name() {
102103
assert_eq!(PicoVerifier::name(), "pico");
103104
}
105+
106+
#[test]
107+
fn test_pico_verifier_with_real_proof() {
108+
// Path to the test proof file
109+
let proof_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
110+
.join("src/test_proofs/brevis_79041a5b-ee8d-49b3-8207-86c7debf8e13_542871.bin");
111+
112+
// Path to the verification key file
113+
let vk_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
114+
.join("src/verification_keys/brevis_79041a5b-ee8d-49b3-8207-86c7debf8e13.bin");
115+
116+
// Read the proof and verification key
117+
let proof_data = std::fs::read(&proof_path)
118+
.expect("Failed to read test proof file");
119+
let vk_data = std::fs::read(&vk_path)
120+
.expect("Failed to read test verification key file");
121+
122+
// Verify the proof
123+
let result = PicoVerifier::verify(&proof_data, &vk_data);
124+
125+
// Log the result for debugging
126+
eprintln!("Proof size: {} bytes", proof_data.len());
127+
eprintln!("VK size: {} bytes", vk_data.len());
128+
eprintln!("Verification result: {:?}", result);
129+
130+
// The result should be Ok with a boolean (true if valid, false if invalid)
131+
assert!(result.is_ok(), "Verification should not error: {:?}", result.err());
132+
}
104133
}

0 commit comments

Comments
 (0)