Skip to content

Commit 4e73a75

Browse files
apollo_integration_tests: test to verify proof flow fixtures
1 parent 3386331 commit 4e73a75

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/apollo_integration_tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ futures.workspace = true
9494
metrics.workspace = true
9595
mockall.workspace = true
9696
rstest.workspace = true
97+
starknet_proof_verifier.workspace = true
9798

9899
[[bin]]
99100
name = "integration_test_proof_flow"

crates/apollo_integration_tests/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ impl TestScenario for DeployAndInvokeTxs {
232232
}
233233
}
234234

235-
fn load_proof_flow_proof_facts() -> ProofFacts {
235+
pub fn load_proof_flow_proof_facts() -> ProofFacts {
236236
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/resources/proof_flow/proof_facts.json");
237237
let json = std::fs::read_to_string(path)
238238
.expect("Failed to read proof_facts.json — run the fixture generator first");
239239
serde_json::from_str(&json).expect("Failed to parse proof_facts.json")
240240
}
241241

242-
fn load_proof_flow_proof() -> Proof {
242+
pub fn load_proof_flow_proof() -> Proof {
243243
let path = concat!(env!("CARGO_MANIFEST_DIR"), "/resources/proof_flow/proof.bin");
244244
let bytes =
245245
std::fs::read(path).expect("Failed to read proof.bin — run the fixture generator first");
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use apollo_integration_tests::utils::{load_proof_flow_proof, load_proof_flow_proof_facts};
2+
use starknet_proof_verifier::verify_proof;
3+
4+
#[test]
5+
fn proof_flow_fixtures_verify() {
6+
let proof_facts = load_proof_flow_proof_facts();
7+
let proof = load_proof_flow_proof();
8+
if let Err(err) = verify_proof(proof_facts, proof) {
9+
panic!(
10+
"Proof verification of the proof fixtures failed. The fixtures are corrupted or \
11+
stale. Rerun `./scripts/generate_proof_flow_fixtures.sh`. Underlying error: {err}"
12+
);
13+
}
14+
}

0 commit comments

Comments
 (0)