Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ tracing = "0.1.40"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
mockall = "0.13.1"
rstest = "0.21"
expect-test = "1.4"

# cairo-vm
cairo-vm = { version = "=3.2.0", features = [
Expand Down
1 change: 1 addition & 0 deletions crates/privacy_prove/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ stwo = { git = "https://github.com/starkware-libs/stwo", rev = "aeceb74c", featu

[dev-dependencies]
ctor.workspace = true
expect-test.workspace = true
mockall.workspace = true
rstest.workspace = true
tracing-subscriber.workspace = true
25 changes: 25 additions & 0 deletions crates/privacy_prove/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
#[test]
fn test_privacy_bootloader_program_hash_snapshot() {
use cairo_program_runner_lib::compute_program_hash_chain;
use cairo_program_runner_lib::types::HashFunc;
use expect_test::expect;
use privacy_circuit_verify::get_privacy_bootloader_program;

let bootloader_program = get_privacy_bootloader_program().unwrap();
let stripped_program = bootloader_program.get_stripped_program().unwrap();
let program_hash = compute_program_hash_chain(&stripped_program, 0, HashFunc::Blake)
.expect("Failed to compute program hash.");

// Source code for the compiled privacy bootloader producing the following hash can be found at
// Starkware's internal main repo at commit "f65af209cc2a245a7d1c90711b49555ade65dd8c".
// Compiled with cairo-compile v0.14.2:
// cairo-compile privacy_simple_bootloader.cairo \
// --output privacy_simple_bootloader_compiled.json \
// --cairo_path </path/to/cairo-lang/src> \
// --debug_info_with_source \
// --proof_mode
let expected_hash_str =
expect!["1890025921478295787236140635548238999754587527337379830429702962129599171727"];
expected_hash_str.assert_eq(&program_hash.to_string());
}

#[cfg(feature = "slow-tests")]
pub mod slow_tests {
use std::path::PathBuf;
Expand Down
Loading