Skip to content

Commit 19e7afc

Browse files
chore(blockifier_test_utils): split check from verify of cairo1 package
1 parent fb5bcb3 commit 19e7afc

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
@@ -82,16 +82,20 @@ async fn download_cairo_package(version: &String) {
8282
info!("Done.");
8383
}
8484

85-
/// Verifies that the Cairo1 package (of the given version) is available.
86-
#[allow(dead_code)]
87-
async fn verify_cairo1_package(version: &String, download_if_missing: bool) {
85+
fn cairo1_package_exists(version: &String) -> bool {
8886
let cairo_compiler_path = starknet_compile_binary_path(version);
8987
let sierra_compiler_path = starknet_sierra_compile_binary_path(version);
90-
if download_if_missing && (!cairo_compiler_path.exists() || !sierra_compiler_path.exists()) {
88+
cairo_compiler_path.exists() && sierra_compiler_path.exists()
89+
}
90+
91+
/// Verifies that the Cairo1 package (of the given version) is available.
92+
/// Attempts to download it if not.
93+
#[allow(dead_code)]
94+
async fn verify_cairo1_package(version: &String) {
95+
if !cairo1_package_exists(version) {
9196
download_cairo_package(version).await;
9297
}
93-
assert!(cairo_compiler_path.exists(), "Cairo compiler not found at {cairo_compiler_path:?}");
94-
assert!(sierra_compiler_path.exists(), "Sierra compiler not found at {sierra_compiler_path:?}");
98+
assert!(cairo1_package_exists(version));
9599
}
96100

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

0 commit comments

Comments
 (0)