File tree Expand file tree Collapse file tree
crates/blockifier_test_utils/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,16 +79,20 @@ async fn download_cairo_package(version: &String) {
7979 info ! ( "Done." ) ;
8080}
8181
82- /// Verifies that the Cairo1 package (of the given version) is available.
83- #[ allow( dead_code) ]
84- async fn verify_cairo1_package ( version : & String , download_if_missing : bool ) {
82+ fn cairo1_package_exists ( version : & String ) -> bool {
8583 let cairo_compiler_path = starknet_compile_binary_path ( version) ;
8684 let sierra_compiler_path = starknet_sierra_compile_binary_path ( version) ;
87- if download_if_missing && ( !cairo_compiler_path. exists ( ) || !sierra_compiler_path. exists ( ) ) {
85+ cairo_compiler_path. exists ( ) && sierra_compiler_path. exists ( )
86+ }
87+
88+ /// Verifies that the Cairo1 package (of the given version) is available.
89+ /// Attempts to download it if not.
90+ #[ allow( dead_code) ]
91+ async fn verify_cairo1_package ( version : & String ) {
92+ if !cairo1_package_exists ( version) {
8893 download_cairo_package ( version) . await ;
8994 }
90- assert ! ( cairo_compiler_path. exists( ) , "Cairo compiler not found at {cairo_compiler_path:?}" ) ;
91- assert ! ( sierra_compiler_path. exists( ) , "Sierra compiler not found at {sierra_compiler_path:?}" ) ;
95+ assert ! ( cairo1_package_exists( version) ) ;
9296}
9397
9498/// Runs a command. If it has succeeded, it returns the command's output; otherwise, it panics with
You can’t perform that action at this time.
0 commit comments