Skip to content

Commit 2f62080

Browse files
chore(blockifier_test_utils): split check from verify of cairo1 package
1 parent 2139eee commit 2f62080

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

crates/blockifier_test_utils/src/cairo_compile.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,20 @@ async fn download_cairo_package(version: &String) {
7373
info!("Done.");
7474
}
7575

76-
/// Verifies that the Cairo1 package (of the given version) is available.
77-
#[allow(dead_code)]
78-
async fn verify_cairo1_package(version: &String, download_if_missing: bool) {
76+
fn cairo1_package_exists(version: &String) -> bool {
7977
let cairo_compiler_path = starknet_compile_binary_path(version);
8078
let sierra_compiler_path = starknet_sierra_compile_binary_path(version);
81-
if download_if_missing && (!cairo_compiler_path.exists() || !sierra_compiler_path.exists()) {
79+
cairo_compiler_path.exists() && sierra_compiler_path.exists()
80+
}
81+
82+
/// Verifies that the Cairo1 package (of the given version) is available.
83+
/// Attempts to download it if not.
84+
#[allow(dead_code)]
85+
async fn verify_cairo1_package(version: &String) {
86+
if !cairo1_package_exists(version) {
8287
download_cairo_package(version).await;
8388
}
84-
assert!(cairo_compiler_path.exists(), "Cairo compiler not found at {cairo_compiler_path:?}");
85-
assert!(sierra_compiler_path.exists(), "Sierra compiler not found at {sierra_compiler_path:?}");
89+
assert!(cairo1_package_exists(version));
8690
}
8791

8892
/// Runs a command. If it has succeeded, it returns the command's output; otherwise, it panics with

0 commit comments

Comments
 (0)