Skip to content

Commit

Permalink
Test: add pie validity check to prove block (#383)
Browse files Browse the repository at this point in the history
* add pie validity check to prove block

* use expect instead of assert

* fix error msg

* add pie validity check to all integration tests

* fix clippy
  • Loading branch information
HermanObst committed Sep 25, 2024
1 parent fc3c379 commit 92542ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cairo-lang-starknet-classes = { version = "=2.7.1" }
cairo-lang-utils = { version = "=2.7.1" }
cairo-lang-casm = { version = "=2.7.1" }
cairo-type-derive = { version = "0.1.0", path = "crates/cairo-type-derive" }
cairo-vm = { git = "https://github.com/Moonsong-Labs/cairo-vm", branch = "notlesh/segment-arena-relocation-fix", features = ["cairo-1-hints", "extensive_hints", "mod_builtin"] }
cairo-vm = { git = "https://github.com/Moonsong-Labs/cairo-vm", rev = "56b68b50944ecb3123a168218ea7b8b8e23f9be8", features = ["cairo-1-hints", "extensive_hints", "mod_builtin"] }
clap = { version = "4.5.4", features = ["derive"] }
c-kzg = { version = "1.0.3" }
env_logger = "0.11.3"
Expand Down
6 changes: 4 additions & 2 deletions crates/bin/prove_block/tests/prove_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ use rstest::rstest;
#[tokio::test(flavor = "multi_thread")]
async fn test_prove_selected_blocks(#[case] block_number: u64) {
let endpoint = std::env::var("PATHFINDER_RPC_URL").expect("Missing PATHFINDER_RPC_URL in env");
prove_block(block_number, &endpoint, LayoutName::all_cairo)
let (pie, _output) = prove_block(block_number, &endpoint, LayoutName::all_cairo)
.await
.map_err(debug_prove_error)
.expect("Block could not be proven");
.expect("OS failed to generate Cairo Pie");

pie.run_validity_checks().expect("Cairo Pie run validity checks failed");
}
4 changes: 3 additions & 1 deletion tests/integration/common/transaction_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,9 @@ where
Err(_) => {
println!("exception:\n{:#?}", result);
}
_ => {}
Ok((pie, _output)) => {
pie.run_validity_checks().expect("Validity check failed");
}
}

result
Expand Down

0 comments on commit 92542ec

Please sign in to comment.