Skip to content

Commit 63b84ee

Browse files
committed
Enable proof verification test in wasm
1 parent 8a55a59 commit 63b84ee

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

ledger/src/proofs/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4271,7 +4271,7 @@ pub(super) mod tests {
42714271
// std::fs::read(path)
42724272
// }
42734273
// #[cfg(target_family = "wasm")]
4274-
fn fetch_file(filename: &str) -> std::io::Result<Vec<u8>> {
4274+
pub fn fetch_file(filename: &str) -> std::io::Result<Vec<u8>> {
42754275
use crate::proofs::circuit_blobs::CIRCUIT_BLOBS;
42764276
use std::io::Read;
42774277

ledger/src/proofs/verification.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -972,16 +972,14 @@ mod tests {
972972
#[cfg(target_family = "wasm")]
973973
use wasm_bindgen_test::wasm_bindgen_test as test;
974974

975-
use std::path::Path;
976-
977975
use mina_hasher::Fp;
978976
use mina_p2p_messages::{binprot::BinProtRead, v2};
979977

980-
use crate::proofs::{provers::devnet_circuit_directory, transaction::tests::panic_in_ci};
978+
use crate::proofs::transaction::tests::{fetch_file, panic_in_ci};
981979

982980
use super::*;
983981

984-
// #[test]
982+
#[test]
985983
fn test_verify_zkapp() {
986984
use mina_p2p_messages::binprot;
987985
use mina_p2p_messages::binprot::macros::{BinProtRead, BinProtWrite};
@@ -993,10 +991,6 @@ mod tests {
993991
proof: v2::PicklesProofProofsVerified2ReprStableV2,
994992
}
995993

996-
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
997-
.join(devnet_circuit_directory())
998-
.join("tests");
999-
1000994
let cases = [
1001995
"verify_zapp_4af39d1e141859c964fe32b4e80537d3bd8c32d75e2754c0b869738006d25251_0.binprot",
1002996
"verify_zapp_dc518dc7e0859ea6ffa0cd42637cdcc9c79ab369dfb7ff44c8a89b1219f98728_0.binprot",
@@ -1005,7 +999,7 @@ mod tests {
1005999
];
10061000

10071001
for filename in cases {
1008-
let Ok(file) = std::fs::read(base_dir.join(filename)) else {
1002+
let Ok(file) = fetch_file(filename) else {
10091003
panic_in_ci();
10101004
return;
10111005
};

0 commit comments

Comments
 (0)