Skip to content

Commit d995d82

Browse files
committed
Enable proof verification test in wasm
1 parent e1545f3 commit d995d82

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
@@ -872,16 +872,14 @@ mod tests {
872872
#[cfg(target_family = "wasm")]
873873
use wasm_bindgen_test::wasm_bindgen_test as test;
874874

875-
use std::path::Path;
876-
877875
use mina_hasher::Fp;
878876
use mina_p2p_messages::{binprot::BinProtRead, v2};
879877

880-
use crate::proofs::{provers::devnet_circuit_directory, transaction::tests::panic_in_ci};
878+
use crate::proofs::transaction::tests::{fetch_file, panic_in_ci};
881879

882880
use super::*;
883881

884-
// #[test]
882+
#[test]
885883
fn test_verify_zkapp() {
886884
use mina_p2p_messages::binprot;
887885
use mina_p2p_messages::binprot::macros::{BinProtRead, BinProtWrite};
@@ -893,10 +891,6 @@ mod tests {
893891
proof: v2::PicklesProofProofsVerified2ReprStableV2,
894892
}
895893

896-
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
897-
.join(devnet_circuit_directory())
898-
.join("tests");
899-
900894
let cases = [
901895
"verify_zapp_4af39d1e141859c964fe32b4e80537d3bd8c32d75e2754c0b869738006d25251_0.binprot",
902896
"verify_zapp_dc518dc7e0859ea6ffa0cd42637cdcc9c79ab369dfb7ff44c8a89b1219f98728_0.binprot",
@@ -905,7 +899,7 @@ mod tests {
905899
];
906900

907901
for filename in cases {
908-
let Ok(file) = std::fs::read(base_dir.join(filename)) else {
902+
let Ok(file) = fetch_file(filename) else {
909903
panic_in_ci();
910904
return;
911905
};

0 commit comments

Comments
 (0)