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