File tree 1 file changed +9
-4
lines changed
crates/blockifier/src/test_utils
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ impl FeatureContract {
180
180
}
181
181
}
182
182
183
+ pub fn is_legacy ( & self ) -> bool {
184
+ matches ! ( self , Self :: LegacyTestContract )
185
+ }
186
+
183
187
/// Unique integer representing each unique contract. Used to derive "class hash" and "address".
184
188
fn get_integer_base ( self ) -> u32 {
185
189
self . get_cairo_version_bit ( )
@@ -279,15 +283,16 @@ impl FeatureContract {
279
283
cairo0_compile ( self . get_source_path ( ) , extra_arg, false )
280
284
}
281
285
CairoVersion :: Cairo1 => {
282
- let ( tag_override, cargo_arg) = match self {
283
- Self :: LegacyTestContract => (
286
+ let ( tag_override, cargo_arg) = if self . is_legacy ( ) {
287
+ (
284
288
// Legacy contract requires specific compiler tag (which is the point of
285
289
// the test contract), + to build the compiler an
286
290
// older rust version is required.
287
291
Some ( LEGACY_CONTRACT_COMPILER_TAG . into ( ) ) ,
288
292
Some ( String :: from ( "+nightly-2023-07-05" ) ) ,
289
- ) ,
290
- _ => ( None , None ) ,
293
+ )
294
+ } else {
295
+ ( None , None )
291
296
} ;
292
297
cairo1_compile ( self . get_source_path ( ) , tag_override, cargo_arg)
293
298
}
You can’t perform that action at this time.
0 commit comments