From 6e420946a6db3b1ddf1602a5a1fd467f0d76a8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Mi=C5=9Btal?= <37044072+szymmis@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:41:43 +0100 Subject: [PATCH] Fix failing tests by adjusting stderr message assertions (#915) Fixes tests in https://github.com/software-mansion/scarb/actions/runs/6910525403 --- Cargo.lock | 79 ++++++++++++++++---------- Cargo.toml | 26 ++++----- scarb/tests/build.rs | 2 +- scarb/tests/build_starknet_contract.rs | 6 +- 4 files changed, 67 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1650ad4d..8698d264c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-utils", "indoc", @@ -579,7 +579,7 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-lang-defs", @@ -601,7 +601,7 @@ dependencies = [ [[package]] name = "cairo-lang-debug" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-utils", ] @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -625,7 +625,7 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -636,7 +636,7 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-utils", "good_lp", @@ -645,7 +645,7 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -658,7 +658,7 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -677,7 +677,7 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -706,7 +706,7 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -731,7 +731,7 @@ dependencies = [ [[package]] name = "cairo-lang-parser" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -750,7 +750,7 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -768,7 +768,7 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "quote", @@ -778,7 +778,7 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -791,7 +791,7 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "ark-ff", "ark-secp256k1", @@ -811,13 +811,14 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.17", + "starknet-crypto 0.6.1", "thiserror", ] [[package]] name = "cairo-lang-semantic" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -841,7 +842,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-lang-utils", @@ -865,7 +866,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -878,7 +879,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -891,7 +892,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -914,7 +915,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "assert_matches", "cairo-felt", @@ -934,7 +935,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -943,7 +944,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-felt", @@ -978,7 +979,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -993,7 +994,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "genco", "xshell", @@ -1002,7 +1003,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-felt", @@ -1028,7 +1029,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "anyhow", "cairo-felt", @@ -1049,7 +1050,7 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.3.1" -source = "git+https://github.com/starkware-libs/cairo.git?rev=af32da197956f59f2700d1ad1c9b10914e757af6#af32da197956f59f2700d1ad1c9b10914e757af6" +source = "git+https://github.com/starkware-libs/cairo?rev=2850a160c348b72d020d1464544323c0a772c6d4#2850a160c348b72d020d1464544323c0a772c6d4" dependencies = [ "env_logger", "indexmap 2.1.0", @@ -1089,7 +1090,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto", + "starknet-crypto 0.5.2", "thiserror-no-std", ] @@ -5010,6 +5011,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "starknet-crypto" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c03f5ac70f9b067f48db7d2d70bdf18ee0f731e8192b6cfa679136becfcdb0" +dependencies = [ + "crypto-bigint", + "hex", + "hmac", + "num-bigint", + "num-integer", + "num-traits 0.2.17", + "rfc6979", + "sha2", + "starknet-crypto-codegen", + "starknet-curve 0.4.0", + "starknet-ff", + "zeroize", +] + [[package]] name = "starknet-crypto-codegen" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index d5a109f4f..5ca058a5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,19 +29,19 @@ anyhow = "1" assert_fs = "1" async-trait = "0.1" axum = { version = "0.6", features = ["http2"] } -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo.git", rev = "af32da197956f59f2700d1ad1c9b10914e757af6" , features = ["env_logger"] } +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "2850a160c348b72d020d1464544323c0a772c6d4", features = ["env_logger"] } camino = { version = "1", features = ["serde1"] } cargo_metadata = ">=0.18" clap = { version = "4", features = ["derive", "env", "string"] } diff --git a/scarb/tests/build.rs b/scarb/tests/build.rs index 05d7287c6..65f374e77 100644 --- a/scarb/tests/build.rs +++ b/scarb/tests/build.rs @@ -684,6 +684,6 @@ fn edition_must_exist() { | 4 | edition = "2021" | ^^^^^^ - unknown variant `2021`, expected `2023_01` or `2023_10` + unknown variant `2021`, expected one of `2023_01`, `2023_10`, `2023_11` "#}); } diff --git a/scarb/tests/build_starknet_contract.rs b/scarb/tests/build_starknet_contract.rs index cc7c21a4b..019dad8ce 100644 --- a/scarb/tests/build_starknet_contract.rs +++ b/scarb/tests/build_starknet_contract.rs @@ -384,7 +384,7 @@ fn compile_starknet_contract_without_starknet_dep() { fn constructor(ref self: ContractState, value_: u128) { ^***********^ - error: Method `write` not found on type "". Did you import the correct trait and impl? + error: Method `write` not found on type ``. Did you import the correct trait and impl? --> [..]/lib.cairo:20:20 self.value.write(value_); ^***^ @@ -399,7 +399,7 @@ fn compile_starknet_contract_without_starknet_dep() { fn get(self: @ContractState) -> u128 { ^***********^ - error: Method `read` not found on type "". Did you import the correct trait and impl? + error: Method `read` not found on type ``. Did you import the correct trait and impl? --> [..]/lib.cairo:26:24 self.value.read() ^**^ @@ -409,7 +409,7 @@ fn compile_starknet_contract_without_starknet_dep() { fn increase(ref self: ContractState, a: u128) { ^***********^ - error: Method `write` not found on type "". Did you import the correct trait and impl? + error: Method `write` not found on type ``. Did you import the correct trait and impl? --> [..]/lib.cairo:29:24 self.value.write( self.value.read() + a ); ^***^