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 ( )
@@ -275,15 +279,16 @@ impl FeatureContract {
275
279
cairo0_compile ( self . get_source_path ( ) , extra_arg, false )
276
280
}
277
281
CairoVersion :: Cairo1 => {
278
- let ( tag_override, cargo_nightly_arg) = match self {
279
- Self :: LegacyTestContract => (
282
+ let ( tag_override, cargo_nightly_arg) = if self . is_legacy ( ) {
283
+ (
280
284
// Legacy contract is designed to test behavior of code compiled with a
281
285
// specific (old) compiler tag. To run the (old) compiler, older rust
282
286
// version is required.
283
287
Some ( LEGACY_CONTRACT_COMPILER_TAG . into ( ) ) ,
284
288
Some ( LEGACY_CONTRACT_RUST_TOOLCHAIN . into ( ) ) ,
285
- ) ,
286
- _ => ( None , None ) ,
289
+ )
290
+ } else {
291
+ ( None , None )
287
292
} ;
288
293
cairo1_compile ( self . get_source_path ( ) , tag_override, cargo_nightly_arg)
289
294
}
You can’t perform that action at this time.
0 commit comments