@@ -8,7 +8,9 @@ use rstest::rstest;
8
8
const CAIRO0_FEATURE_CONTRACTS_DIR : & str = "feature_contracts/cairo0" ;
9
9
const CAIRO1_FEATURE_CONTRACTS_DIR : & str = "feature_contracts/cairo1" ;
10
10
const COMPILED_CONTRACTS_SUBDIR : & str = "compiled" ;
11
- const FIX_COMMAND : & str = "FIX_FEATURE_TEST=1 cargo test -- --ignored" ;
11
+ const FIX_COMMAND : & str = "FIX_FEATURE_TEST=1 cargo test -p blockifier --test \
12
+ feature_contracts_compatibility_test --features testing -- \
13
+ --include-ignored";
12
14
13
15
// To fix Cairo0 feature contracts, first enter a python venv and install the requirements:
14
16
// ```
@@ -18,22 +20,12 @@ const FIX_COMMAND: &str = "FIX_FEATURE_TEST=1 cargo test -- --ignored";
18
20
// ```
19
21
// Then, run the FIX_COMMAND above.
20
22
21
- // This test currently doesn't support Cairo1 contracts. To fix them you'll need to compile them one
22
- // by one:
23
- // 1. Clone the [cairo repo](https://github.com/starkware-libs/cairo).
24
- // 2. Checkout the commit defined in [the root Cargo.toml](../../../../Cargo.toml).
25
- // 3. From within the compiler repo root directory, run:
26
- // ```
27
- // PREFIX=~/workspace/blockifier/crates/blockifier/feature_contracts/cairo1
28
- // CONTRACT_NAME=<contract_base_filename>
29
- // cargo run --release --bin starknet-compile -- --single-file \
30
- // $PREFIX/$CONTRACT_NAME.cairo \
31
- // $PREFIX/compiled/$CONTRACT_NAME.sierra.json
32
- // cargo run --release --bin starknet-sierra-compile \
33
- // $PREFIX/compiled/$CONTRACT_NAME.sierra.json \
34
- // $PREFIX/compiled/$CONTRACT_NAME.casm.json
35
- // ```
36
- // TODO(Gilad, 1/1/2024): New year's resolution: support Cairo1 in the test.
23
+ // To test Cairo1 feature contracts, first clone the Cairo repo and checkout the required tag.
24
+ // The repo should be located next to the sequencer repo:
25
+ // <WORKSPACE_DIR>/
26
+ // - sequencer/
27
+ // - cairo/
28
+ // Then, run the FIX_COMMAND above.
37
29
38
30
// Checks that:
39
31
// 1. `TEST_CONTRACTS` dir exists and contains only `.cairo` files and the subdirectory
@@ -130,12 +122,6 @@ fn verify_feature_contracts_match_enum() {
130
122
fn verify_feature_contracts (
131
123
#[ values( CairoVersion :: Cairo0 , CairoVersion :: Cairo1 ) ] cairo_version : CairoVersion ,
132
124
) {
133
- // TODO(Dori, 1/9/2024): Support Cairo1 contracts in the CI and remove this `if` statement.
134
- if std:: env:: var ( "CI" ) . unwrap_or ( "false" . into ( ) ) == "true"
135
- && matches ! ( cairo_version, CairoVersion :: Cairo1 )
136
- {
137
- return ;
138
- }
139
125
let fix_features = std:: env:: var ( "FIX_FEATURE_TEST" ) . is_ok ( ) ;
140
126
verify_feature_contracts_compatibility ( fix_features, cairo_version)
141
127
}
0 commit comments