Skip to content

Commit 60f5cb0

Browse files
authored
Update Cairo (#1469)
1 parent 88bf935 commit 60f5cb0

File tree

11 files changed

+112
-140
lines changed

11 files changed

+112
-140
lines changed

Cargo.lock

+72-101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+25-25
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ members = [
2121
"resolver" = "2"
2222

2323
[workspace.package]
24-
version = "2.7.0-rc.4"
24+
version = "2.6.4"
2525
edition = "2021"
2626

2727
authors = ["Software Mansion <[email protected]>"]
@@ -35,30 +35,30 @@ anyhow = "1"
3535
assert_fs = "1"
3636
async-trait = "0.1"
3737
axum = { version = "0.6", features = ["http2"] }
38-
cairo-lang-casm = "2.7.0-rc.3"
39-
cairo-lang-compiler = "2.7.0-rc.3"
40-
cairo-lang-debug = "2.7.0-rc.3"
41-
cairo-lang-defs = "2.7.0-rc.3"
42-
cairo-lang-diagnostics = "2.7.0-rc.3"
43-
cairo-lang-doc = "2.7.0-rc.3"
44-
cairo-lang-filesystem = "2.7.0-rc.3"
45-
cairo-lang-formatter = "2.7.0-rc.3"
46-
cairo-lang-language-server = "2.7.0-rc.3"
47-
cairo-lang-lowering = "2.7.0-rc.3"
48-
cairo-lang-parser = "2.7.0-rc.3"
49-
cairo-lang-project = "2.7.0-rc.3"
50-
cairo-lang-runner = "2.7.0-rc.3"
51-
cairo-lang-semantic = "2.7.0-rc.3"
52-
cairo-lang-sierra = "2.7.0-rc.3"
53-
cairo-lang-sierra-generator = "2.7.0-rc.3"
54-
cairo-lang-sierra-to-casm = "2.7.0-rc.3"
55-
cairo-lang-sierra-type-size = "2.7.0-rc.3"
56-
cairo-lang-starknet = "2.7.0-rc.3"
57-
cairo-lang-starknet-classes = "2.7.0-rc.3"
58-
cairo-lang-syntax = "2.7.0-rc.3"
59-
cairo-lang-test-plugin = "2.7.0-rc.3"
60-
cairo-lang-test-runner = "2.7.0-rc.3"
61-
cairo-lang-utils = { version = "2.7.0-rc.3", features = ["env_logger"] }
38+
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
39+
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
40+
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
41+
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
42+
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
43+
cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
44+
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
45+
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
46+
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
47+
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
48+
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
49+
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
50+
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
51+
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
52+
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
53+
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
54+
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
55+
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
56+
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
57+
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
58+
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
59+
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
60+
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83" }
61+
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d0273bcc88a14c39fe61d76da7860eb25857ea83", features = ["env_logger"] }
6262
camino = { version = "1", features = ["serde1"] }
6363
cargo_metadata = ">=0.18"
6464
clap = { version = "4", features = ["derive", "env", "string"] }

examples/dependencies/Scarb.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ version = "0.1.0"
88
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git" }
99

1010
[dev-dependencies]
11-
cairo_test = "2.7.0-rc.3"
11+
cairo_test = "2.6.4"

examples/hello_world/Scarb.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ edition = "2023_10"
88
[dependencies]
99

1010
[dev-dependencies]
11-
cairo_test = "2.7.0-rc.3"
11+
cairo_test = "2.6.4"

examples/starknet_hello_world/Scarb.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ version = "0.1.0"
55
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
66

77
[dependencies]
8-
starknet = "2.7.0-rc.3"
8+
starknet = "2.6.4"
99

1010
[dev-dependencies]
11-
cairo_test = "2.7.0-rc.3"
11+
cairo_test = "2.6.4"
1212

1313
[[target.starknet-contract]]

examples/starknet_multiple_contracts/Scarb.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ version = "0.1.0"
55
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
66

77
[dependencies]
8-
starknet = "2.7.0-rc.3"
8+
starknet = "2.6.4"
99

1010
[dev-dependencies]
11-
cairo_test = "2.7.0-rc.3"
11+
cairo_test = "2.6.4"
1212

1313
[[target.starknet-contract]]

examples/workspaces/Scarb.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ test = "snforge"
1010
exit_first = true
1111

1212
[workspace.dependencies]
13-
cairo_test = "2.7.0-rc.3"
14-
starknet = "2.7.0-rc.3"
13+
cairo_test = "2.6.4"
14+
starknet = "2.6.4"
1515

1616
[workspace.package]
1717
version = "0.1.0"

extensions/scarb-snforge-test-collector/src/compilation/test_collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ fn insert_lib_entrypoint_content_into_db(
250250
let module_id = ModuleId::CrateRoot(main_crate_id);
251251
let file_id = db.module_main_file(module_id).unwrap();
252252
db.as_files_group_mut()
253-
.override_file_content(file_id, Some(Arc::from(lib_content)));
253+
.override_file_content(file_id, Some(Arc::new(lib_content.to_string())));
254254

255255
main_crate_id
256256
}

scarb/src/compiler/compilers/test.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ impl Compiler for TestCompiler {
4646
.compiler_config
4747
.unstable_add_statements_functions_debug_info,
4848
};
49-
compile_test_prepared_db(db, config, main_crate_ids, test_crate_ids)?
49+
let allow_warnings = unit.compiler_config.allow_warnings;
50+
compile_test_prepared_db(db, config, main_crate_ids, test_crate_ids, allow_warnings)?
5051
};
5152

5253
{

scarb/src/compiler/db.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn inject_virtual_wrapper_lib(db: &mut RootDatabase, unit: &CairoCompilationUnit
108108
let file_id = db.module_main_file(module_id).unwrap();
109109
// Inject virtual lib file wrapper.
110110
db.as_files_group_mut()
111-
.override_file_content(file_id, Some(Arc::from(content.as_str())));
111+
.override_file_content(file_id, Some(Arc::new(content)));
112112
}
113113

114114
Ok(())

scarb/tests/build_starknet_contract.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ fn compile_starknet_contract_without_starknet_dep() {
387387
fn constructor(ref self: ContractState, value_: u128) {
388388
^***********^
389389
390-
error: Ambiguous method call. More than one applicable trait function with a suitable self type was found: StorageMapWriteAccess::write and StoragePointerWriteAccess::write. Consider adding type annotations or explicitly refer to the impl function.
390+
error: Ambiguous method call. More than one applicable trait function with a suitable self type was found: StorageMapWriteAccessTrait::write and StoragePointerWriteAccess::write. Consider adding type annotations or explicitly refer to the impl function.
391391
--> [..]src/lib.cairo:20:20
392392
self.value.write(value_);
393393
^***^
@@ -402,7 +402,7 @@ fn compile_starknet_contract_without_starknet_dep() {
402402
fn get(self: @ContractState) -> u128 {
403403
^***********^
404404
405-
error: Ambiguous method call. More than one applicable trait function with a suitable self type was found: StorageMapReadAccess::read and StoragePointerReadAccess::read. Consider adding type annotations or explicitly refer to the impl function.
405+
error: Ambiguous method call. More than one applicable trait function with a suitable self type was found: StorageMapReadAccessTrait::read and StoragePointerReadAccess::read. Consider adding type annotations or explicitly refer to the impl function.
406406
--> [..]src/lib.cairo:26:24
407407
self.value.read()
408408
^**^
@@ -412,7 +412,7 @@ fn compile_starknet_contract_without_starknet_dep() {
412412
fn increase(ref self: ContractState, a: u128) {
413413
^***********^
414414
415-
error: Ambiguous method call. More than one applicable trait function with a suitable self type was found: StorageMapWriteAccess::write and StoragePointerWriteAccess::write. Consider adding type annotations or explicitly refer to the impl function.
415+
error: Ambiguous method call. More than one applicable trait function with a suitable self type was found: StorageMapWriteAccessTrait::write and StoragePointerWriteAccess::write. Consider adding type annotations or explicitly refer to the impl function.
416416
--> [..]src/lib.cairo:29:24
417417
self.value.write( self.value.read() + a );
418418
^***^

0 commit comments

Comments
 (0)