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