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 ( )
@@ -273,15 +277,16 @@ impl FeatureContract {
273
277
cairo0_compile ( self . get_source_path ( ) , extra_arg, false )
274
278
}
275
279
CairoVersion :: Cairo1 => {
276
- let ( tag_override, cargo_nightly_arg) = match self {
277
- Self :: LegacyTestContract => (
280
+ let ( tag_override, cargo_nightly_arg) = if self . is_legacy ( ) {
281
+ (
278
282
// Legacy contract requires specific compiler tag (which is the point of
279
283
// the test contract), + to build the compiler an
280
284
// older rust version is required.
281
285
Some ( LEGACY_CONTRACT_COMPILER_TAG . into ( ) ) ,
282
286
Some ( String :: from ( "2023-07-05" ) ) ,
283
- ) ,
284
- _ => ( None , None ) ,
287
+ )
288
+ } else {
289
+ ( None , None )
285
290
} ;
286
291
cairo1_compile ( self . get_source_path ( ) , tag_override, cargo_nightly_arg)
287
292
}
You can’t perform that action at this time.
0 commit comments