Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cairo #1446

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 71 additions & 100 deletions Cargo.lock

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ members = [
"resolver" = "2"

[workspace.package]
version = "2.7.0-rc.2"
version = "2.6.4"
edition = "2021"

authors = ["Software Mansion <[email protected]>"]
Expand All @@ -35,30 +35,30 @@ anyhow = "1"
assert_fs = "1"
async-trait = "0.1"
axum = { version = "0.6", features = ["http2"] }
cairo-lang-casm = "2.7.0-rc.2"
cairo-lang-compiler = "2.7.0-rc.2"
cairo-lang-debug = "2.7.0-rc.2"
cairo-lang-defs = "2.7.0-rc.2"
cairo-lang-diagnostics = "2.7.0-rc.2"
cairo-lang-doc = "2.7.0-rc.2"
cairo-lang-filesystem = "2.7.0-rc.2"
cairo-lang-formatter = "2.7.0-rc.2"
cairo-lang-language-server = "2.7.0-rc.2"
cairo-lang-lowering = "2.7.0-rc.2"
cairo-lang-parser = "2.7.0-rc.2"
cairo-lang-project = "2.7.0-rc.2"
cairo-lang-runner = "2.7.0-rc.2"
cairo-lang-semantic = "2.7.0-rc.2"
cairo-lang-sierra = "2.7.0-rc.2"
cairo-lang-sierra-generator = "2.7.0-rc.2"
cairo-lang-sierra-to-casm = "2.7.0-rc.2"
cairo-lang-sierra-type-size = "2.7.0-rc.2"
cairo-lang-starknet = "2.7.0-rc.2"
cairo-lang-starknet-classes = "2.7.0-rc.2"
cairo-lang-syntax = "2.7.0-rc.2"
cairo-lang-test-plugin = "2.7.0-rc.2"
cairo-lang-test-runner = "2.7.0-rc.2"
cairo-lang-utils = { version = "2.7.0-rc.2", features = ["env_logger"] }
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "5474cf34e247b54f4c118a3c206d6c38b086bc0c", features = ["env_logger"] }
camino = { version = "1", features = ["serde1"] }
cargo_metadata = ">=0.18"
clap = { version = "4", features = ["derive", "env", "string"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/dependencies/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ version = "0.1.0"
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git" }

[dev-dependencies]
cairo_test = "2.7.0-rc.2"
cairo_test = "2.6.4"
2 changes: 1 addition & 1 deletion examples/hello_world/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ edition = "2023_10"
[dependencies]

[dev-dependencies]
cairo_test = "2.7.0-rc.2"
cairo_test = "2.6.4"
4 changes: 2 additions & 2 deletions examples/starknet_hello_world/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ version = "0.1.0"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.7.0-rc.2"
starknet = "2.6.4"

[dev-dependencies]
cairo_test = "2.7.0-rc.2"
cairo_test = "2.6.4"

[[target.starknet-contract]]
4 changes: 2 additions & 2 deletions examples/starknet_multiple_contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ version = "0.1.0"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.7.0-rc.2"
starknet = "2.6.4"

[dev-dependencies]
cairo_test = "2.7.0-rc.2"
cairo_test = "2.6.4"

[[target.starknet-contract]]
4 changes: 2 additions & 2 deletions examples/workspaces/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ test = "snforge"
exit_first = true

[workspace.dependencies]
cairo_test = "2.7.0-rc.2"
starknet = "2.7.0-rc.2"
cairo_test = "2.6.4"
starknet = "2.6.4"

[workspace.package]
version = "0.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ fn insert_lib_entrypoint_content_into_db(
let module_id = ModuleId::CrateRoot(main_crate_id);
let file_id = db.module_main_file(module_id).unwrap();
db.as_files_group_mut()
.override_file_content(file_id, Some(Arc::from(lib_content)));
.override_file_content(file_id, Some(Arc::new(lib_content.to_string())));

main_crate_id
}
Expand Down
2 changes: 1 addition & 1 deletion scarb/src/compiler/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn inject_virtual_wrapper_lib(db: &mut RootDatabase, unit: &CairoCompilationUnit
let file_id = db.module_main_file(module_id).unwrap();
// Inject virtual lib file wrapper.
db.as_files_group_mut()
.override_file_content(file_id, Some(Arc::from(content.as_str())));
.override_file_content(file_id, Some(Arc::new(content)));
}

Ok(())
Expand Down
6 changes: 3 additions & 3 deletions scarb/tests/build_starknet_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ fn compile_starknet_contract_without_starknet_dep() {
fn constructor(ref self: ContractState, value_: u128) {
^***********^

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.
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.
--> [..]src/lib.cairo:20:20
self.value.write(value_);
^***^
Expand All @@ -402,7 +402,7 @@ fn compile_starknet_contract_without_starknet_dep() {
fn get(self: @ContractState) -> u128 {
^***********^

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.
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.
--> [..]src/lib.cairo:26:24
self.value.read()
^**^
Expand All @@ -412,7 +412,7 @@ fn compile_starknet_contract_without_starknet_dep() {
fn increase(ref self: ContractState, a: u128) {
^***********^

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.
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.
--> [..]src/lib.cairo:29:24
self.value.write( self.value.read() + a );
^***^
Expand Down
Loading