Skip to content

Commit 2b06455

Browse files
Remove panic in ci
1 parent 584f04a commit 2b06455

File tree

2 files changed

+28
-58
lines changed

2 files changed

+28
-58
lines changed

ledger/src/proofs/transaction.rs

Lines changed: 25 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4364,6 +4364,7 @@ mod tests_with_wasm {
43644364

43654365
#[cfg(test)]
43664366
pub(super) mod tests {
4367+
use core::panic;
43674368
use std::path::Path;
43684369

43694370
use ::poseidon::hash::params::MINA_ZKAPP_EVENT;
@@ -4399,13 +4400,6 @@ pub(super) mod tests {
43994400
PerformJob(mina_p2p_messages::v2::SnarkWorkerWorkerRpcsVersionedGetWorkV2TResponse),
44004401
}
44014402

4402-
pub fn panic_in_ci() {
4403-
fn is_ci() -> bool {
4404-
std::env::var("CI").is_ok()
4405-
}
4406-
assert!(!is_ci(), "missing circuit files !");
4407-
}
4408-
44094403
fn read_binprot<T, R>(mut r: R) -> T
44104404
where
44114405
T: binprot::BinProtRead,
@@ -4644,19 +4638,13 @@ pub(super) mod tests {
46444638
#[test]
46454639
#[ignore = "Failing due to circuits"]
46464640
fn test_regular_tx() {
4647-
let Ok(data) =
4648-
// std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join("request_signed.bin"))
4649-
// std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join("rampup4").join("request_payment_0_rampup4.bin"))
4650-
std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join(devnet_circuit_directory()).join("tests").join("command-0-1.bin"))
4651-
// std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join("rampup4").join("request_payment_1_rampup4.bin"))
4652-
// std::fs::read("/tmp/fee_transfer_1_rampup4.bin")
4653-
// std::fs::read("/tmp/coinbase_1_rampup4.bin")
4654-
// std::fs::read("/tmp/stake_0_rampup4.bin")
4655-
else {
4656-
eprintln!("request not found");
4657-
panic_in_ci();
4658-
return;
4659-
};
4641+
let data = std::fs::read(
4642+
Path::new(env!("CARGO_MANIFEST_DIR"))
4643+
.join(devnet_circuit_directory())
4644+
.join("tests")
4645+
.join("command-0-1.bin"),
4646+
)
4647+
.unwrap();
46604648

46614649
let (statement, tx_witness, message) = extract_request(&data);
46624650
let TransactionProver {
@@ -4771,19 +4759,13 @@ pub(super) mod tests {
47714759
#[test]
47724760
#[ignore = "Failing due to circuits"]
47734761
fn test_merge_proof() {
4774-
let Ok(data) =
4775-
// std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join("request_signed.bin"))
4776-
// std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join("rampup4").join("merge_0_rampup4.bin"))
4777-
std::fs::read(Path::new(env!("CARGO_MANIFEST_DIR")).join(devnet_circuit_directory()).join("tests").join("merge-100-0.bin"))
4778-
// std::fs::read("/tmp/minaa/mina-works-dump/merge-100-0.bin")
4779-
// std::fs::read("/tmp/fee_transfer_1_rampup4.bin")
4780-
// std::fs::read("/tmp/coinbase_1_rampup4.bin")
4781-
// std::fs::read("/tmp/stake_0_rampup4.bin")
4782-
else {
4783-
eprintln!("request not found");
4784-
panic_in_ci();
4785-
return;
4786-
};
4762+
let data = std::fs::read(
4763+
Path::new(env!("CARGO_MANIFEST_DIR"))
4764+
.join(devnet_circuit_directory())
4765+
.join("tests")
4766+
.join("merge-100-0.bin"),
4767+
)
4768+
.unwrap();
47874769

47884770
let (statement, proofs, message) = extract_merge(&data);
47894771
let TransactionProver {
@@ -4821,16 +4803,13 @@ pub(super) mod tests {
48214803
#[test]
48224804
#[ignore = "Failing due to circuits"]
48234805
fn test_proof_zkapp_sig() {
4824-
let Ok(data) = std::fs::read(
4806+
let data = std::fs::read(
48254807
Path::new(env!("CARGO_MANIFEST_DIR"))
48264808
.join(devnet_circuit_directory())
48274809
.join("tests")
48284810
.join("command-1-0.bin"),
4829-
) else {
4830-
eprintln!("request not found");
4831-
panic_in_ci();
4832-
return;
4833-
};
4811+
)
4812+
.unwrap();
48344813

48354814
let (statement, tx_witness, message) = extract_request(&data);
48364815

@@ -4867,16 +4846,13 @@ pub(super) mod tests {
48674846
#[test]
48684847
#[ignore = "Failing due to circuits"]
48694848
fn test_proof_zkapp_proof() {
4870-
let Ok(data) = std::fs::read(
4849+
let data = std::fs::read(
48714850
Path::new(env!("CARGO_MANIFEST_DIR"))
48724851
.join(devnet_circuit_directory())
48734852
.join("tests")
48744853
.join("zkapp-command-with-proof-128-1.bin"),
4875-
) else {
4876-
eprintln!("request not found");
4877-
panic_in_ci();
4878-
return;
4879-
};
4854+
)
4855+
.unwrap();
48804856

48814857
let (statement, tx_witness, message) = extract_request(&data);
48824858

@@ -4911,16 +4887,13 @@ pub(super) mod tests {
49114887
#[test]
49124888
#[ignore = "Failing due to circuits"]
49134889
fn test_block_proof() {
4914-
let Ok(data) = std::fs::read(
4890+
let data = std::fs::read(
49154891
Path::new(env!("CARGO_MANIFEST_DIR"))
49164892
.join(devnet_circuit_directory())
49174893
.join("tests")
49184894
.join("block_input-2483246-0.bin"),
4919-
) else {
4920-
eprintln!("request not found");
4921-
panic_in_ci();
4922-
return;
4923-
};
4895+
)
4896+
.unwrap();
49244897

49254898
let blockchain_input: v2::ProverExtendBlockchainInputStableV2 =
49264899
read_binprot(&mut data.as_slice());
@@ -5038,8 +5011,7 @@ pub(super) mod tests {
50385011

50395012
if !base_dir.exists() {
50405013
eprintln!("{:?} not found", base_dir);
5041-
panic_in_ci();
5042-
return;
5014+
panic!();
50435015
}
50445016

50455017
let BlockProver {

ledger/src/proofs/verification.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,14 +1033,15 @@ mod tests {
10331033
use mina_curves::pasta::Fp;
10341034
use mina_p2p_messages::{binprot::BinProtRead, v2};
10351035

1036-
use crate::proofs::{provers::devnet_circuit_directory, transaction::tests::panic_in_ci};
1036+
use crate::proofs::provers::devnet_circuit_directory;
10371037

10381038
use super::*;
10391039

10401040
#[cfg(target_family = "wasm")]
10411041
use wasm_bindgen_test::wasm_bindgen_test as test;
10421042

10431043
#[test]
1044+
#[ignore = "the file are missing"]
10441045
fn test_verify_zkapp() {
10451046
use mina_p2p_messages::{
10461047
binprot,
@@ -1066,10 +1067,7 @@ mod tests {
10661067
];
10671068

10681069
for filename in cases {
1069-
let Ok(file) = std::fs::read(base_dir.join(filename)) else {
1070-
panic_in_ci();
1071-
return;
1072-
};
1070+
let file = std::fs::read(base_dir.join(filename)).expect("file not found");
10731071

10741072
let VerifyZkapp {
10751073
vk,

0 commit comments

Comments
 (0)