From b217aac442513c4b8a0dfe335615854ebd813af5 Mon Sep 17 00:00:00 2001 From: GianMarco Date: Fri, 8 Dec 2023 16:39:51 -0500 Subject: [PATCH 1/3] Pad query values (#1238) * Pad filter input * add missing case * rollback records contract * Feat: Parse value to hex * fmt --- .../graphql/src/object/inputs/where_input.rs | 17 +++++++++++++---- crates/torii/graphql/src/tests/models_test.rs | 10 +++++----- .../graphql/src/tests/types-test/Scarb.lock | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/crates/torii/graphql/src/object/inputs/where_input.rs b/crates/torii/graphql/src/object/inputs/where_input.rs index b7acfe7e6d..92821a0aac 100644 --- a/crates/torii/graphql/src/object/inputs/where_input.rs +++ b/crates/torii/graphql/src/object/inputs/where_input.rs @@ -109,8 +109,17 @@ fn parse_integer( } fn parse_string(input: ValueAccessor<'_>, type_name: &str) -> Result { - input - .string() - .map(|i| FilterValue::String(i.to_string())) - .map_err(|_| GqlError::new(format!("Expected string on field {}", type_name))) + match input.string() { + Ok(i) => match i.starts_with("0x") { + true => Ok(FilterValue::String(format!("0x{:0>64}", i.strip_prefix("0x").unwrap()))), /* safe to unwrap since we know it starts with 0x */ + false => match i.parse::() { + Ok(val) => Ok(FilterValue::String(format!("0x{:0>64x}", val))), + Err(_) => Err(GqlError::new(format!( + "Failed to parse integer value on field {}", + type_name + ))), + }, + }, + Err(_) => Err(GqlError::new(format!("Expected string on field {}", type_name))), + } } diff --git a/crates/torii/graphql/src/tests/models_test.rs b/crates/torii/graphql/src/tests/models_test.rs index 10d4ef6bbe..d28df29a2d 100644 --- a/crates/torii/graphql/src/tests/models_test.rs +++ b/crates/torii/graphql/src/tests/models_test.rs @@ -123,16 +123,16 @@ mod tests { let first_record = connection.edges.first().unwrap(); assert_eq!(first_record.node.type_u64, 3); - // NOTE: output leading zeros on hex strings are trimmed, however, we don't do this yet on - // input hex strings - let felt_str_0x5 = format!("0x{:064x}", 5); + // NOTE: Server side is gonna parse "0x5" and "5" to hexadecimal format + let felt_str_0x5 = "0x5"; + let felt_int_5 = "5"; // where filter EQ on class_hash and contract_address let records = records_model_query( &schema, &format!( "(where: {{ type_class_hash: \"{}\", type_contract_address: \"{}\" }})", - felt_str_0x5, felt_str_0x5 + felt_str_0x5, felt_int_5 ), ) .await; @@ -156,7 +156,7 @@ mod tests { // where filter LT on u256 (string) let records = records_model_query( &schema, - &format!("(where: {{ type_u256LT: \"{}\" }})", felt_str_0x5), + &format!("(where: {{ type_u256LT: \"{}\" }})", felt_int_5), ) .await; let connection: Connection = serde_json::from_value(records).unwrap(); diff --git a/crates/torii/graphql/src/tests/types-test/Scarb.lock b/crates/torii/graphql/src/tests/types-test/Scarb.lock index 048d2746c4..6a1758f1d7 100644 --- a/crates/torii/graphql/src/tests/types-test/Scarb.lock +++ b/crates/torii/graphql/src/tests/types-test/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.3.13" +version = "0.3.15" dependencies = [ "dojo_plugin", ] From a0145cd368e465b1067404460850fce05065ade6 Mon Sep 17 00:00:00 2001 From: notV4l <122404722+notV4l@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:30:10 +0100 Subject: [PATCH 2/3] display class_hash in hex, update messaging doc link (#1248) --- crates/katana/src/args.rs | 2 +- crates/katana/src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/katana/src/args.rs b/crates/katana/src/args.rs index 0bbdce35e7..070f5b6c56 100644 --- a/crates/katana/src/args.rs +++ b/crates/katana/src/args.rs @@ -63,7 +63,7 @@ pub struct KatanaArgs { #[arg(help = "Configure the messaging with an other chain.")] #[arg(long_help = "Configure the messaging to allow Katana listening/sending messages on a \ settlement chain that can be Ethereum or an other Starknet sequencer. \ - The configuration file details and examples can be found here: TODO.")] + The configuration file details and examples can be found here: https://book.dojoengine.org/toolchain/katana/reference.html#messaging")] pub messaging: Option, #[command(flatten)] diff --git a/crates/katana/src/main.rs b/crates/katana/src/main.rs index eabb82ff6d..45da67f74b 100644 --- a/crates/katana/src/main.rs +++ b/crates/katana/src/main.rs @@ -60,7 +60,7 @@ async fn main() -> Result<(), Box> { "🚀 JSON-RPC server started: {}", Style::new().red().apply_to(format!("http://{addr}")) ), - format!("{}", account_class_hash), + format!("{:#064x}", account_class_hash), ); } } @@ -102,11 +102,11 @@ PREDEPLOYED CONTRACTS | Contract | Fee Token | Address | {} -| Class Hash | {} +| Class Hash | {:#064x} | Contract | Universal Deployer | Address | {} -| Class Hash | {} +| Class Hash | {:#064x} | Contract | Account Contract | Class Hash | {} From fff037f800f111b1f5829f8502dcd95898f584d3 Mon Sep 17 00:00:00 2001 From: glihm Date: Sat, 9 Dec 2023 11:51:24 -0600 Subject: [PATCH 3/3] feat: blockifier update and bump cairo `2.4.0` (#1247) * wip: compile with latest blockifier * fix: fmt * chore: use blockifier from git * fix: fix merge typo * chore: specify v0.4.0-rc9.2 tag for blockifier * fix: add PluginSuite support * fix(sozo): add support for PluginSuite * wip(language-server): bump version to 2.4.0 * chore(language-server): bump tower_lsp * chore: comment patch on scarb * katana(core): fix tests * fix: adjust tests with cairo-lang plugin * fix(dojo-lang): adjust class hash in manifest tests * wip: check on cairo-lang dependencies * chore: fix scarb version in dojo-world * fix(dojo-lang): fix test plugin expand print * fix(sozo): fit to scarb workspace plugin suite * example: bump spawn-and-move to 2.4.0 * fix(dojo-core): update version to 2.4.0 * fix: fmt * fix(dojo-lang/sozo): fix compiler with dojo plugin and relocate scarb internal * fix(dojo-lang): run with CAIRO_FIX_TESTS * fix: clippy fmt * fix(dojo-world): replace class hash of position contract * fix(katana-rpc): ignore cairo 0 declare test for now * fix(torii): fix test hardcoded address * fix(dojo-language-server): typo * fix test * update * Revert plugin version change --------- Co-authored-by: Kariy Co-authored-by: Tarrence van As --- Cargo.lock | 1010 +++++++++++------ Cargo.toml | 56 +- crates/dojo-core/Scarb.toml | 4 +- crates/dojo-lang/Cargo.toml | 1 + crates/dojo-lang/README.md | 6 +- crates/dojo-lang/Scarb.toml | 2 +- crates/dojo-lang/src/compiler_test.rs | 19 +- crates/dojo-lang/src/inline_macros/emit.rs | 14 +- crates/dojo-lang/src/inline_macros/get.rs | 12 +- crates/dojo-lang/src/inline_macros/set.rs | 18 +- crates/dojo-lang/src/lib.rs | 4 + .../dojo-lang/src/manifest_test_data/manifest | 87 +- crates/dojo-lang/src/plugin.rs | 31 +- crates/dojo-lang/src/plugin_test.rs | 9 +- .../dojo-lang/src/plugin_test_data/introspect | 144 +-- crates/dojo-lang/src/plugin_test_data/model | 98 +- crates/dojo-lang/src/plugin_test_data/print | 60 +- crates/dojo-lang/src/plugin_test_data/system | 12 +- crates/dojo-lang/src/scarb_internal/mod.rs | 100 ++ crates/dojo-lang/src/semantics/test_data/get | 10 - crates/dojo-lang/src/semantics/test_data/set | 18 +- crates/dojo-lang/src/semantics/test_utils.rs | 32 +- crates/dojo-language-server/Cargo.toml | 4 +- .../src/bin/language_server.rs | 22 +- crates/dojo-test-utils/build.rs | 10 +- crates/dojo-world/Cargo.toml | 2 +- crates/dojo-world/src/contracts/model_test.rs | 2 +- crates/katana/core/src/backend/config.rs | 16 +- crates/katana/core/src/backend/mod.rs | 2 +- crates/katana/core/src/backend/storage.rs | 21 +- crates/katana/core/src/env.rs | 12 +- crates/katana/core/src/sequencer.rs | 13 +- crates/katana/executor/src/blockifier/mod.rs | 7 +- .../katana/executor/src/blockifier/state.rs | 9 +- .../executor/src/blockifier/transactions.rs | 38 +- .../katana/executor/src/blockifier/utils.rs | 51 +- crates/katana/rpc/src/starknet.rs | 4 +- crates/katana/src/args.rs | 4 +- crates/katana/storage/db/Cargo.toml | 2 +- crates/sozo/Cargo.toml | 1 + crates/sozo/src/commands/build.rs | 10 +- crates/sozo/src/commands/dev.rs | 6 +- crates/sozo/src/commands/migrate.rs | 7 +- crates/sozo/src/commands/mod.rs | 3 - .../sozo/src/commands/scarb_internal/mod.rs | 55 - crates/sozo/src/commands/test.rs | 28 +- crates/sozo/src/ops/migration/mod.rs | 14 +- crates/torii/graphql/src/tests/mod.rs | 2 +- .../graphql/src/tests/types-test/Scarb.lock | 3 +- examples/spawn-and-move/.tool-versions | 1 + examples/spawn-and-move/Scarb.toml | 2 +- 51 files changed, 1212 insertions(+), 886 deletions(-) create mode 100644 crates/dojo-lang/src/scarb_internal/mod.rs delete mode 100644 crates/sozo/src/commands/scarb_internal/mod.rs create mode 100644 examples/spawn-and-move/.tool-versions diff --git a/Cargo.lock b/Cargo.lock index e0c8c5a881..318961f903 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,9 +109,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -129,30 +129,30 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -350,8 +350,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.0", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] @@ -372,30 +385,30 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.5.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock", + "async-lock 3.2.0", "async-task", "concurrent-queue", - "fastrand 1.9.0", - "futures-lite", + "fastrand 2.0.1", + "futures-lite 2.1.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "9b4353121d5644cdf2beb5726ab752e79a8db1ebb52031770ec47db31d245526" dependencies = [ - "async-channel", + "async-channel 2.1.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.2.1", + "async-lock 3.2.0", "blocking", - "futures-lite", + "futures-lite 2.1.0", "once_cell", ] @@ -492,27 +505,57 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", + "polling 2.8.0", "rustix 0.37.27", "slab", "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6d3b15875ba253d1110c740755e246537483f152fa334f91abd7fe84c88b3ff" +dependencies = [ + "async-lock 3.2.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.1.0", + "parking", + "polling 3.3.1", + "rustix 0.38.27", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +dependencies = [ + "event-listener 4.0.0", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -532,15 +575,15 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -576,9 +619,9 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" [[package]] name = "async-trait" @@ -613,9 +656,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atomic-write-file" @@ -877,19 +920,23 @@ dependencies = [ [[package]] name = "blockifier" -version = "0.1.0-rc0" -source = "git+https://github.com/dojoengine/blockifier?rev=3357e69#3357e69d701e02d90766302b7d2315060ef0dbef" +version = "0.4.0-rc9.2" +source = "git+https://github.com/dojoengine/blockifier?rev=e6e9c90#e6e9c902ce699269e38aecda49dc50bd11a9bec0" dependencies = [ + "ark-ec", "ark-ff", "ark-secp256k1", + "ark-secp256r1", + "cached", "cairo-felt", "cairo-lang-casm", "cairo-lang-runner", "cairo-lang-starknet", + "cairo-lang-utils", "cairo-vm", "ctor", "derive_more", - "indexmap 1.9.3", + "indexmap 2.1.0", "itertools 0.10.5", "keccak", "log", @@ -909,17 +956,18 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.1", + "async-lock 3.2.0", "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite", - "log", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.1.0", + "piper", + "tracing", ] [[package]] @@ -1006,12 +1054,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" -[[package]] -name = "byteyarn" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7534301c0ea17abb4db06d75efc7b4b0fa360fce8e175a4330d721c71c942ff" - [[package]] name = "bzip2" version = "0.4.4" @@ -1033,6 +1075,42 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "cached" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b195e4fbc4b6862bbd065b991a34750399c119797efff72492f28a5864de8700" +dependencies = [ + "async-trait", + "cached_proc_macro", + "cached_proc_macro_types", + "futures", + "hashbrown 0.13.2", + "instant", + "once_cell", + "thiserror", + "tokio", +] + +[[package]] +name = "cached_proc_macro" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b48814962d2fd604c50d2b9433c2a41a0ab567779ee2c02f7fba6eca1221f082" +dependencies = [ + "cached_proc_macro_types", + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cached_proc_macro_types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" + [[package]] name = "cairo-felt" version = "0.8.2" @@ -1047,9 +1125,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cca7891c0df31a87740acbcda3f3c04e6516e283b67842386873f3a181fd91" +checksum = "2850dc1d46d5bfb64c5ed0bc7ccd4821e4d4c36a8f2678a897df7c2bfaefe6fc" dependencies = [ "cairo-lang-utils", "indoc 2.0.4", @@ -1064,9 +1142,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c4bd031bf62046af88e75b86f419ad7e2317c3b7ee26cbad367f2ff2f2bfa4" +checksum = "2e6360b6735eeff503c6103520fef7410ca2c5a5ae90584822baa326607721ac" dependencies = [ "anyhow", "cairo-lang-defs", @@ -1074,7 +1152,6 @@ dependencies = [ "cairo-lang-filesystem", "cairo-lang-lowering", "cairo-lang-parser", - "cairo-lang-plugins", "cairo-lang-project", "cairo-lang-semantic", "cairo-lang-sierra", @@ -1088,18 +1165,18 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954529b40c914ff089bd06b4cdfa3b51f39fb8769a6f9af92ba745e4a1300bd4" +checksum = "0c190deb7ba826a462fa7339e482d5e2df78d329435f4988b15f7752e033b5ac" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2ab80b21943392da07b2ee54f1f7e15ac783ea1567ed27bd4682774713f7ee" +checksum = "b42a34d9952b04fa0c96fafd08d170097fb5075ff81826a034ef9faa70556de8" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -1114,9 +1191,9 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07052c58dc014904bfecc6fb253a0461bbdcdd3ac41f1385ac9fba5ef9a0da61" +checksum = "c399832f9fc462cd51687a415c391ead4b99ee48c54cad5c8e1d5004ff6520c7" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1126,9 +1203,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac351e6a4af689df90119d95d8fa9441b8ad1b2eef6f4868ed7a1c1808f786c" +checksum = "d73846e0dec2a204bc429f7421020fc6a98ae48f20f0cfa2aa1091b78221d6ce" dependencies = [ "cairo-lang-utils", "good_lp", @@ -1136,9 +1213,9 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f253875f0503f13d2a15e303db4f77a932a84600787a496938d0daf687945d" +checksum = "64f15f4a10963dcd5baa0386632c5ce4136d54f93d6c71cc16a49cbcbf774ee2" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -1150,9 +1227,9 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f7455bb3e5c462929211b34241138ab3322e752168bc8b41f66abd1acb61d7" +checksum = "19ecbe94310d9b52ff654be27099c00aafb22c54857c32bc48754567114a4e09" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -1170,9 +1247,9 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62679e47cb4d7e815c1c418c26a2805c66497f7f7ddedbe0809c6d01a3643a13" +checksum = "d7d917691ac8efabf0ed76e6b7d160f2163b89ab55c8f6477a9b84d63d7fe866" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1191,7 +1268,7 @@ dependencies = [ "log", "lsp-types", "salsa", - "scarb-metadata 1.9.0", + "scarb-metadata 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_json", "tokio", @@ -1200,9 +1277,9 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa602a50c7d216beb4c261036b024b24f90ce6724d623f1b23f56076584473c" +checksum = "5547bb3e13841a840b4faad3eb7fe7c39b525220f708973b71b1b9077747758b" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1221,13 +1298,14 @@ dependencies = [ "num-traits 0.2.17", "once_cell", "salsa", + "smol_str", ] [[package]] name = "cairo-lang-parser" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25e847ef219635b837cbfd8eed797a7aa6a4b01e1775065cff67b1d5bfda1fe" +checksum = "197445f8db467e28dbeddc573047dd8f2a0ef3fcc3d1c32575162d4cf79988df" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -1245,9 +1323,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c109f0b788a95bb86cff0e3917e1ce7d75210020fc53904d2a5e3ba54728adb" +checksum = "9c3ea747577bd93e4791bdd57744dfddbc4b99ce056fffb5fd41340759642f91" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -1264,9 +1342,9 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bbbfe1934e11fe3cce4f23cdccd22341ed63af5d76e593234288dd4ba06f56" +checksum = "c8cc59c40344194d2cc825071080d887826dcf0df37de71e58fc8aa4c344bb84" dependencies = [ "cairo-lang-debug", "quote", @@ -1275,23 +1353,23 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ba814a9dd17b1341204d8e7bb67775aadebc5138a475bdf176dff0f11999cb" +checksum = "312b65dec1d0b8e1b420d7b464c0c771f18301177376432681c05c30f5ef9604" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", "serde", "smol_str", "thiserror", - "toml 0.7.8", + "toml 0.8.8", ] [[package]] name = "cairo-lang-runner" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c759ff583b3771e07338433ebc328a9c5a7c845e09e2875d24c0701a252709c9" +checksum = "a2376aa33117e2feae26ca030e8b6b5ec7c6c1edfc599885d1157d92f3fc413a" dependencies = [ "ark-ff", "ark-secp256k1", @@ -1301,7 +1379,6 @@ dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", "cairo-lang-sierra-ap-change", - "cairo-lang-sierra-gas", "cairo-lang-sierra-to-casm", "cairo-lang-sierra-type-size", "cairo-lang-starknet", @@ -1317,9 +1394,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19678648e0efec3f837c0d75b6071bc2afe5c4bc611e177381478c023b72a74c" +checksum = "7e18c57cd10bcf69b427b901ce058268d21f65f5199b33e36b72b02ba7ceff74" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1332,6 +1409,7 @@ dependencies = [ "cairo-lang-test-utils", "cairo-lang-utils", "id-arena", + "indoc 2.0.4", "itertools 0.11.0", "num-bigint", "num-traits 0.2.17", @@ -1342,9 +1420,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b7d09f0b7461701a9ba5d7a2260551b5026cd8f6efc6ca9ca270f6c0a6fd23" +checksum = "84cf029a71e0176992cc401f7f182dc92e14a51662b1576240a7ecc79efac6bc" dependencies = [ "anyhow", "cairo-lang-utils", @@ -1359,6 +1437,7 @@ dependencies = [ "regex", "salsa", "serde", + "serde_json", "sha3", "smol_str", "thiserror", @@ -1366,9 +1445,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e66740bcfadb365d488ff9c334f68cb4cb6a6cb9666ae12109fc6eee7371116" +checksum = "529ed2d8d14ef4c2d77e45db597425488e194b8ab1d3210742a1c54d78743407" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1380,9 +1459,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac27c07af11fcdc9546a9c55c1463cb871fb5b7af1daa3cdf31cfb0872da3d88" +checksum = "d0cbe3dd4f663d7df902a2f10cf52990d62f178741fe1494de51f08bb89b7aa6" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1394,9 +1473,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456cd75547a127b8f4088216a419d317c753c6b9188e944846bf3a5193c14797" +checksum = "6c5bed52b240e1546b08e075493b2df4030dba2199e019d36f52da1423f2c653" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1408,6 +1487,7 @@ dependencies = [ "cairo-lang-sierra", "cairo-lang-syntax", "cairo-lang-utils", + "indexmap 2.1.0", "itertools 0.11.0", "num-bigint", "once_cell", @@ -1417,9 +1497,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74c7c4a2df66b961a982396e0f5221d6594266aed48c76d8c22d5b0d96af5d" +checksum = "fc16661a7a78f885f6b5a4fdb3c7463d9ee3f6bca83266b4f2b956e65579ec72" dependencies = [ "assert_matches", "cairo-felt", @@ -1438,9 +1518,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7fdf2dbda71f1ed4e4020914e7494ad32db84dbc75cc8dbf05c06caef678fc8" +checksum = "9f3fa025f6bc1c8d4556c9fc4609fb6f27071470ed47eb3bd0b5f9a159e51124" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1448,9 +1528,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9217e979f11980609d13d3a5adea8438ec9345709ddfebca975cc9cd1f85201e" +checksum = "ac5523d9c5b8e7c98afb2907c2cf4821a251d94fc42d37940063a9f2adbea05f" dependencies = [ "anyhow", "cairo-felt", @@ -1479,14 +1559,15 @@ dependencies = [ "serde_json", "sha3", "smol_str", + "starknet-crypto 0.6.1", "thiserror", ] [[package]] name = "cairo-lang-syntax" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d461d88e09ba7055822eb42d6b2c2ea38a4eaa5b9e4196d8f63db48c563fb56" +checksum = "8c8e9b19fa724135353470ee3452605f82edfec17a7dd4e8388d77152ea4fbd2" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1500,9 +1581,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9615745282c0c0d3a255c2ac2665a18ae1d163c54285014d85dacda2d5e53637" +checksum = "7a50c3a5dc5d890a523122e40dac59f3a430952cec73fe7312dd266ad865f049" dependencies = [ "genco", "xshell", @@ -1510,9 +1591,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9d1225b798c61e15eaeeda9e050f818e0e5c8b15420991da5e1b8144f2093c" +checksum = "ed848115b9422014027b4c352ed6589a886e767efb4a11667de32a45be8edd52" dependencies = [ "anyhow", "cairo-felt", @@ -1528,16 +1609,18 @@ dependencies = [ "cairo-lang-starknet", "cairo-lang-syntax", "cairo-lang-utils", + "indoc 2.0.4", "itertools 0.11.0", + "num-bigint", "num-traits 0.2.17", "serde", ] [[package]] name = "cairo-lang-test-runner" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4775d0ededb8c5da1f3cc6eb4e4a8dbc77c9fde47c50acb88b1a75f9d913d6b" +checksum = "fb0cc6ebdae7e2d1aaf5a032e41b42a77090aa3c1568a4339c9f0af449eb0d07" dependencies = [ "anyhow", "cairo-felt", @@ -1557,9 +1640,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4df56b6054039aa585b53af87c350d3498016329ff0ddc94fecf5131a79191" +checksum = "41d8dfdf2e7e7db2d8eea86046870d00fbb40269c1c812ee4683580d07bfafe2" dependencies = [ "cairo-lang-utils", "colored", @@ -1569,9 +1652,9 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15edcd2fba78af9b753614885464c9b5bf6041b7decba46587c2b0babc4197ac" +checksum = "88969fe46417affe9628bd039865693431837807eb981115f02756a35f488489" dependencies = [ "env_logger", "indexmap 2.1.0", @@ -1709,9 +1792,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.10" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -1729,9 +1812,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -1859,9 +1942,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -2006,7 +2089,7 @@ dependencies = [ [[package]] name = "create-output-dir" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=0c8def3#0c8def3aa0cd94d988336340202b24bfa52fff08" +source = "git+https://github.com/software-mansion/scarb?tag=v2.4.0#cba988e685f2f9b07a8ea0b5f056009f91c6c9ed" dependencies = [ "anyhow", "core-foundation", @@ -2250,9 +2333,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.13.2" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dbbad0a7ba06a961df3cd638ab117f5d67787607f627defa65629a4ef29d576" +checksum = "cc333d47d4ec12897c2efd25031c02191ec115b4099470daeee10f8300035e0d" dependencies = [ "anyhow", "futures", @@ -2478,6 +2561,7 @@ dependencies = [ "cairo-lang-sierra-generator", "cairo-lang-starknet", "cairo-lang-syntax", + "cairo-lang-test-plugin", "cairo-lang-test-utils", "cairo-lang-utils", "camino", @@ -2507,7 +2591,7 @@ dependencies = [ ] [[package]] -name = "dojo-languge-server" +name = "dojo-language-server" version = "0.4.0-rc0" dependencies = [ "anyhow", @@ -3090,11 +3174,32 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.0", + "pin-project-lite", +] + [[package]] name = "eyre" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f656be11ddf91bd709454d15d5bd896fbaf4cc3314e69349e4d1569f5b46cd" +checksum = "8bbb8258be8305fb0237d7b295f47bb24ff1b136a535f473baf40e70468515aa" dependencies = [ "indenter", "once_cell", @@ -3145,14 +3250,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -3206,6 +3311,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -3231,10 +3351,18 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" dependencies = [ - "rustix 0.38.26", + "async-trait", + "rustix 0.38.27", + "tokio", "windows-sys 0.48.0", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -3324,6 +3452,19 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-locks" version = "0.7.1" @@ -3448,13 +3589,14 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.54.1" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6d32e74454459690d57d18ea4ebec1629936e6b130b51d12cb4a81630ac953" +checksum = "5b0dcdc9c60d66535897fa40a7ea2a635e72f99456b1d9ae86b7e170e80618cb" dependencies = [ "gix-actor", "gix-archive", "gix-attributes", + "gix-command", "gix-commitgraph", "gix-config", "gix-credentials", @@ -3506,9 +3648,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c60e982c5290897122d4e2622447f014a2dadd5a18cb73d50bb91b31645e27" +checksum = "2eadca029ef716b4378f7afb19f7ee101fde9e58ba1f1445971315ac866db417" dependencies = [ "bstr", "btoi", @@ -3520,9 +3662,9 @@ dependencies = [ [[package]] name = "gix-archive" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab71635f7fb38ad4cc7da7e98af79e3010e35b05de5cb6eb79b2da68ab93eac7" +checksum = "c9d1095b8cbc9369f1cd59dc73f7e37fab2252294265705da8bc80e42a2ecc38" dependencies = [ "bstr", "gix-date", @@ -3533,16 +3675,16 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2451665e70709ba4753b623ef97511ee98c4a73816b2c5b5df25678d607ed820" +checksum = "0f395469d38c76ec47cd1a6c5a53fbc3f13f737b96eaf7535f4e6b367e643381" dependencies = [ "bstr", - "byteyarn", "gix-glob", "gix-path", "gix-quote", "gix-trace", + "kstring", "smallvec", "thiserror", "unicode-bom", @@ -3550,36 +3692,39 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" +checksum = "d49e1a13a30d3f88be4bceae184dd13a2d3fb9ffa7515f7ed7ae771b857f4916" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" +checksum = "d411ecd9b558b0c20b3252b7e409eec48eabc41d18324954fe526bac6e2db55f" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.2.10" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" +checksum = "b3b54c1d8d63e6ef2adbd9b94d6e49ff168858510b44d3811cdd02dfacc4f0c9" dependencies = [ "bstr", + "gix-path", + "gix-trace", + "shell-words", ] [[package]] name = "gix-commitgraph" -version = "0.21.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75a975ee22cf0a002bfe9b5d5cb3d2a88e263a8a178cd7509133cff10f4df8a" +checksum = "85a7007ba021f059803afaf6f8a48872422abc20550ac12ede6ddea2936cec36" dependencies = [ "bstr", "gix-chunk", @@ -3591,9 +3736,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.30.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c171514b40487d3f677ae37efc0f45ac980e3169f23c27eb30a70b47fdf88ab5" +checksum = "0341471d55d8676e98b88e121d7065dfa4c9c5acea4b6d6ecdd2846e85cce0c3" dependencies = [ "bstr", "gix-config-value", @@ -3612,9 +3757,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" +checksum = "6419db582ea84dfb58c7e7b0af7fd62c808aa14954af2936a33f89b0f4ed018e" dependencies = [ "bitflags 2.4.1", "bstr", @@ -3625,9 +3770,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46900b884cc5af6a6c141ee741607c0c651a4e1d33614b8d888a1ba81cc0bc8a" +checksum = "513dac42450b27946bd0a0535a3a5a88e473d6522e5e3439a129cab779c88f3d" dependencies = [ "bstr", "gix-command", @@ -3635,15 +3780,16 @@ dependencies = [ "gix-path", "gix-prompt", "gix-sec", + "gix-trace", "gix-url", "thiserror", ] [[package]] name = "gix-date" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7df669639582dc7c02737642f76890b03b5544e141caba68a7d6b4eb551e0d" +checksum = "468dfbe411f335f01525a1352271727f8e7772075a93fa747260f502086b30be" dependencies = [ "bstr", "itoa", @@ -3653,21 +3799,29 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788ddb152c388206e81f36bcbb574e7ed7827c27d8fa62227b34edc333d8928c" +checksum = "8119a985887cfe68f4bdf92e51bd64bc758a73882d82fcfc03ebcb164441c85d" dependencies = [ + "bstr", + "gix-command", + "gix-filter", + "gix-fs", "gix-hash", "gix-object", + "gix-path", + "gix-tempfile", + "gix-trace", + "gix-worktree", "imara-diff", "thiserror", ] [[package]] name = "gix-discover" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69507643d75a0ea9a402fcf73ced517d2b95cc95385904ac09d03e0b952fde33" +checksum = "6fad89416ebe0b3b7df78464124e2a02417b6cd3743d48ad93df86f4d2929c07" dependencies = [ "bstr", "dunce", @@ -3680,9 +3834,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.35.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9ff423ae4983f762659040d13dd7a5defbd54b6a04ac3cc7347741cec828cd" +checksum = "4d46a4a5c6bb5bebec9c0d18b65ada20e6517dbd7cf855b87dd4bbdce3a771b2" dependencies = [ "bytes", "bytesize", @@ -3703,9 +3857,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be40d28cd41445bb6cd52c4d847d915900e5466f7433eaee6a9e0a3d1d88b08" +checksum = "6d6a5c9d8e55c364e7c226919c19c9a28be1392d6208b5008059fa94ff7e2bf0" dependencies = [ "bstr", "encoding_rs", @@ -3717,24 +3871,25 @@ dependencies = [ "gix-path", "gix-quote", "gix-trace", + "gix-utils", "smallvec", "thiserror", ] [[package]] name = "gix-fs" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09815faba62fe9b32d918b75a554686c98e43f7d48c43a80df58eb718e5c6635" +checksum = "20e86eb040f5776a5ade092282e51cdcad398adb77d948b88d17583c2ae4e107" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d76e85f11251dcf751d2c5e918a14f562db5be6f727fd24775245653e9b19d" +checksum = "5db19298c5eeea2961e5b3bf190767a2d1f09b8802aeb5f258e42276350aff19" dependencies = [ "bitflags 2.4.1", "bstr", @@ -3744,9 +3899,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1884c7b41ea0875217c1be9ce91322f90bde433e91d374d0e1276073a51ccc60" +checksum = "99c1e554a87759e672c7d2e37211e761aa390c61ffcd3753a57c51173143f3cb" dependencies = [ "faster-hex", "thiserror", @@ -3754,9 +3909,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" +checksum = "feb61880816d7ec4f0b20606b498147d480860ddd9133ba542628df2f548d3ca" dependencies = [ "gix-hash", "hashbrown 0.14.3", @@ -3765,9 +3920,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048f443a1f6b02da4205c34d2e287e3fd45d75e8e2f06cfb216630ea9bff5e3" +checksum = "a215cc8cf21645bca131fcf6329d3ebd46299c47dbbe27df71bb1ca9e328b879" dependencies = [ "bstr", "gix-glob", @@ -3777,9 +3932,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54d63a9d13c13088f41f5a3accbec284e492ac8f4f707fcc307c139622e17b7" +checksum = "65ce8d03ec25de952be7d2a9adce2a4c2cb8f7fc2d4c25be91301be9707f380b" dependencies = [ "bitflags 2.4.1", "bstr", @@ -3793,16 +3948,18 @@ dependencies = [ "gix-object", "gix-traverse", "itoa", + "libc", "memmap2", + "rustix 0.38.27", "smallvec", "thiserror", ] [[package]] name = "gix-lock" -version = "10.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fc96fa8b6b6d33555021907c81eb3b27635daecf6e630630bdad44f8feaa95" +checksum = "7e5c65e6a29830a435664891ced3f3c1af010f14900226019590ee0971a22f37" dependencies = [ "gix-tempfile", "gix-utils", @@ -3811,9 +3968,9 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" +checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", @@ -3822,9 +3979,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40f00fa96e29e066ef208f5d13e0f5f95fa70c3ae4bd4f0234272ed4d708a7db" +checksum = "e2325fec0d5e6b2dd758083a6f560bfeabc73ff7a12ffe378986baf890fe9f07" dependencies = [ "bstr", "gix-actor", @@ -3834,9 +3991,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f1697bf9911c6d1b8d709b9e6ef718cb5ea5821a1b7991520125a8134448004" +checksum = "979f6accd9c051b3dd018b50adf29c0a2459edddf6105cc70b767976cd6f8014" dependencies = [ "bitflags 2.4.1", "gix-commitgraph", @@ -3850,9 +4007,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7e19616c67967374137bae83e950e9b518a9ea8a605069bd6716ada357fd6f" +checksum = "febf79c5825720c1c63fe974c7bbe695d0cb54aabad73f45671c60ce0e501e33" dependencies = [ "bstr", "btoi", @@ -3869,9 +4026,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.53.0" +version = "0.55.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6a392c6ba3a2f133cdc63120e9bc7aec81eef763db372c817de31febfe64bf" +checksum = "1fae5f971540c99c6ecc8d4368ecc9d18a9dc8b9391025c68c4399747dc93bac" dependencies = [ "arc-swap", "gix-date", @@ -3888,9 +4045,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.43.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7536203a45b31e1bc5694bbf90ba8da1b736c77040dd6a520db369f371eb1ab3" +checksum = "4569491c92446fddf373456ff360aff9a9effd627b40a70f2d7914dcd75a3205" dependencies = [ "clru", "gix-chunk", @@ -3909,20 +4066,21 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.16.6" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" +checksum = "50052c0f76c5af5acda41177fb55b60c1e484cc246ae919d8d21129cd1000a4e" dependencies = [ "bstr", "faster-hex", + "gix-trace", "thiserror", ] [[package]] name = "gix-path" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a1d370115171e3ae03c5c6d4f7d096f2981a40ddccb98dfd704c773530ba73b" +checksum = "d86d6fac2fabe07b67b7835f46d07571f68b11aa1aaecae94fe722ea4ef305e1" dependencies = [ "bstr", "gix-trace", @@ -3933,9 +4091,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e26c9b47c51be73f98d38c84494bd5fb99334c5d6fda14ef5d036d50a9e5fd" +checksum = "1dbbb92f75a38ef043c8bb830b339b38d0698d7f3746968b5fcbade7a880494d" dependencies = [ "bitflags 2.4.1", "bstr", @@ -3948,22 +4106,22 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c9a913769516f5e9d937afac206fb76428e3d7238e538845842887fda584678" +checksum = "4967b921304a5355e65a6257280eddf6e0f9ce3df111256531460adca3771305" dependencies = [ "gix-command", "gix-config-value", "parking_lot 0.12.1", - "rustix 0.38.26", + "rustix 0.38.27", "thiserror", ] [[package]] name = "gix-quote" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" +checksum = "4f84845efa535468bc79c5a87b9d29219f1da0313c8ecf0365a5daa7e72786f2" dependencies = [ "bstr", "btoi", @@ -3972,9 +4130,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.37.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e6b749660b613641769edc1954132eb8071a13c32224891686091bef078de4" +checksum = "1ac23ed741583c792f573c028785db683496a6dfcd672ec701ee54ba6a77e1ff" dependencies = [ "gix-actor", "gix-date", @@ -3993,9 +4151,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0895cb7b1e70f3c3bd4550c329e9f5caf2975f97fcd4238e05754e72208ef61e" +checksum = "76d9d3b82e1ee78fc0dc1c37ea5ea76c2dbc73f407db155f0dfcea285e583bee" dependencies = [ "bstr", "gix-hash", @@ -4007,9 +4165,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8c4b15cf2ab7a35f5bcb3ef146187c8d36df0177e171ca061913cbaaa890e89" +checksum = "fe5dd51710ce5434bc315ea30394fab483c5377276494edd79222b321a5a9544" dependencies = [ "bstr", "gix-date", @@ -4023,9 +4181,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9870c6b1032f2084567710c3b2106ac603377f8d25766b8a6b7c33e6e3ca279" +checksum = "69d4ed2493ca94a475fdf147138e1ef8bab3b6ebb56abf3d9bda1c05372ec1dd" dependencies = [ "gix-commitgraph", "gix-date", @@ -4038,9 +4196,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" +checksum = "a36ea2c5907d64a9b4b5d3cc9f430e6c30f0509646b5e38eb275ca57c5bf29e2" dependencies = [ "bitflags 2.4.1", "gix-path", @@ -4050,27 +4208,28 @@ dependencies = [ [[package]] name = "gix-status" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082801c42ba707f2407b5cce3d99b89cfa84f3794962946dc94cfdc00ae522fa" +checksum = "255a11459330a9a6ef59a5614b90c5661f04836c0f715cf68f8ca53726843d24" dependencies = [ "bstr", "filetime", "gix-features", + "gix-filter", "gix-fs", "gix-hash", "gix-index", "gix-object", "gix-path", - "gix-pathspec", + "gix-worktree", "thiserror", ] [[package]] name = "gix-submodule" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0150e82e9282d3f2ab2dd57a22f9f6c3447b9d9856e5321ac92d38e3e0e2b7" +checksum = "02a3d7f60a95bdcaeb8981663c99d1c9f4de42aab1169524c949e948989809f9" dependencies = [ "bstr", "gix-config", @@ -4083,10 +4242,11 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "10.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ae0978f3e11dc57290ee75ac2477c815bca1ce2fa7ed5dc5f16db067410ac4d" +checksum = "388dd29114a86ec69b28d1e26d6d63a662300ecf61ab3f4cc578f7d7dc9e7e23" dependencies = [ + "dashmap", "gix-fs", "libc", "once_cell", @@ -4098,15 +4258,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" +checksum = "b686a35799b53a9825575ca3f06481d0a053a409c4d97ffcf5ddd67a8760b497" [[package]] name = "gix-traverse" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ef04ab3643acba289b5cedd25d6f53c0430770b1d689d1d654511e6fb81ba0" +checksum = "df2112088122a0206592c84fbd42020db63b2ccaed66a0293779f2e5fbf80474" dependencies = [ "gix-commitgraph", "gix-date", @@ -4120,9 +4280,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.24.0" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6125ecf46e8c68bf7202da6cad239831daebf0247ffbab30210d72f3856e420f" +checksum = "0c427a1a11ccfa53a4a2da47d9442c2241deee63a154bc15cc14b8312fbc4005" dependencies = [ "bstr", "gix-features", @@ -4134,18 +4294,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" +checksum = "9f82c41937f00e15a1f6cb0b55307f0ca1f77f4407ff2bf440be35aa688c6a3e" dependencies = [ "fastrand 2.0.1", ] [[package]] name = "gix-validate" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05cab2b03a45b866156e052aa38619f4ece4adcb2f79978bfc249bc3b21b8c5" +checksum = "75b7d8e4274be69f284bbc7e6bb2ccf7065dbcdeba22d8c549f2451ae426883f" dependencies = [ "bstr", "thiserror", @@ -4153,9 +4313,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5e32972801bd82d56609e6fc84efc358fa1f11f25c5e83b7807ee2280f14fe" +checksum = "7f1d0ae01dee14abe8c8117d78d7518f9a507de2dc4522546fbf4c444e9860b4" dependencies = [ "bstr", "gix-attributes", @@ -4171,9 +4331,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3aeb06960f2c5ac9e4cdb6b38eb3c2b99d5e525e68285fef21ed17dfbd597ad" +checksum = "afef3c1cfe610ccfbca391515a1254662a648ce2635c9f60511eb1feb751fa01" dependencies = [ "bstr", "gix-features", @@ -4191,9 +4351,9 @@ dependencies = [ [[package]] name = "gix-worktree-stream" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89fe93a12e45cc3ad6ba429a7dd7506b03d7d406374a65ad9998b5cb2627569" +checksum = "3c783c269ed30193a00becb20209aa89fb48dadbaf30c9f66082472da966106c" dependencies = [ "gix-attributes", "gix-features", @@ -4454,9 +4614,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -4565,7 +4725,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.9", + "rustls 0.21.10", "tokio", "tokio-rustls 0.24.1", ] @@ -4582,6 +4742,19 @@ dependencies = [ "tokio-io-timeout", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "iana-time-zone" version = "0.1.58" @@ -4892,7 +5065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.26", + "rustix 0.38.27", "windows-sys 0.48.0", ] @@ -4914,11 +5087,20 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -5267,6 +5449,15 @@ dependencies = [ "libc", ] +[[package]] +name = "kstring" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +dependencies = [ + "static_assertions", +] + [[package]] name = "kv-log-macro" version = "1.0.7" @@ -5472,9 +5663,9 @@ checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +checksum = "deaba38d7abf1d4cca21cc89e932e542ba2b9258664d2a9ef0e61512039c9375" dependencies = [ "libc", ] @@ -5540,9 +5731,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -5635,6 +5826,24 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "ndarray" version = "0.13.1" @@ -5884,9 +6093,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -5925,12 +6134,50 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "openssl" +version = "0.10.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -6000,9 +6247,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -6305,6 +6552,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -6348,11 +6606,25 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.27", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -6565,7 +6837,7 @@ dependencies = [ "regex", "syn 1.0.109", "tempfile", - "which", + "which 4.4.2", ] [[package]] @@ -6587,7 +6859,7 @@ dependencies = [ "regex", "syn 2.0.39", "tempfile", - "which", + "which 4.4.2", ] [[package]] @@ -6721,19 +6993,19 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "redb" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "08837f9a129bde83c51953b8c96cbb3422b940166b730caa954836106eb1dfd2" dependencies = [ - "bitflags 1.3.2", + "libc", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags 1.3.2", ] @@ -6820,6 +7092,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ + "async-compression", "base64 0.21.5", "bytes", "encoding_rs", @@ -6830,25 +7103,31 @@ dependencies = [ "http-body", "hyper", "hyper-rustls 0.24.2", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.9", + "rustls 0.21.10", + "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls 0.24.1", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots", "winreg", @@ -6856,8 +7135,8 @@ dependencies = [ [[package]] name = "reth-libmdbx" -version = "0.1.0-alpha.12" -source = "git+https://github.com/paradigmxyz/reth.git#6f7d6d50160e0dbb84de5b74f9794e14cc04406b" +version = "0.1.0-alpha.13" +source = "git+https://github.com/paradigmxyz/reth.git#cf5006108c5ed2b774f09fbf02a694ec67e95ba0" dependencies = [ "bitflags 2.4.1", "byteorder", @@ -6871,8 +7150,8 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" -version = "0.1.0-alpha.12" -source = "git+https://github.com/paradigmxyz/reth.git#6f7d6d50160e0dbb84de5b74f9794e14cc04406b" +version = "0.1.0-alpha.13" +source = "git+https://github.com/paradigmxyz/reth.git#cf5006108c5ed2b774f09fbf02a694ec67e95ba0" dependencies = [ "bindgen", "cc", @@ -6906,9 +7185,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -7012,9 +7291,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "bfeae074e687625746172d639330f1de242a178bf3189b51e35a7a21573513ac" dependencies = [ "bitflags 2.4.1", "errno", @@ -7037,12 +7316,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.6", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -7074,7 +7353,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7175,8 +7454,8 @@ dependencies = [ [[package]] name = "scarb" -version = "2.3.1" -source = "git+https://github.com/software-mansion/scarb?rev=0c8def3#0c8def3aa0cd94d988336340202b24bfa52fff08" +version = "2.4.0" +source = "git+https://github.com/software-mansion/scarb?tag=v2.4.0#cba988e685f2f9b07a8ea0b5f056009f91c6c9ed" dependencies = [ "anyhow", "async-trait", @@ -7200,18 +7479,21 @@ dependencies = [ "directories", "dunce", "fs4", + "fs_extra", "futures", "gix", "glob", "ignore", "include_dir", "indoc 2.0.4", - "itertools 0.11.0", + "itertools 0.12.0", "once_cell", "pathdiff", "petgraph", + "redb", + "reqwest", "scarb-build-metadata", - "scarb-metadata 1.8.0", + "scarb-metadata 1.9.0 (git+https://github.com/software-mansion/scarb?tag=v2.4.0)", "scarb-ui", "semver", "serde", @@ -7226,35 +7508,35 @@ dependencies = [ "thiserror", "tokio", "toml 0.8.8", - "toml_edit 0.20.7", + "toml_edit 0.21.0", "tracing", - "tracing-log 0.1.4", + "tracing-log 0.2.0", "tracing-subscriber", "typed-builder", "url", "walkdir", - "which", + "which 5.0.0", "windows-sys 0.48.0", "xxhash-rust", "zip", - "zstd 0.12.4", + "zstd 0.13.0", ] [[package]] name = "scarb-build-metadata" -version = "2.3.1" -source = "git+https://github.com/software-mansion/scarb?rev=0c8def3#0c8def3aa0cd94d988336340202b24bfa52fff08" +version = "2.4.0" +source = "git+https://github.com/software-mansion/scarb?tag=v2.4.0#cba988e685f2f9b07a8ea0b5f056009f91c6c9ed" dependencies = [ "cargo_metadata", ] [[package]] name = "scarb-metadata" -version = "1.8.0" -source = "git+https://github.com/software-mansion/scarb?rev=0c8def3#0c8def3aa0cd94d988336340202b24bfa52fff08" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf294b35e5abed4510b98150fbdfad402111cb05532b38d8569a1c3edea6d1a6" dependencies = [ "camino", - "derive_builder", "semver", "serde", "serde_json", @@ -7264,10 +7546,10 @@ dependencies = [ [[package]] name = "scarb-metadata" version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf294b35e5abed4510b98150fbdfad402111cb05532b38d8569a1c3edea6d1a6" +source = "git+https://github.com/software-mansion/scarb?tag=v2.4.0#cba988e685f2f9b07a8ea0b5f056009f91c6c9ed" dependencies = [ "camino", + "derive_builder", "semver", "serde", "serde_json", @@ -7276,15 +7558,15 @@ dependencies = [ [[package]] name = "scarb-ui" -version = "0.1.0" -source = "git+https://github.com/software-mansion/scarb?rev=0c8def3#0c8def3aa0cd94d988336340202b24bfa52fff08" +version = "0.1.2" +source = "git+https://github.com/software-mansion/scarb?tag=v2.4.0#cba988e685f2f9b07a8ea0b5f056009f91c6c9ed" dependencies = [ "anyhow", "camino", "clap", "console", "indicatif", - "scarb-metadata 1.8.0", + "scarb-metadata 1.9.0 (git+https://github.com/software-mansion/scarb?tag=v2.4.0)", "serde", "serde_json", ] @@ -7353,7 +7635,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7643,6 +7925,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shlex" version = "1.2.0" @@ -7728,9 +8016,9 @@ dependencies = [ [[package]] name = "snapbox" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b377c0b6e4715c116473d8e40d51e3fa5b0a2297ca9b2a931ba800667b259ed" +checksum = "c4f1976ee8fd1be27d5f72c98be0aac4397a882a4736935d47418a5fbbd12042" dependencies = [ "anstream", "anstyle", @@ -7815,6 +8103,7 @@ dependencies = [ "cairo-lang-starknet", "cairo-lang-test-plugin", "cairo-lang-test-runner", + "cairo-lang-utils", "camino", "clap", "clap-verbosity-flag", @@ -7880,11 +8169,11 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ - "itertools 0.11.0", + "itertools 0.12.0", "nom", "unicode_categories", ] @@ -7909,7 +8198,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" dependencies = [ "ahash 0.8.6", - "async-io", + "async-io 1.13.0", "async-std", "atoi", "byteorder", @@ -7919,7 +8208,7 @@ dependencies = [ "crossbeam-queue", "dotenvy", "either", - "event-listener", + "event-listener 2.5.3", "futures-channel", "futures-core", "futures-intrusive", @@ -8293,18 +8582,21 @@ dependencies = [ [[package]] name = "starknet_api" -version = "0.2.0" -source = "git+https://github.com/starkware-libs/starknet-api?rev=ecc9b6946ef13003da202838e4124a9ad2efabb0#ecc9b6946ef13003da202838e4124a9ad2efabb0" +version = "0.6.0-rc3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874475a79285b03525dcb6773c5b6436d0bb937de9791c43a02a682a0fcbefd4" dependencies = [ "cairo-lang-starknet", "derive_more", "hex", - "indexmap 1.9.3", + "indexmap 2.1.0", "once_cell", "primitive-types", "serde", "serde_json", "starknet-crypto 0.5.2", + "strum 0.24.1", + "strum_macros 0.24.3", "thiserror", ] @@ -8498,7 +8790,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.26", + "rustix 0.38.27", "windows-sys 0.48.0", ] @@ -8530,9 +8822,19 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test-log" -version = "0.2.13" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +dependencies = [ + "env_logger", + "test-log-macros", +] + +[[package]] +name = "test-log-macros" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66edd6b6cd810743c0c71e1d085e92b01ce6a72782032e3f794c8284fe4bcdd" +checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" dependencies = [ "proc-macro2", "quote", @@ -8646,9 +8948,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ "backtrace", "bytes", @@ -8684,6 +8986,16 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.23.4" @@ -8701,7 +9013,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.9", + "rustls 0.21.10", "tokio", ] @@ -8724,7 +9036,7 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.9", + "rustls 0.21.10", "tokio", "tokio-rustls 0.24.1", "tungstenite", @@ -8808,8 +9120,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.1.0", - "serde", - "serde_spanned", "toml_datetime", "winnow", ] @@ -9198,9 +9508,9 @@ checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-lsp" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b38fb0e6ce037835174256518aace3ca621c4f96383c56bb846cfc11b341910" +checksum = "d4ba052b54a6627628d9b3c34c176e7eda8359b7da9acd497b9f20998d118508" dependencies = [ "async-trait", "auto_impl", @@ -9221,13 +9531,13 @@ dependencies = [ [[package]] name = "tower-lsp-macros" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34723c06344244474fdde365b76aebef8050bf6be61a935b91ee9ff7c4e91157" +checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] @@ -9334,9 +9644,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -9351,7 +9661,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls 0.21.9", + "rustls 0.21.10", "sha1", "thiserror", "url", @@ -9360,18 +9670,18 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.16.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34085c17941e36627a879208083e25d357243812c30e7d7387c3b954f30ade16" +checksum = "e47c0496149861b7c95198088cbf36645016b1a0734cf350c50e2a38e070f38a" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.16.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03ca4cb38206e2bef0700092660bb74d696f808514dae47fa1467cbfe26e96e" +checksum = "982ee4197351b5c9782847ef5ec1fdcaf50503fb19d68f9771adae314e72b492" dependencies = [ "proc-macro2", "quote", @@ -9437,9 +9747,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-bom" @@ -9561,9 +9871,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" [[package]] name = "vcpkg" @@ -9588,9 +9898,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" @@ -9743,7 +10053,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -9762,7 +10072,20 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.26", + "rustix 0.38.27", +] + +[[package]] +name = "which" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.27", + "windows-sys 0.48.0", ] [[package]] @@ -10020,9 +10343,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" dependencies = [ "memchr", ] @@ -10103,18 +10426,18 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.28" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e" +checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.28" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b" +checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba" dependencies = [ "proc-macro2", "quote", @@ -10170,15 +10493,6 @@ dependencies = [ "zstd-safe 5.0.2+zstd.1.5.2", ] -[[package]] -name = "zstd" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" -dependencies = [ - "zstd-safe 6.0.6", -] - [[package]] name = "zstd" version = "0.13.0" @@ -10198,16 +10512,6 @@ dependencies = [ "zstd-sys", ] -[[package]] -name = "zstd-safe" -version = "6.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" -dependencies = [ - "libc", - "zstd-sys", -] - [[package]] name = "zstd-safe" version = "7.0.0" diff --git a/Cargo.toml b/Cargo.toml index f2a26833fd..f1b8d8955f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,29 +41,29 @@ anyhow = "1.0.75" assert_matches = "1.5.0" async-trait = "0.1.68" base64 = "0.21.2" -blockifier = { git = "https://github.com/starkware-libs/blockifier" } -cairo-lang-casm = "2.3.1" -cairo-lang-compiler = "2.3.1" -cairo-lang-debug = "2.3.1" -cairo-lang-defs = "2.3.1" -cairo-lang-diagnostics = "2.3.1" -cairo-lang-filesystem = "2.3.1" -cairo-lang-formatter = "2.3.1" -cairo-lang-language-server = "2.3.1" -cairo-lang-lowering = "2.3.1" -cairo-lang-parser = "2.3.1" -cairo-lang-plugins = "2.3.1" -cairo-lang-project = "2.3.1" -cairo-lang-semantic = { version = "2.3.1", features = [ "testing" ] } -cairo-lang-sierra = "2.3.1" -cairo-lang-sierra-generator = "2.3.1" -cairo-lang-sierra-to-casm = "2.3.1" -cairo-lang-starknet = "2.3.1" -cairo-lang-syntax = "2.3.1" -cairo-lang-test-plugin = "2.3.1" -cairo-lang-test-runner = "2.3.1" -cairo-lang-test-utils = "2.3.1" -cairo-lang-utils = "2.3.1" +blockifier = { git = "https://github.com/starkware-libs/blockifier", tag = "v0.4.0-rc9.2" } +cairo-lang-casm = "2.4.0" +cairo-lang-compiler = "2.4.0" +cairo-lang-debug = "2.4.0" +cairo-lang-defs = "2.4.0" +cairo-lang-diagnostics = "2.4.0" +cairo-lang-filesystem = "2.4.0" +cairo-lang-formatter = "2.4.0" +cairo-lang-language-server = "2.4.0" +cairo-lang-lowering = "2.4.0" +cairo-lang-parser = "2.4.0" +cairo-lang-plugins = "2.4.0" +cairo-lang-project = "2.4.0" +cairo-lang-semantic = { version = "2.4.0", features = [ "testing" ] } +cairo-lang-sierra = "2.4.0" +cairo-lang-sierra-generator = "2.4.0" +cairo-lang-sierra-to-casm = "2.4.0" +cairo-lang-starknet = "2.4.0" +cairo-lang-syntax = "2.4.0" +cairo-lang-test-plugin = "2.4.0" +cairo-lang-test-runner = "2.4.0" +cairo-lang-test-utils = "2.4.0" +cairo-lang-utils = "2.4.0" cairo-vm = "0.8.2" camino = { version = "1.1.2", features = [ "serde1" ] } chrono = { version = "0.4.24", features = [ "serde" ] } @@ -87,17 +87,17 @@ parking_lot = "0.12.1" pretty_assertions = "1.2.1" rayon = "1.8.0" salsa = "0.16.1" -scarb = { git = "https://github.com/software-mansion/scarb", rev = "0c8def3" } -scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "0c8def3" } +scarb = { git = "https://github.com/software-mansion/scarb", tag = "v2.4.0" } +scarb-ui = { git = "https://github.com/software-mansion/scarb", tag = "v2.4.0" } semver = "1.0.5" serde = { version = "1.0.156", features = [ "derive" ] } serde_json = "1.0" serde_with = "2.3.1" smol_str = { version = "0.2.0", features = [ "serde" ] } -sqlx = { version = "0.7.2", features = [ "chrono", "macros", "runtime-async-std", "runtime-tokio", "sqlite", "uuid", "regexp" ] } +sqlx = { version = "0.7.2", features = [ "chrono", "macros", "regexp", "runtime-async-std", "runtime-tokio", "sqlite", "uuid" ] } starknet = "0.7.0" starknet-crypto = "0.6.1" -starknet_api = { git = "https://github.com/starkware-libs/starknet-api", rev = "ecc9b6946ef13003da202838e4124a9ad2efabb0" } +starknet_api = "0.6.0-rc3" strum = "0.25" strum_macros = "0.25" test-log = "0.2.11" @@ -126,7 +126,7 @@ wasm-tonic = { version = "0.9.2", default-features = false, features = [ "codege wasm-tonic-build = { version = "0.9.2", default-features = false, features = [ "prost" ], package = "tonic-build" } [patch."https://github.com/starkware-libs/blockifier"] -blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "3357e69" } +blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "e6e9c90" } [patch.crates-io] cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "262b7eb4b11ab165a2a936a5f914e78aa732d4a2" } diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index cf78540539..8790f62c3d 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -1,9 +1,9 @@ [package] -cairo-version = "2.3.1" +cairo-version = "2.4.0" description = "The Dojo Core library for autonomous worlds." name = "dojo" version = "0.4.0-rc0" [dependencies] dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.11" } -starknet = "2.3.1" +starknet = "2.4.0" diff --git a/crates/dojo-lang/Cargo.toml b/crates/dojo-lang/Cargo.toml index 244e81a1ef..1d1da8d84c 100644 --- a/crates/dojo-lang/Cargo.toml +++ b/crates/dojo-lang/Cargo.toml @@ -24,6 +24,7 @@ cairo-lang-semantic.workspace = true cairo-lang-sierra-generator.workspace = true cairo-lang-starknet.workspace = true cairo-lang-syntax.workspace = true +cairo-lang-test-plugin.workspace = true cairo-lang-utils.workspace = true camino.workspace = true convert_case.workspace = true diff --git a/crates/dojo-lang/README.md b/crates/dojo-lang/README.md index 2868ce5cb4..8f1f5da0b5 100644 --- a/crates/dojo-lang/README.md +++ b/crates/dojo-lang/README.md @@ -12,4 +12,8 @@ To run the tests, run: cargo test --package dojo-lang --lib -- plugin::test::expand_contract::model --exact --nocapture ``` -To regenerate, set `CAIRO_FIX_TESTS=1`. +To regenerate, set `CAIRO_FIX_TESTS=1`: + +``` +CAIRO_FIX_TESTS=1 cargo test --package dojo-lang +``` diff --git a/crates/dojo-lang/Scarb.toml b/crates/dojo-lang/Scarb.toml index d6108e0735..6824d0ffd4 100644 --- a/crates/dojo-lang/Scarb.toml +++ b/crates/dojo-lang/Scarb.toml @@ -1,5 +1,5 @@ [package] name = "dojo_plugin" -version = "0.3.11" +version = "0.4.0" [cairo-plugin] diff --git a/crates/dojo-lang/src/compiler_test.rs b/crates/dojo-lang/src/compiler_test.rs index 39e84950d5..e124ac014d 100644 --- a/crates/dojo-lang/src/compiler_test.rs +++ b/crates/dojo-lang/src/compiler_test.rs @@ -7,11 +7,12 @@ use cairo_lang_utils::ordered_hash_map::OrderedHashMap; use dojo_test_utils::compiler::build_test_config; use dojo_world::manifest::{BASE_CONTRACT_NAME, EXECUTOR_CONTRACT_NAME, WORLD_CONTRACT_NAME}; use scarb::core::TargetKind; -use scarb::ops::{self, CompileOpts}; +use scarb::ops::CompileOpts; use smol_str::SmolStr; use starknet::macros::felt; use super::do_update_manifest; +use crate::scarb_internal::{self}; fn build_mock_manifest() -> dojo_world::manifest::Manifest { dojo_world::manifest::Manifest { @@ -152,13 +153,10 @@ fn update_manifest_correctly() { #[test] fn test_compiler() { let config = build_test_config("../../examples/spawn-and-move/Scarb.toml").unwrap(); - let ws = ops::read_workspace(config.manifest_path(), &config).unwrap(); - let packages = ws.members().map(|p| p.id).collect(); assert!( - ops::compile( - packages, + scarb_internal::compile_workspace( + &config, CompileOpts { include_targets: vec![], exclude_targets: vec![TargetKind::TEST] }, - &ws ) .is_ok(), "compilation failed" @@ -179,15 +177,12 @@ pub fn test_manifest_file( _args: &OrderedHashMap, ) -> TestRunnerResult { let config = build_test_config("./src/manifest_test_data/spawn-and-move/Scarb.toml").unwrap(); - let ws = ops::read_workspace(config.manifest_path(), &config).unwrap(); - let packages = ws.members().map(|p| p.id).collect(); - ops::compile( - packages, + scarb_internal::compile_workspace( + &config, CompileOpts { include_targets: vec![], exclude_targets: vec![TargetKind::TEST] }, - &ws, ) - .unwrap_or_else(|op| panic!("Error compiling: {op:?}")); + .unwrap_or_else(|err| panic!("Error compiling: {err:?}")); let target_dir = config.target_dir_override().unwrap(); diff --git a/crates/dojo-lang/src/inline_macros/emit.rs b/crates/dojo-lang/src/inline_macros/emit.rs index c0a08888bc..8cd306775d 100644 --- a/crates/dojo-lang/src/inline_macros/emit.rs +++ b/crates/dojo-lang/src/inline_macros/emit.rs @@ -1,15 +1,17 @@ use cairo_lang_defs::patcher::PatchBuilder; use cairo_lang_defs::plugin::{ - InlineMacroExprPlugin, InlinePluginResult, PluginDiagnostic, PluginGeneratedFile, + InlineMacroExprPlugin, InlinePluginResult, NamedPlugin, PluginDiagnostic, PluginGeneratedFile, }; use cairo_lang_semantic::inline_macros::unsupported_bracket_diagnostic; use cairo_lang_syntax::node::{ast, TypedSyntaxNode}; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct EmitMacro; -impl EmitMacro { - pub const NAME: &'static str = "emit"; + +impl NamedPlugin for EmitMacro { + const NAME: &'static str = "emit"; } + impl InlineMacroExprPlugin for EmitMacro { fn generate_code( &self, @@ -26,13 +28,13 @@ impl InlineMacroExprPlugin for EmitMacro { let mut data = Default::::default();", ); - let args = arg_list.args(db).elements(db); + let args = arg_list.arguments(db).elements(db); if args.len() != 2 { return InlinePluginResult { code: None, diagnostics: vec![PluginDiagnostic { - stable_ptr: arg_list.args(db).stable_ptr().untyped(), + stable_ptr: arg_list.arguments(db).stable_ptr().untyped(), message: "Invalid arguments. Expected \"emit!(world, event)\"".to_string(), }], }; diff --git a/crates/dojo-lang/src/inline_macros/get.rs b/crates/dojo-lang/src/inline_macros/get.rs index ecb3aec87a..cc249627f9 100644 --- a/crates/dojo-lang/src/inline_macros/get.rs +++ b/crates/dojo-lang/src/inline_macros/get.rs @@ -1,6 +1,6 @@ use cairo_lang_defs::patcher::PatchBuilder; use cairo_lang_defs::plugin::{ - InlineMacroExprPlugin, InlinePluginResult, PluginDiagnostic, PluginGeneratedFile, + InlineMacroExprPlugin, InlinePluginResult, NamedPlugin, PluginDiagnostic, PluginGeneratedFile, }; use cairo_lang_semantic::inline_macros::unsupported_bracket_diagnostic; use cairo_lang_syntax::node::ast::{Expr, ItemModule}; @@ -11,11 +11,13 @@ use itertools::Itertools; use super::utils::{parent_of_kind, SYSTEM_READS}; use super::{extract_models, unsupported_arg_diagnostic, CAIRO_ERR_MSG_LEN}; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct GetMacro; -impl GetMacro { - pub const NAME: &'static str = "get"; + +impl NamedPlugin for GetMacro { + const NAME: &'static str = "get"; } + impl InlineMacroExprPlugin for GetMacro { fn generate_code( &self, @@ -31,7 +33,7 @@ impl InlineMacroExprPlugin for GetMacro { let mut __get_macro_keys__ = array::ArrayTrait::new();\n", ); - let args = arg_list.args(db).elements(db); + let args = arg_list.arguments(db).elements(db); if args.len() != 3 { return InlinePluginResult { diff --git a/crates/dojo-lang/src/inline_macros/set.rs b/crates/dojo-lang/src/inline_macros/set.rs index d95eb1bab5..d17c7cb48f 100644 --- a/crates/dojo-lang/src/inline_macros/set.rs +++ b/crates/dojo-lang/src/inline_macros/set.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use cairo_lang_defs::patcher::PatchBuilder; use cairo_lang_defs::plugin::{ - InlineMacroExprPlugin, InlinePluginResult, PluginDiagnostic, PluginGeneratedFile, + InlineMacroExprPlugin, InlinePluginResult, NamedPlugin, PluginDiagnostic, PluginGeneratedFile, }; use cairo_lang_semantic::inline_macros::unsupported_bracket_diagnostic; use cairo_lang_syntax::node::ast::{ExprPath, ExprStructCtorCall, FunctionWithBody, ItemModule}; @@ -12,10 +12,11 @@ use cairo_lang_syntax::node::{ast, TypedSyntaxNode}; use super::unsupported_arg_diagnostic; use super::utils::{parent_of_kind, SystemRWOpRecord, SYSTEM_WRITES}; -#[derive(Debug)] +#[derive(Debug, Default)] pub struct SetMacro; -impl SetMacro { - pub const NAME: &'static str = "set"; + +impl NamedPlugin for SetMacro { + const NAME: &'static str = "set"; // Parents of set!() // ----------------- // StatementExpr @@ -31,6 +32,7 @@ impl SetMacro { // ItemList // SyntaxFile } + impl InlineMacroExprPlugin for SetMacro { fn generate_code( &self, @@ -43,13 +45,13 @@ impl InlineMacroExprPlugin for SetMacro { let mut builder = PatchBuilder::new(db); builder.add_str("{"); - let args = arg_list.args(db).elements(db); + let args = arg_list.arguments(db).elements(db); if args.len() != 2 { return InlinePluginResult { code: None, diagnostics: vec![PluginDiagnostic { - stable_ptr: arg_list.args(db).stable_ptr().untyped(), + stable_ptr: arg_list.arguments(db).stable_ptr().untyped(), message: "Invalid arguments. Expected \"(world, (models,))\"".to_string(), }], }; @@ -83,7 +85,7 @@ impl InlineMacroExprPlugin for SetMacro { code: None, diagnostics: vec![PluginDiagnostic { message: "Invalid arguments. Expected \"(world, (models,))\"".to_string(), - stable_ptr: arg_list.args(db).stable_ptr().untyped(), + stable_ptr: arg_list.arguments(db).stable_ptr().untyped(), }], }; } @@ -94,7 +96,7 @@ impl InlineMacroExprPlugin for SetMacro { code: None, diagnostics: vec![PluginDiagnostic { message: "Invalid arguments: No models provided.".to_string(), - stable_ptr: arg_list.args(db).stable_ptr().untyped(), + stable_ptr: arg_list.arguments(db).stable_ptr().untyped(), }], }; } diff --git a/crates/dojo-lang/src/lib.rs b/crates/dojo-lang/src/lib.rs index 218e499037..ced65c7cde 100644 --- a/crates/dojo-lang/src/lib.rs +++ b/crates/dojo-lang/src/lib.rs @@ -12,3 +12,7 @@ pub mod plugin; pub mod print; pub mod semantics; pub(crate) mod version; + +// Copy of non pub functions from scarb + extension. +// Also used by `sozo`. +pub mod scarb_internal; diff --git a/crates/dojo-lang/src/manifest_test_data/manifest b/crates/dojo-lang/src/manifest_test_data/manifest index 587db37a3a..0a737a9b4f 100644 --- a/crates/dojo-lang/src/manifest_test_data/manifest +++ b/crates/dojo-lang/src/manifest_test_data/manifest @@ -8,7 +8,7 @@ test_manifest_file "world": { "name": "world", "address": null, - "class_hash": "0x99b08b2ff33750916e36b5e241b5d4a63e8d48862bf90a68fec2ff58a8de6", + "class_hash": "0x5ac623f0c96059936bd2d0904bdd31799e430fe08a0caff7a5f497260b16497", "abi": [ { "type": "impl", @@ -791,7 +791,7 @@ test_manifest_file "executor": { "name": "executor", "address": null, - "class_hash": "0x54ee9d99457d82d53e21030920f7e6f43509b98ea62282b5c2520050264a28c", + "class_hash": "0x585507fa2818fe78e66da6ea4c5915376739f4abf509d41153f60a16cb1f68d", "abi": [ { "type": "impl", @@ -851,7 +851,7 @@ test_manifest_file }, "base": { "name": "base", - "class_hash": "0x77638e9a645209ac1e32e143bfdbfe9caf723c4f7645fcf465c38967545ea2f", + "class_hash": "0x6c458453d35753703ad25632deec20a29faf8531942ec109e6eb0650316a2bc", "abi": [ { "type": "impl", @@ -955,7 +955,7 @@ test_manifest_file { "name": "actions", "address": null, - "class_hash": "0x1f740b30fc835ecf509a40e8dc8e4eb7ada046243833d2060f17ab961e4e154", + "class_hash": "0x69c6bec7de74fc2404fe6b68ad8ece7be81ad6d861b38a8ba8fa583bfc3666b", "abi": [ { "type": "impl", @@ -1198,49 +1198,14 @@ test_manifest_file ] } ], - "reads": [ - "Moves", - "Position" - ], - "writes": [ - "Moves", - "Position" - ], - "computed": [ - { - "contract": "actions", - "entrypoint": "tile_terrain", - "model": null - }, - { - "contract": "actions", - "entrypoint": "quadrant", - "model": "Position" - } - ] - } - ], - "models": [ + "reads": [], + "writes": [], + "computed": [] + }, { - "name": "Moves", - "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, - { - "name": "remaining", - "type": "u8", - "key": false - }, - { - "name": "last_direction", - "type": "Direction", - "key": false - } - ], - "class_hash": "0x509a65bd8cc5516176a694a3b3c809011f1f0680959c567b3189e60ddab7ce1", + "name": "moves", + "address": null, + "class_hash": "0x64495ca6dc1dc328972697b30468cea364bcb7452bbb6e4aaad3e4b3f190147", "abi": [ { "type": "function", @@ -1401,23 +1366,15 @@ test_manifest_file "kind": "enum", "variants": [] } - ] + ], + "reads": [], + "writes": [], + "computed": [] }, { - "name": "Position", - "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, - { - "name": "vec", - "type": "Vec2", - "key": false - } - ], - "class_hash": "0x52a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6", + "name": "position", + "address": null, + "class_hash": "0x2b233bba9a232a5e891c85eca9f67beedca7a12f9768729ff017bcb62d25c9d", "abi": [ { "type": "function", @@ -1578,7 +1535,11 @@ test_manifest_file "kind": "enum", "variants": [] } - ] + ], + "reads": [], + "writes": [], + "computed": [] } - ] + ], + "models": [] } diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index 0c350b829d..725a0e1b93 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -1,10 +1,8 @@ -use std::sync::Arc; - use anyhow::Result; use cairo_lang_defs::patcher::PatchBuilder; use cairo_lang_defs::plugin::{ - DynGeneratedFileAuxData, GeneratedFileAuxData, InlineMacroExprPlugin, MacroPlugin, - PluginDiagnostic, PluginGeneratedFile, PluginResult, + DynGeneratedFileAuxData, GeneratedFileAuxData, MacroPlugin, PluginDiagnostic, + PluginGeneratedFile, PluginResult, PluginSuite, }; use cairo_lang_syntax::attribute::structured::{ AttributeArg, AttributeArgVariant, AttributeStructurize, @@ -188,7 +186,8 @@ impl BuiltinDojoPlugin { impl CairoPlugin for BuiltinDojoPlugin { fn id(&self) -> PackageId { let url = Url::parse("https://github.com/dojoengine/dojo").unwrap(); - let version = "0.3.11"; + let version = "0.4.0"; + // TODO: update this once pushed. let rev = "1e651b5d4d3b79b14a7d8aa29a92062fcb9e6659"; let source_id = @@ -207,17 +206,21 @@ impl CairoPlugin for BuiltinDojoPlugin { struct BuiltinDojoPluginInstance; impl CairoPluginInstance for BuiltinDojoPluginInstance { - fn macro_plugins(&self) -> Vec> { - vec![Arc::new(BuiltinDojoPlugin)] + fn plugin_suite(&self) -> PluginSuite { + dojo_plugin_suite() } +} - fn inline_macro_plugins(&self) -> Vec<(String, Arc)> { - vec![ - (GetMacro::NAME.into(), Arc::new(GetMacro)), - (SetMacro::NAME.into(), Arc::new(SetMacro)), - (EmitMacro::NAME.into(), Arc::new(EmitMacro)), - ] - } +pub fn dojo_plugin_suite() -> PluginSuite { + let mut suite = PluginSuite::default(); + + suite + .add_plugin::() + .add_inline_macro_plugin::() + .add_inline_macro_plugin::() + .add_inline_macro_plugin::(); + + suite } impl MacroPlugin for BuiltinDojoPlugin { diff --git a/crates/dojo-lang/src/plugin_test.rs b/crates/dojo-lang/src/plugin_test.rs index 338cbbc8eb..d789ff5a5b 100644 --- a/crates/dojo-lang/src/plugin_test.rs +++ b/crates/dojo-lang/src/plugin_test.rs @@ -6,11 +6,11 @@ use cairo_lang_defs::plugin::MacroPlugin; use cairo_lang_diagnostics::{format_diagnostics, DiagnosticLocation}; use cairo_lang_filesystem::cfg::CfgSet; use cairo_lang_filesystem::db::{ - init_files_group, AsFilesGroupMut, FilesDatabase, FilesGroup, FilesGroupEx, + init_files_group, AsFilesGroupMut, CrateConfiguration, FilesDatabase, FilesGroup, FilesGroupEx, }; use cairo_lang_filesystem::ids::{CrateLongId, Directory, FileLongId}; use cairo_lang_parser::db::ParserDatabase; -use cairo_lang_plugins::get_default_plugins; +use cairo_lang_plugins::get_base_plugins; use cairo_lang_syntax::node::db::{SyntaxDatabase, SyntaxGroup}; use cairo_lang_syntax::node::kind::SyntaxKind; use cairo_lang_syntax::node::{ast, TypedSyntaxNode}; @@ -50,7 +50,7 @@ impl Default for DatabaseForTesting { fn default() -> Self { let mut res = Self { storage: Default::default() }; init_files_group(&mut res); - res.set_macro_plugins(get_default_plugins()); + res.set_macro_plugins(get_base_plugins()); res } } @@ -96,7 +96,8 @@ pub fn test_expand_plugin_inner( let crate_id = db.intern_crate(CrateLongId::Real("test".into())); let root = Directory::Real("test_src".into()); - db.set_crate_root(crate_id, Some(root)); + + db.set_crate_config(crate_id, Some(CrateConfiguration::default_for_root(root))); // Main module file. let file_id = db.intern_file(FileLongId::OnDisk("test_src/lib.cairo".into())); diff --git a/crates/dojo-lang/src/plugin_test_data/introspect b/crates/dojo-lang/src/plugin_test_data/introspect index 7ee8be69f3..15fd1b5f07 100644 --- a/crates/dojo-lang/src/plugin_test_data/introspect +++ b/crates/dojo-lang/src/plugin_test_data/introspect @@ -4,7 +4,7 @@ test_expand_plugin //! > cairo_code -use serde::Serde; +use core::serde::Serde; #[derive(Copy, Drop, Serde, Introspect)] struct Vec2 { @@ -51,7 +51,7 @@ struct GenericStruct { } //! > expanded_cairo_code -use serde::Serde; +use core::serde::Serde; #[derive(Copy, Drop, Serde, Introspect)] struct Vec2 { @@ -96,17 +96,17 @@ struct Position { struct GenericStruct { t: T, } -impl Vec2Copy of Copy::; -impl Vec2Drop of Drop::; -impl Vec2Serde of Serde:: { - fn serialize(self: @Vec2, ref output: array::Array) { - serde::Serde::serialize(self.x, ref output); - serde::Serde::serialize(self.y, ref output) - } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Vec2 { - x: serde::Serde::deserialize(ref serialized)?, - y: serde::Serde::deserialize(ref serialized)?, +impl Vec2Copy of core::traits::Copy::; +impl Vec2Drop of core::traits::Drop::; +impl Vec2Serde of core::serde::Serde:: { + fn serialize(self: @Vec2, ref output: core::array::Array) { + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Vec2 { + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, }) } } @@ -141,24 +141,24 @@ layout.append(32); }) } } -impl PlainEnumSerde of Serde:: { - fn serialize(self: @PlainEnum, ref output: array::Array) { +impl PlainEnumSerde of core::serde::Serde:: { + fn serialize(self: @PlainEnum, ref output: core::array::Array) { match self { - PlainEnum::Left(x) => { serde::Serde::serialize(@0, ref output); serde::Serde::serialize(x, ref output); }, - PlainEnum::Right(x) => { serde::Serde::serialize(@1, ref output); serde::Serde::serialize(x, ref output); }, + PlainEnum::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + PlainEnum::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, } } - fn deserialize(ref serialized: array::Span) -> Option { - let idx: felt252 = serde::Serde::deserialize(ref serialized)?; - Option::Some( - if idx == 0 { PlainEnum::Left(serde::Serde::deserialize(ref serialized)?) } - else if idx == 1 { PlainEnum::Right(serde::Serde::deserialize(ref serialized)?) } - else { return Option::None; } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + if idx == 0 { PlainEnum::Left(core::serde::Serde::deserialize(ref serialized)?) } + else if idx == 1 { PlainEnum::Right(core::serde::Serde::deserialize(ref serialized)?) } + else { return core::option::Option::None; } ) } } -impl PlainEnumCopy of Copy::; -impl PlainEnumDrop of Drop::; +impl PlainEnumCopy of core::traits::Copy::; +impl PlainEnumDrop of core::traits::Drop::; impl PlainEnumIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] @@ -192,24 +192,24 @@ impl PlainEnumIntrospect<> of dojo::database::introspect::Introspect ) } } -impl EnumPrimitiveSerde of Serde:: { - fn serialize(self: @EnumPrimitive, ref output: array::Array) { +impl EnumPrimitiveSerde of core::serde::Serde:: { + fn serialize(self: @EnumPrimitive, ref output: core::array::Array) { match self { - EnumPrimitive::Left(x) => { serde::Serde::serialize(@0, ref output); serde::Serde::serialize(x, ref output); }, - EnumPrimitive::Right(x) => { serde::Serde::serialize(@1, ref output); serde::Serde::serialize(x, ref output); }, + EnumPrimitive::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumPrimitive::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, } } - fn deserialize(ref serialized: array::Span) -> Option { - let idx: felt252 = serde::Serde::deserialize(ref serialized)?; - Option::Some( - if idx == 0 { EnumPrimitive::Left(serde::Serde::deserialize(ref serialized)?) } - else if idx == 1 { EnumPrimitive::Right(serde::Serde::deserialize(ref serialized)?) } - else { return Option::None; } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + if idx == 0 { EnumPrimitive::Left(core::serde::Serde::deserialize(ref serialized)?) } + else if idx == 1 { EnumPrimitive::Right(core::serde::Serde::deserialize(ref serialized)?) } + else { return core::option::Option::None; } ) } } -impl EnumPrimitiveCopy of Copy::; -impl EnumPrimitiveDrop of Drop::; +impl EnumPrimitiveCopy of core::traits::Copy::; +impl EnumPrimitiveDrop of core::traits::Drop::; impl EnumPrimitiveIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] @@ -248,24 +248,24 @@ layout.append(16); ) } } -impl EnumTupleSerde of Serde:: { - fn serialize(self: @EnumTuple, ref output: array::Array) { +impl EnumTupleSerde of core::serde::Serde:: { + fn serialize(self: @EnumTuple, ref output: core::array::Array) { match self { - EnumTuple::Left(x) => { serde::Serde::serialize(@0, ref output); serde::Serde::serialize(x, ref output); }, - EnumTuple::Right(x) => { serde::Serde::serialize(@1, ref output); serde::Serde::serialize(x, ref output); }, + EnumTuple::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumTuple::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, } } - fn deserialize(ref serialized: array::Span) -> Option { - let idx: felt252 = serde::Serde::deserialize(ref serialized)?; - Option::Some( - if idx == 0 { EnumTuple::Left(serde::Serde::deserialize(ref serialized)?) } - else if idx == 1 { EnumTuple::Right(serde::Serde::deserialize(ref serialized)?) } - else { return Option::None; } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + if idx == 0 { EnumTuple::Left(core::serde::Serde::deserialize(ref serialized)?) } + else if idx == 1 { EnumTuple::Right(core::serde::Serde::deserialize(ref serialized)?) } + else { return core::option::Option::None; } ) } } -impl EnumTupleCopy of Copy::; -impl EnumTupleDrop of Drop::; +impl EnumTupleCopy of core::traits::Copy::; +impl EnumTupleDrop of core::traits::Drop::; impl EnumTupleIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] @@ -309,24 +309,24 @@ layout.append(8); ) } } -impl EnumCustomSerde of Serde:: { - fn serialize(self: @EnumCustom, ref output: array::Array) { +impl EnumCustomSerde of core::serde::Serde:: { + fn serialize(self: @EnumCustom, ref output: core::array::Array) { match self { - EnumCustom::Left(x) => { serde::Serde::serialize(@0, ref output); serde::Serde::serialize(x, ref output); }, - EnumCustom::Right(x) => { serde::Serde::serialize(@1, ref output); serde::Serde::serialize(x, ref output); }, + EnumCustom::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumCustom::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, } } - fn deserialize(ref serialized: array::Span) -> Option { - let idx: felt252 = serde::Serde::deserialize(ref serialized)?; - Option::Some( - if idx == 0 { EnumCustom::Left(serde::Serde::deserialize(ref serialized)?) } - else if idx == 1 { EnumCustom::Right(serde::Serde::deserialize(ref serialized)?) } - else { return Option::None; } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; + core::option::Option::Some( + if idx == 0 { EnumCustom::Left(core::serde::Serde::deserialize(ref serialized)?) } + else if idx == 1 { EnumCustom::Right(core::serde::Serde::deserialize(ref serialized)?) } + else { return core::option::Option::None; } ) } } -impl EnumCustomCopy of Copy::; -impl EnumCustomDrop of Drop::; +impl EnumCustomCopy of core::traits::Copy::; +impl EnumCustomDrop of core::traits::Drop::; impl EnumCustomIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] @@ -365,8 +365,8 @@ dojo::database::introspect::Introspect::::layout(ref layout); ) } } -impl PositionCopy of Copy::; -impl PositionDrop of Drop::; +impl PositionCopy of core::traits::Copy::; +impl PositionDrop of core::traits::Drop::; impl PositionIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] @@ -407,15 +407,15 @@ layout.append(16); }) } } -impl GenericStructCopy> of Copy::>; -impl GenericStructDrop> of Drop::>; -impl GenericStructSerde, impl TDestruct: Destruct> of Serde::> { - fn serialize(self: @GenericStruct, ref output: array::Array) { - serde::Serde::serialize(self.t, ref output) - } - fn deserialize(ref serialized: array::Span) -> Option> { - Option::Some(GenericStruct { - t: serde::Serde::deserialize(ref serialized)?, +impl GenericStructCopy> of core::traits::Copy::>; +impl GenericStructDrop> of core::traits::Drop::>; +impl GenericStructSerde, +core::traits::Destruct> of core::serde::Serde::> { + fn serialize(self: @GenericStruct, ref output: core::array::Array) { + core::serde::Serde::serialize(self.t, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option> { + core::option::Option::Some(GenericStruct { + t: core::serde::Serde::deserialize(ref serialized)?, }) } } diff --git a/crates/dojo-lang/src/plugin_test_data/model b/crates/dojo-lang/src/plugin_test_data/model index 00a549b83f..2072615d16 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -4,7 +4,7 @@ test_expand_plugin //! > cairo_code -use serde::Serde; +use core::serde::Serde; #[derive(Introspect, Copy, Drop, Serde)] struct Vec3 { @@ -56,7 +56,7 @@ struct Player { } //! > generated_cairo_code -use serde::Serde; +use core::serde::Serde; #[derive(Introspect, Copy, Drop, Serde)] @@ -139,7 +139,7 @@ impl PositionModel of dojo::model::Model { #[inline(always)] fn values(self: @Position) -> Span { let mut serialized = ArrayTrait::new(); - serde::Serde::serialize(self.v, ref serialized); + core::serde::Serde::serialize(self.v, ref serialized); array::ArrayTrait::span(@serialized) } @@ -284,7 +284,7 @@ impl RolesModel of dojo::model::Model { #[inline(always)] fn values(self: @Roles) -> Span { let mut serialized = ArrayTrait::new(); - serde::Serde::serialize(self.role_ids, ref serialized); + core::serde::Serde::serialize(self.role_ids, ref serialized); array::ArrayTrait::span(@serialized) } @@ -403,7 +403,7 @@ impl PlayerModel of dojo::model::Model { fn keys(self: @Player) -> Span { let mut serialized = ArrayTrait::new(); array::ArrayTrait::append(ref serialized, *self.game); - serde::Serde::serialize(self.player, ref serialized); + core::serde::Serde::serialize(self.player, ref serialized); array::ArrayTrait::span(@serialized) } @@ -631,7 +631,7 @@ error: Unsupported attribute. ^*************^ //! > expanded_cairo_code -use serde::Serde; +use core::serde::Serde; #[derive(Introspect, Copy, Drop, Serde)] struct Vec3 { @@ -681,19 +681,19 @@ struct Player { name: felt252, } -impl Vec3Copy of Copy::; -impl Vec3Drop of Drop::; -impl Vec3Serde of Serde:: { - fn serialize(self: @Vec3, ref output: array::Array) { - serde::Serde::serialize(self.x, ref output); - serde::Serde::serialize(self.y, ref output); - serde::Serde::serialize(self.z, ref output) - } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Vec3 { - x: serde::Serde::deserialize(ref serialized)?, - y: serde::Serde::deserialize(ref serialized)?, - z: serde::Serde::deserialize(ref serialized)?, +impl Vec3Copy of core::traits::Copy::; +impl Vec3Drop of core::traits::Drop::; +impl Vec3Serde of core::serde::Serde:: { + fn serialize(self: @Vec3, ref output: core::array::Array) { + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output); + core::serde::Serde::serialize(self.z, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Vec3 { + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, + z: core::serde::Serde::deserialize(ref serialized)?, }) } } @@ -733,17 +733,17 @@ layout.append(8); }) } } -impl PositionCopy of Copy::; -impl PositionDrop of Drop::; -impl PositionSerde of Serde:: { - fn serialize(self: @Position, ref output: array::Array) { - serde::Serde::serialize(self.id, ref output); - serde::Serde::serialize(self.v, ref output) - } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Position { - id: serde::Serde::deserialize(ref serialized)?, - v: serde::Serde::deserialize(ref serialized)?, +impl PositionCopy of core::traits::Copy::; +impl PositionDrop of core::traits::Drop::; +impl PositionSerde of core::serde::Serde:: { + fn serialize(self: @Position, ref output: core::array::Array) { + core::serde::Serde::serialize(self.id, ref output); + core::serde::Serde::serialize(self.v, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Position { + id: core::serde::Serde::deserialize(ref serialized)?, + v: core::serde::Serde::deserialize(ref serialized)?, }) } } @@ -856,13 +856,13 @@ impl PositionIntrospect<> of dojo::database::introspect::Introspect> dojo::database::introspect::Introspect::::ty() } } -impl RolesSerde of Serde:: { - fn serialize(self: @Roles, ref output: array::Array) { - serde::Serde::serialize(self.role_ids, ref output) +impl RolesSerde of core::serde::Serde:: { + fn serialize(self: @Roles, ref output: core::array::Array) { + core::serde::Serde::serialize(self.role_ids, ref output) } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Roles { - role_ids: serde::Serde::deserialize(ref serialized)?, + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Roles { + role_ids: core::serde::Serde::deserialize(ref serialized)?, }) } } @@ -971,19 +971,19 @@ impl RolesIntrospect<> of dojo::database::introspect::Introspect> { dojo::database::introspect::Introspect::::ty() } } -impl PlayerCopy of Copy::; -impl PlayerDrop of Drop::; -impl PlayerSerde of Serde:: { - fn serialize(self: @Player, ref output: array::Array) { - serde::Serde::serialize(self.game, ref output); - serde::Serde::serialize(self.player, ref output); - serde::Serde::serialize(self.name, ref output) - } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Player { - game: serde::Serde::deserialize(ref serialized)?, - player: serde::Serde::deserialize(ref serialized)?, - name: serde::Serde::deserialize(ref serialized)?, +impl PlayerCopy of core::traits::Copy::; +impl PlayerDrop of core::traits::Drop::; +impl PlayerSerde of core::serde::Serde:: { + fn serialize(self: @Player, ref output: core::array::Array) { + core::serde::Serde::serialize(self.game, ref output); + core::serde::Serde::serialize(self.player, ref output); + core::serde::Serde::serialize(self.name, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Player { + game: core::serde::Serde::deserialize(ref serialized)?, + player: core::serde::Serde::deserialize(ref serialized)?, + name: core::serde::Serde::deserialize(ref serialized)?, }) } } diff --git a/crates/dojo-lang/src/plugin_test_data/print b/crates/dojo-lang/src/plugin_test_data/print index f8611ec183..394b02bad8 100644 --- a/crates/dojo-lang/src/plugin_test_data/print +++ b/crates/dojo-lang/src/plugin_test_data/print @@ -126,45 +126,45 @@ struct Player { name: felt252, } -impl PositionCopy of Copy::; -impl PositionDrop of Drop::; -impl PositionSerde of Serde:: { - fn serialize(self: @Position, ref output: array::Array) { - serde::Serde::serialize(self.id, ref output); - serde::Serde::serialize(self.x, ref output); - serde::Serde::serialize(self.y, ref output) +impl PositionCopy of core::traits::Copy::; +impl PositionDrop of core::traits::Drop::; +impl PositionSerde of core::serde::Serde:: { + fn serialize(self: @Position, ref output: core::array::Array) { + core::serde::Serde::serialize(self.id, ref output); + core::serde::Serde::serialize(self.x, ref output); + core::serde::Serde::serialize(self.y, ref output) } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Position { - id: serde::Serde::deserialize(ref serialized)?, - x: serde::Serde::deserialize(ref serialized)?, - y: serde::Serde::deserialize(ref serialized)?, + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Position { + id: core::serde::Serde::deserialize(ref serialized)?, + x: core::serde::Serde::deserialize(ref serialized)?, + y: core::serde::Serde::deserialize(ref serialized)?, }) } } -impl RolesSerde of Serde:: { - fn serialize(self: @Roles, ref output: array::Array) { - serde::Serde::serialize(self.role_ids, ref output) +impl RolesSerde of core::serde::Serde:: { + fn serialize(self: @Roles, ref output: core::array::Array) { + core::serde::Serde::serialize(self.role_ids, ref output) } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Roles { - role_ids: serde::Serde::deserialize(ref serialized)?, + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Roles { + role_ids: core::serde::Serde::deserialize(ref serialized)?, }) } } -impl PlayerCopy of Copy::; -impl PlayerDrop of Drop::; -impl PlayerSerde of Serde:: { - fn serialize(self: @Player, ref output: array::Array) { - serde::Serde::serialize(self.game, ref output); - serde::Serde::serialize(self.player, ref output); - serde::Serde::serialize(self.name, ref output) +impl PlayerCopy of core::traits::Copy::; +impl PlayerDrop of core::traits::Drop::; +impl PlayerSerde of core::serde::Serde:: { + fn serialize(self: @Player, ref output: core::array::Array) { + core::serde::Serde::serialize(self.game, ref output); + core::serde::Serde::serialize(self.player, ref output); + core::serde::Serde::serialize(self.name, ref output) } - fn deserialize(ref serialized: array::Span) -> Option { - Option::Some(Player { - game: serde::Serde::deserialize(ref serialized)?, - player: serde::Serde::deserialize(ref serialized)?, - name: serde::Serde::deserialize(ref serialized)?, + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Player { + game: core::serde::Serde::deserialize(ref serialized)?, + player: core::serde::Serde::deserialize(ref serialized)?, + name: core::serde::Serde::deserialize(ref serialized)?, }) } } diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index 13d26fa0c8..605557666b 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -499,7 +499,7 @@ mod testcomponent2 { #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } -impl EventDrop of Drop::; +impl EventDrop of core::traits::Drop::; } @@ -541,7 +541,7 @@ impl EventDrop of Drop::; #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } -impl EventDrop of Drop::; +impl EventDrop of core::traits::Drop::; } @@ -586,7 +586,7 @@ impl EventDrop of Drop::; #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } -impl EventDrop of Drop::; +impl EventDrop of core::traits::Drop::; } @@ -636,8 +636,8 @@ impl EventDrop of Drop::; #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } -impl EventDrop of Drop::; -impl TestEventDrop of Drop::; +impl EventDrop of core::traits::Drop::; +impl TestEventDrop of core::traits::Drop::; } @@ -682,6 +682,6 @@ impl TestEventDrop of Drop::; testcomponent1_event: testcomponent1::Event, testcomponent2_event: testcomponent2::Event } -impl EventDrop of Drop::; +impl EventDrop of core::traits::Drop::; } diff --git a/crates/dojo-lang/src/scarb_internal/mod.rs b/crates/dojo-lang/src/scarb_internal/mod.rs new file mode 100644 index 0000000000..bf104e7457 --- /dev/null +++ b/crates/dojo-lang/src/scarb_internal/mod.rs @@ -0,0 +1,100 @@ +// I have copied source code from https://github.com/software-mansion/scarb/blob/main/scarb/src/compiler/db.rs +// since build_scarb_root_database is not public. +// +// NOTE: This files needs to be updated whenever scarb version is updated. +// NOTE: This file was moved here from `sozo` as we need to compile here too, +// and `sozo` has `dojo-lang` as dependency. +use anyhow::Result; +use cairo_lang_compiler::db::RootDatabase; +use cairo_lang_compiler::project::{ProjectConfig, ProjectConfigContent}; +use cairo_lang_filesystem::ids::Directory; +use cairo_lang_project::{AllCratesConfig, SingleCrateConfig}; +use cairo_lang_starknet::starknet_plugin_suite; +use cairo_lang_test_plugin::test_plugin_suite; +use cairo_lang_utils::ordered_hash_map::OrderedHashMap; +use scarb::compiler::CompilationUnit; +use scarb::core::Config; +use scarb::ops::CompileOpts; +use smol_str::SmolStr; +use tracing::trace; + +use crate::plugin::dojo_plugin_suite; + +pub fn crates_config_for_compilation_unit(unit: &CompilationUnit) -> AllCratesConfig { + let crates_config: OrderedHashMap = unit + .components + .iter() + .map(|component| { + ( + component.cairo_package_name(), + SingleCrateConfig { edition: component.package.manifest.edition }, + ) + }) + .collect(); + + AllCratesConfig { override_map: crates_config, ..Default::default() } +} + +// TODO(mkaput): ScarbDatabase? +pub fn build_scarb_root_database(unit: &CompilationUnit) -> Result { + let mut b = RootDatabase::builder(); + b.with_project_config(build_project_config(unit)?); + b.with_cfg(unit.cfg_set.clone()); + + // TODO: Is it fair to consider only those plugins at the moment? + b.with_plugin_suite(test_plugin_suite()); + b.with_plugin_suite(dojo_plugin_suite()); + b.with_plugin_suite(starknet_plugin_suite()); + + b.build() +} + +/// This function is an alternative to `ops::compile`, it's doing the same job. +/// However, we can control the injection of the plugins, required to have dojo plugin present +/// for each compilation. +pub fn compile_workspace(config: &Config, opts: CompileOpts) -> Result<()> { + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let packages: Vec = ws.members().map(|p| p.id).collect(); + let resolve = scarb::ops::resolve_workspace(&ws)?; + let compilation_units = scarb::ops::generate_compilation_units(&resolve, &ws)? + .into_iter() + .filter(|cu| !opts.exclude_targets.contains(&cu.target().kind)) + .filter(|cu| { + opts.include_targets.is_empty() || opts.include_targets.contains(&cu.target().kind) + }) + .filter(|cu| packages.contains(&cu.main_package_id)) + .collect::>(); + + for unit in compilation_units { + let mut db = build_scarb_root_database(&unit).unwrap(); + + if let Err(err) = ws.config().compilers().compile(unit.clone(), &mut (db), &ws) { + ws.config().ui().anyhow(&err) + } + } + + Ok(()) +} + +fn build_project_config(unit: &CompilationUnit) -> Result { + let crate_roots = unit + .components + .iter() + .filter(|model| !model.package.id.is_core()) + .map(|model| (model.cairo_package_name(), model.target.source_root().into())) + .collect(); + + let corelib = Some(Directory::Real(unit.core_package_component().target.source_root().into())); + + let content = ProjectConfigContent { + crate_roots, + crates_config: crates_config_for_compilation_unit(unit), + }; + + let project_config = + ProjectConfig { base_path: unit.main_component().package.root().into(), corelib, content }; + + trace!(?project_config); + + Ok(project_config) +} diff --git a/crates/dojo-lang/src/semantics/test_data/get b/crates/dojo-lang/src/semantics/test_data/get index da5f04e60e..f08b775721 100644 --- a/crates/dojo-lang/src/semantics/test_data/get +++ b/crates/dojo-lang/src/semantics/test_data/get @@ -34,11 +34,6 @@ error: Plugin diagnostic: Invalid arguments. Expected "get!(world, keys, (models get!() ^****^ -error: Inline macro `get` failed. - --> lib.cairo:12:1 -get!() -^****^ - //! > ========================================================================== //! > Test wrong params @@ -77,11 +72,6 @@ error: Plugin diagnostic: Invalid arguments. Expected "get!(world, keys, (models get!(world) ^*********^ -error: Inline macro `get` failed. - --> lib.cairo:12:1 -get!(world) -^*********^ - //! > ========================================================================== //! > Test world and keys diff --git a/crates/dojo-lang/src/semantics/test_data/set b/crates/dojo-lang/src/semantics/test_data/set index 4633cf5ef8..cca850737a 100644 --- a/crates/dojo-lang/src/semantics/test_data/set +++ b/crates/dojo-lang/src/semantics/test_data/set @@ -29,14 +29,9 @@ Missing( //! > semantic_diagnostics error: Plugin diagnostic: Invalid arguments. Expected "(world, (models,))" - --> lib.cairo:11:1 + --> lib.cairo:11:6 set!() -^****^ - -error: Inline macro `set` failed. - --> lib.cairo:11:1 -set!() -^****^ + ^ //! > ========================================================================== @@ -71,14 +66,9 @@ Missing( //! > semantic_diagnostics error: Plugin diagnostic: Invalid arguments. Expected "(world, (models,))" - --> lib.cairo:11:1 -set!(world) -^*********^ - -error: Inline macro `set` failed. - --> lib.cairo:11:1 + --> lib.cairo:11:6 set!(world) -^*********^ + ^***^ //! > ========================================================================== diff --git a/crates/dojo-lang/src/semantics/test_utils.rs b/crates/dojo-lang/src/semantics/test_utils.rs index ad74412d33..6ab997153b 100644 --- a/crates/dojo-lang/src/semantics/test_utils.rs +++ b/crates/dojo-lang/src/semantics/test_utils.rs @@ -6,19 +6,18 @@ use cairo_lang_defs::db::{DefsDatabase, DefsGroup}; use cairo_lang_defs::ids::{FunctionWithBodyId, ModuleId}; use cairo_lang_diagnostics::{Diagnostics, DiagnosticsBuilder}; use cairo_lang_filesystem::db::{ - init_dev_corelib, init_files_group, AsFilesGroupMut, FilesDatabase, FilesGroup, FilesGroupEx, + init_dev_corelib, init_files_group, AsFilesGroupMut, CrateConfiguration, FilesDatabase, + FilesGroup, FilesGroupEx, }; use cairo_lang_filesystem::ids::{ CrateId, CrateLongId, Directory, FileKind, FileLongId, VirtualFile, }; use cairo_lang_parser::db::ParserDatabase; -use cairo_lang_plugins::get_default_plugins; use cairo_lang_semantic::db::{SemanticDatabase, SemanticGroup}; -use cairo_lang_semantic::inline_macros::get_default_inline_macro_plugins; +use cairo_lang_semantic::inline_macros::get_default_plugin_suite; use cairo_lang_semantic::items::functions::GenericFunctionId; use cairo_lang_semantic::{ConcreteFunctionWithBodyId, SemanticDiagnostic}; -use cairo_lang_starknet::inline_macros::selector::SelectorMacro; -use cairo_lang_starknet::plugin::StarkNetPlugin; +use cairo_lang_starknet::starknet_plugin_suite; use cairo_lang_syntax::node::db::{SyntaxDatabase, SyntaxGroup}; use cairo_lang_utils::ordered_hash_map::OrderedHashMap; use cairo_lang_utils::{extract_matches, OptionFrom, Upcast}; @@ -26,10 +25,7 @@ use camino::Utf8PathBuf; use dojo_test_utils::compiler::corelib; use once_cell::sync::Lazy; -use crate::inline_macros::emit::EmitMacro; -use crate::inline_macros::get::GetMacro; -use crate::inline_macros::set::SetMacro; -use crate::plugin::BuiltinDojoPlugin; +use crate::plugin::dojo_plugin_suite; #[salsa::database(SemanticDatabase, DefsDatabase, ParserDatabase, SyntaxDatabase, FilesDatabase)] pub struct DojoSemanticDatabase { @@ -46,25 +42,21 @@ impl DojoSemanticDatabase { pub fn new_empty() -> Self { let mut db = DojoSemanticDatabase { storage: Default::default() }; init_files_group(&mut db); - let mut plugins = get_default_plugins(); - plugins.push(Arc::new(StarkNetPlugin::default())); - plugins.push(Arc::new(BuiltinDojoPlugin)); - db.set_macro_plugins(plugins); - let mut inline_plugins = get_default_inline_macro_plugins(); - inline_plugins.insert(SelectorMacro::NAME.into(), Arc::new(SelectorMacro)); - inline_plugins.insert(GetMacro::NAME.into(), Arc::new(GetMacro)); - inline_plugins.insert(SetMacro::NAME.into(), Arc::new(SetMacro)); - inline_plugins.insert(EmitMacro::NAME.into(), Arc::new(EmitMacro)); + let mut suite = get_default_plugin_suite(); + suite.add(starknet_plugin_suite()); + suite.add(dojo_plugin_suite()); - db.set_inline_macro_plugins(inline_plugins.into()); + db.set_macro_plugins(suite.plugins); + db.set_inline_macro_plugins(suite.inline_macro_plugins.into()); init_dev_corelib(&mut db, corelib()); let dojo_path = Utf8PathBuf::from_path_buf("../../crates/dojo-core/src".into()).unwrap(); let dojo_path: PathBuf = dojo_path.canonicalize_utf8().unwrap().into(); let core_crate = db.intern_crate(CrateLongId::Real("dojo".into())); let core_root_dir = Directory::Real(dojo_path); - db.set_crate_root(core_crate, Some(core_root_dir)); + + db.set_crate_config(core_crate, Some(CrateConfiguration::default_for_root(core_root_dir))); db } diff --git a/crates/dojo-language-server/Cargo.toml b/crates/dojo-language-server/Cargo.toml index 9726b11355..5d742aa035 100644 --- a/crates/dojo-language-server/Cargo.toml +++ b/crates/dojo-language-server/Cargo.toml @@ -1,6 +1,6 @@ [package] edition.workspace = true -name = "dojo-languge-server" +name = "dojo-language-server" version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -24,4 +24,4 @@ log = "0.4.14" salsa = "0.16.1" smol_str.workspace = true tokio = { version = "1.18.2", features = [ "full", "sync" ] } -tower-lsp = "0.19.0" +tower-lsp = "0.20.0" diff --git a/crates/dojo-language-server/src/bin/language_server.rs b/crates/dojo-language-server/src/bin/language_server.rs index d9a78c4316..0539a0bf27 100644 --- a/crates/dojo-language-server/src/bin/language_server.rs +++ b/crates/dojo-language-server/src/bin/language_server.rs @@ -1,17 +1,11 @@ -use std::sync::Arc; - use cairo_lang_compiler::db::RootDatabase; use cairo_lang_filesystem::cfg::{Cfg, CfgSet}; use cairo_lang_language_server::Backend; -use cairo_lang_starknet::inline_macros::selector::SelectorMacro; -use cairo_lang_starknet::plugin::StarkNetPlugin; -use cairo_lang_test_plugin::TestPlugin; +use cairo_lang_starknet::starknet_plugin_suite; +use cairo_lang_test_plugin::test_plugin_suite; use cairo_lang_utils::logging::init_logging; use clap::Parser; -use dojo_lang::inline_macros::emit::EmitMacro; -use dojo_lang::inline_macros::get::GetMacro; -use dojo_lang::inline_macros::set::SetMacro; -use dojo_lang::plugin::BuiltinDojoPlugin; +use dojo_lang::plugin::dojo_plugin_suite; use tower_lsp::{LspService, Server}; /// Dojo Language Server @@ -34,13 +28,9 @@ async fn main() { let db = RootDatabase::builder() .with_cfg(CfgSet::from_iter([Cfg::name("test")])) - .with_macro_plugin(Arc::new(BuiltinDojoPlugin)) - .with_macro_plugin(Arc::new(StarkNetPlugin::default())) - .with_macro_plugin(Arc::new(TestPlugin::default())) - .with_inline_macro_plugin(EmitMacro::NAME, Arc::new(EmitMacro)) - .with_inline_macro_plugin(GetMacro::NAME, Arc::new(GetMacro)) - .with_inline_macro_plugin(SetMacro::NAME, Arc::new(SetMacro)) - .with_inline_macro_plugin(SelectorMacro::NAME, Arc::new(SelectorMacro)) + .with_plugin_suite(dojo_plugin_suite()) + .with_plugin_suite(test_plugin_suite()) + .with_plugin_suite(starknet_plugin_suite()) .build() .unwrap_or_else(|error| { panic!("Problem creating language database: {error:?}"); diff --git a/crates/dojo-test-utils/build.rs b/crates/dojo-test-utils/build.rs index 64b0e8db1f..3f6b9592f8 100644 --- a/crates/dojo-test-utils/build.rs +++ b/crates/dojo-test-utils/build.rs @@ -5,9 +5,10 @@ fn main() { use camino::{Utf8Path, Utf8PathBuf}; use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; + use dojo_lang::scarb_internal::compile_workspace; use scarb::compiler::CompilerRepository; use scarb::core::{Config, TargetKind}; - use scarb::ops::{self, CompileOpts}; + use scarb::ops::CompileOpts; use scarb_ui::Verbosity; let project_paths = ["../../examples/spawn-and-move", "../torii/graphql/src/tests/types-test"]; @@ -39,12 +40,9 @@ fn main() { .build() .unwrap(); - let ws = ops::read_workspace(config.manifest_path(), &config).unwrap(); - let packages = ws.members().map(|p| p.id).collect(); - ops::compile( - packages, + compile_workspace( + &config, CompileOpts { include_targets: vec![], exclude_targets: vec![TargetKind::TEST] }, - &ws, ) .unwrap(); } diff --git a/crates/dojo-world/Cargo.toml b/crates/dojo-world/Cargo.toml index ef0cc482e8..d6da3ff3b0 100644 --- a/crates/dojo-world/Cargo.toml +++ b/crates/dojo-world/Cargo.toml @@ -27,7 +27,7 @@ tracing.workspace = true dojo-types = { path = "../dojo-types", optional = true } http = { version = "0.2.9", optional = true } ipfs-api-backend-hyper = { git = "https://github.com/ferristseng/rust-ipfs-api", rev = "af2c17f7b19ef5b9898f458d97a90055c3605633", features = [ "with-hyper-rustls" ], optional = true } -scarb = { git = "https://github.com/software-mansion/scarb", rev = "0c8def3", optional = true } +scarb = { git = "https://github.com/software-mansion/scarb", tag = "v2.4.0", optional = true } tokio = { version = "1.32.0", features = [ "time" ], default-features = false, optional = true } url = { version = "2.2.2", optional = true } diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 887310faf0..cd235080da 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -63,7 +63,7 @@ async fn test_model() { assert_eq!( position.class_hash(), FieldElement::from_hex_be( - "0x052a1da1853c194683ca5d6d154452d0654d23f2eacd4267c555ff2338e144d6" + "0x02b233bba9a232a5e891c85eca9f67beedca7a12f9768729ff017bcb62d25c9d" ) .unwrap() ); diff --git a/crates/katana/core/src/backend/config.rs b/crates/katana/core/src/backend/config.rs index 78d32b31ad..4513f2cbed 100644 --- a/crates/katana/core/src/backend/config.rs +++ b/crates/katana/core/src/backend/config.rs @@ -1,4 +1,4 @@ -use blockifier::block_context::BlockContext; +use blockifier::block_context::{BlockContext, FeeTokenAddresses, GasPrices}; use starknet_api::block::{BlockNumber, BlockTimestamp}; use starknet_api::core::ChainId; use url::Url; @@ -26,9 +26,19 @@ impl StarknetConfig { chain_id: ChainId(self.env.chain_id.clone()), block_timestamp: BlockTimestamp::default(), sequencer_address: (*SEQUENCER_ADDRESS).into(), - fee_token_address: (*FEE_TOKEN_ADDRESS).into(), + // As the fee has two currencies, we also have to adjust their addresses. + // https://github.com/starkware-libs/blockifier/blob/51b343fe38139a309a69b2482f4b484e8caa5edf/crates/blockifier/src/block_context.rs#L34 + fee_token_addresses: FeeTokenAddresses { + eth_fee_token_address: (*FEE_TOKEN_ADDRESS).into(), + strk_fee_token_address: Default::default(), + }, vm_resource_fee_cost: get_default_vm_resource_fee_cost().into(), - gas_price: self.env.gas_price, + // Gas prices are dual too. + // https://github.com/starkware-libs/blockifier/blob/51b343fe38139a309a69b2482f4b484e8caa5edf/crates/blockifier/src/block_context.rs#L49 + gas_prices: GasPrices { + eth_l1_gas_price: self.env.gas_price, + strk_l1_gas_price: Default::default(), + }, validate_max_n_steps: self.env.validate_max_steps, invoke_tx_max_n_steps: self.env.invoke_max_steps, max_recursion_depth: 1000, diff --git a/crates/katana/core/src/backend/mod.rs b/crates/katana/core/src/backend/mod.rs index 3dcf35c6c0..32343541e0 100644 --- a/crates/katana/core/src/backend/mod.rs +++ b/crates/katana/core/src/backend/mod.rs @@ -149,7 +149,7 @@ impl Backend { let partial_header = PartialHeader { parent_hash: prev_hash, - gas_price: block_context.gas_price, + gas_price: block_context.gas_prices.eth_l1_gas_price, number: block_context.block_number.0, timestamp: block_context.block_timestamp.0, sequencer_address: block_context.sequencer_address.into(), diff --git a/crates/katana/core/src/backend/storage.rs b/crates/katana/core/src/backend/storage.rs index 545e06a453..49b59c8b3a 100644 --- a/crates/katana/core/src/backend/storage.rs +++ b/crates/katana/core/src/backend/storage.rs @@ -66,8 +66,9 @@ impl Blockchain { pub fn new_with_genesis(provider: impl Database, block_context: &BlockContext) -> Result { let header = PartialHeader { + // TODO: need to be adjusted, eth is used for compatibility for now. parent_hash: 0u8.into(), - gas_price: block_context.gas_price, + gas_price: block_context.gas_prices.eth_l1_gas_price, number: block_context.block_number.0, timestamp: block_context.block_timestamp.0, sequencer_address: *SEQUENCER_ADDRESS, @@ -94,7 +95,7 @@ impl Blockchain { let header = Header { state_root, parent_hash, - gas_price: block_context.gas_price, + gas_price: block_context.gas_prices.eth_l1_gas_price, number: block_context.block_number.0, timestamp: block_context.block_timestamp.0, sequencer_address: *SEQUENCER_ADDRESS, @@ -124,7 +125,7 @@ impl Blockchain { #[cfg(test)] mod tests { - use blockifier::block_context::BlockContext; + use blockifier::block_context::{BlockContext, FeeTokenAddresses, GasPrices}; use katana_primitives::block::FinalityStatus; use katana_primitives::FieldElement; use katana_provider::providers::in_memory::InMemoryProvider; @@ -145,7 +146,7 @@ mod tests { fn blockchain_from_genesis_states() { let provider = InMemoryProvider::new(); let block_context = BlockContext { - gas_price: 0, + gas_prices: GasPrices { eth_l1_gas_price: 0, strk_l1_gas_price: 0 }, max_recursion_depth: 0, validate_max_n_steps: 0, invoke_tx_max_n_steps: 0, @@ -153,7 +154,10 @@ mod tests { chain_id: ChainId("test".into()), block_timestamp: BlockTimestamp(0), sequencer_address: Default::default(), - fee_token_address: Default::default(), + fee_token_addresses: FeeTokenAddresses { + eth_fee_token_address: Default::default(), + strk_fee_token_address: Default::default(), + }, vm_resource_fee_cost: Default::default(), }; @@ -176,7 +180,7 @@ mod tests { let provider = InMemoryProvider::new(); let block_context = BlockContext { - gas_price: 9090, + gas_prices: GasPrices { eth_l1_gas_price: 9090, strk_l1_gas_price: 0 }, max_recursion_depth: 0, validate_max_n_steps: 0, invoke_tx_max_n_steps: 0, @@ -184,7 +188,10 @@ mod tests { block_number: BlockNumber(23), block_timestamp: BlockTimestamp(6868), sequencer_address: Default::default(), - fee_token_address: Default::default(), + fee_token_addresses: FeeTokenAddresses { + eth_fee_token_address: Default::default(), + strk_fee_token_address: Default::default(), + }, vm_resource_fee_cost: Default::default(), }; diff --git a/crates/katana/core/src/env.rs b/crates/katana/core/src/env.rs index 951e65d2d9..464b317831 100644 --- a/crates/katana/core/src/env.rs +++ b/crates/katana/core/src/env.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use blockifier::block_context::BlockContext; +use blockifier::block_context::{BlockContext, FeeTokenAddresses, GasPrices}; use cairo_vm::vm::runners::builtin_runner::{ BITWISE_BUILTIN_NAME, EC_OP_BUILTIN_NAME, HASH_BUILTIN_NAME, KECCAK_BUILTIN_NAME, OUTPUT_BUILTIN_NAME, POSEIDON_BUILTIN_NAME, RANGE_CHECK_BUILTIN_NAME, @@ -33,9 +33,15 @@ impl Default for Env { block_number: BlockNumber::default(), block_timestamp: BlockTimestamp::default(), sequencer_address: (*SEQUENCER_ADDRESS).into(), - fee_token_address: (*FEE_TOKEN_ADDRESS).into(), + fee_token_addresses: FeeTokenAddresses { + eth_fee_token_address: (*FEE_TOKEN_ADDRESS).into(), + strk_fee_token_address: Default::default(), + }, vm_resource_fee_cost: get_default_vm_resource_fee_cost().into(), - gas_price: DEFAULT_GAS_PRICE, + gas_prices: GasPrices { + eth_l1_gas_price: DEFAULT_GAS_PRICE, + strk_l1_gas_price: Default::default(), + }, invoke_tx_max_n_steps: 1_000_000, validate_max_n_steps: 1_000_000, max_recursion_depth: 100, diff --git a/crates/katana/core/src/sequencer.rs b/crates/katana/core/src/sequencer.rs index 53d688d20f..b5b648cc0c 100644 --- a/crates/katana/core/src/sequencer.rs +++ b/crates/katana/core/src/sequencer.rs @@ -5,6 +5,7 @@ use std::sync::Arc; use anyhow::Result; use blockifier::execution::errors::{EntryPointExecutionError, PreExecutionError}; +use blockifier::transaction::errors::TransactionExecutionError; use katana_executor::blockifier::state::StateRefDb; use katana_executor::blockifier::utils::EntryPointCall; use katana_executor::blockifier::PendingState; @@ -268,11 +269,13 @@ impl KatanaSequencer { let retdata = katana_executor::blockifier::utils::call(request, block_context, state) .map_err(|e| match e { - EntryPointExecutionError::PreExecutionError( - PreExecutionError::UninitializedStorageAddress(addr), - ) => SequencerError::ContractNotFound(addr.into()), - - _ => SequencerError::EntryPointExecution(e), + TransactionExecutionError::ExecutionError(exe) => match exe { + EntryPointExecutionError::PreExecutionError( + PreExecutionError::UninitializedStorageAddress(addr), + ) => SequencerError::ContractNotFound(addr.into()), + _ => SequencerError::EntryPointExecution(exe), + }, + _ => SequencerError::TransactionExecution(e), })?; Ok(retdata) diff --git a/crates/katana/executor/src/blockifier/mod.rs b/crates/katana/executor/src/blockifier/mod.rs index 0dc61e0aaf..124a74197c 100644 --- a/crates/katana/executor/src/blockifier/mod.rs +++ b/crates/katana/executor/src/blockifier/mod.rs @@ -143,6 +143,9 @@ fn execute_tx( block_context: &BlockContext, charge_fee: bool, ) -> TxExecutionResult { + // TODO: check how this value must be controlled. + let validate = true; + let sierra = if let ExecutableTx::Declare(DeclareTxWithClass { transaction, sierra_class: Some(sierra_class), @@ -156,10 +159,10 @@ fn execute_tx( let res = match BlockifierTx::from(tx).0 { Transaction::AccountTransaction(tx) => { - tx.execute(&mut state.inner(), block_context, charge_fee) + tx.execute(&mut state.inner(), block_context, charge_fee, validate) } Transaction::L1HandlerTransaction(tx) => { - tx.execute(&mut state.inner(), block_context, charge_fee) + tx.execute(&mut state.inner(), block_context, charge_fee, validate) } }; diff --git a/crates/katana/executor/src/blockifier/state.rs b/crates/katana/executor/src/blockifier/state.rs index efba599a7f..1037b3a7f6 100644 --- a/crates/katana/executor/src/blockifier/state.rs +++ b/crates/katana/executor/src/blockifier/state.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use blockifier::state::cached_state::CachedState; +use blockifier::state::cached_state::{CachedState, GlobalContractCache}; use blockifier::state::errors::StateError; use blockifier::state::state_api::StateReader; use katana_primitives::contract::SierraClass; @@ -99,11 +99,14 @@ pub struct CachedStateWrapper { impl CachedStateWrapper { pub fn new(db: S) -> Self { - Self { sierra_class: Default::default(), inner: Mutex::new(CachedState::new(db)) } + Self { + sierra_class: Default::default(), + inner: Mutex::new(CachedState::new(db, GlobalContractCache::default())), + } } pub fn reset_with_new_state(&self, db: S) { - *self.inner() = CachedState::new(db); + *self.inner() = CachedState::new(db, GlobalContractCache::default()); self.sierra_class_mut().clear(); } diff --git a/crates/katana/executor/src/blockifier/transactions.rs b/crates/katana/executor/src/blockifier/transactions.rs index 70f4b0c37d..04722e3505 100644 --- a/crates/katana/executor/src/blockifier/transactions.rs +++ b/crates/katana/executor/src/blockifier/transactions.rs @@ -1,14 +1,16 @@ use std::sync::Arc; use ::blockifier::transaction::transaction_execution::Transaction; -use ::blockifier::transaction::transactions::DeployAccountTransaction; +use ::blockifier::transaction::transactions::{DeployAccountTransaction, InvokeTransaction}; use blockifier::transaction::account_transaction::AccountTransaction; use blockifier::transaction::transactions::{DeclareTransaction, L1HandlerTransaction}; use katana_primitives::transaction::{DeclareTx, ExecutableTx, ExecutableTxWithHash}; use starknet_api::core::{ClassHash, CompiledClassHash, EntryPointSelector, Nonce}; use starknet_api::transaction::{ - Calldata, ContractAddressSalt, DeclareTransactionV0V1, DeclareTransactionV2, Fee, - InvokeTransaction, InvokeTransactionV1, TransactionHash, TransactionSignature, + Calldata, ContractAddressSalt, DeclareTransaction as ApiDeclareTransaction, + DeclareTransactionV0V1, DeclareTransactionV2, + DeployAccountTransaction as ApiDeployAccountTransaction, DeployAccountTransactionV1, Fee, + InvokeTransaction as ApiInvokeTransaction, TransactionHash, TransactionSignature, TransactionVersion, }; @@ -23,16 +25,17 @@ impl From for BlockifierTx { ExecutableTx::Invoke(tx) => { let calldata = tx.calldata.into_iter().map(|f| f.into()).collect(); let signature = tx.signature.into_iter().map(|f| f.into()).collect(); - Transaction::AccountTransaction(AccountTransaction::Invoke(InvokeTransaction::V1( - InvokeTransactionV1 { + Transaction::AccountTransaction(AccountTransaction::Invoke(InvokeTransaction { + tx: ApiInvokeTransaction::V1(starknet_api::transaction::InvokeTransactionV1 { max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce.into()), sender_address: tx.sender_address.into(), signature: TransactionSignature(signature), calldata: Calldata(Arc::new(calldata)), - transaction_hash: TransactionHash(hash.into()), - }, - ))) + }), + tx_hash: TransactionHash(hash.into()), + only_query: false, + })) } ExecutableTx::DeployAccount(tx) => { @@ -41,18 +44,18 @@ impl From for BlockifierTx { Transaction::AccountTransaction(AccountTransaction::DeployAccount( DeployAccountTransaction { contract_address: tx.contract_address.into(), - tx: starknet_api::transaction::DeployAccountTransaction { + tx: ApiDeployAccountTransaction::V1(DeployAccountTransactionV1 { max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce.into()), - version: TransactionVersion(1u128.into()), signature: TransactionSignature(signature), class_hash: ClassHash(tx.class_hash.into()), - transaction_hash: TransactionHash(hash.into()), constructor_calldata: Calldata(Arc::new(calldata)), contract_address_salt: ContractAddressSalt( tx.contract_address_salt.into(), ), - }, + }), + tx_hash: TransactionHash(hash.into()), + only_query: false, }, )) } @@ -63,31 +66,30 @@ impl From for BlockifierTx { let tx = match tx.transaction { DeclareTx::V1(tx) => { let signature = tx.signature.into_iter().map(|f| f.into()).collect(); - starknet_api::transaction::DeclareTransaction::V1(DeclareTransactionV0V1 { + ApiDeclareTransaction::V1(DeclareTransactionV0V1 { max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce.into()), sender_address: tx.sender_address.into(), signature: TransactionSignature(signature), class_hash: ClassHash(tx.class_hash.into()), - transaction_hash: TransactionHash(hash.into()), }) } DeclareTx::V2(tx) => { let signature = tx.signature.into_iter().map(|f| f.into()).collect(); - starknet_api::transaction::DeclareTransaction::V2(DeclareTransactionV2 { + ApiDeclareTransaction::V2(DeclareTransactionV2 { max_fee: Fee(tx.max_fee), nonce: Nonce(tx.nonce.into()), sender_address: tx.sender_address.into(), signature: TransactionSignature(signature), class_hash: ClassHash(tx.class_hash.into()), - transaction_hash: TransactionHash(hash.into()), compiled_class_hash: CompiledClassHash(tx.compiled_class_hash.into()), }) } }; - let tx = DeclareTransaction::new(tx, contract_class).expect("class mismatch"); + let tx = DeclareTransaction::new(tx, TransactionHash(hash.into()), contract_class) + .expect("class mismatch"); Transaction::AccountTransaction(AccountTransaction::Declare(tx)) } @@ -100,9 +102,9 @@ impl From for BlockifierTx { calldata: Calldata(Arc::new(calldata)), version: TransactionVersion(1u128.into()), contract_address: tx.contract_address.into(), - transaction_hash: TransactionHash(hash.into()), entry_point_selector: EntryPointSelector(tx.entry_point_selector.into()), }, + tx_hash: TransactionHash(hash.into()), }) } }; diff --git a/crates/katana/executor/src/blockifier/utils.rs b/crates/katana/executor/src/blockifier/utils.rs index cf8edbffb8..f0607992c9 100644 --- a/crates/katana/executor/src/blockifier/utils.rs +++ b/crates/katana/executor/src/blockifier/utils.rs @@ -2,16 +2,20 @@ use std::collections::HashMap; use std::sync::Arc; use ::blockifier::block_context::BlockContext; +use ::blockifier::execution::call_info::CallInfo; +use ::blockifier::execution::common_hints::ExecutionMode; use ::blockifier::execution::entry_point::{ - CallEntryPoint, CallInfo, EntryPointExecutionContext, ExecutionResources, + CallEntryPoint, EntryPointExecutionContext, ExecutionResources, }; use ::blockifier::execution::errors::EntryPointExecutionError; -use ::blockifier::state::cached_state::{CachedState, MutRefState}; +use ::blockifier::state::cached_state::{CachedState, GlobalContractCache, MutRefState}; use ::blockifier::transaction::objects::AccountTransactionContext; use blockifier::fee::fee_utils::{calculate_l1_gas_by_vm_usage, extract_l1_gas_and_vm_usage}; use blockifier::state::state_api::State; use blockifier::transaction::errors::TransactionExecutionError; -use blockifier::transaction::objects::{ResourcesMapping, TransactionExecutionInfo}; +use blockifier::transaction::objects::{ + DeprecatedAccountTransactionContext, ResourcesMapping, TransactionExecutionInfo, +}; use convert_case::{Case, Casing}; use katana_primitives::contract::ContractAddress; use katana_primitives::state::{StateUpdates, StateUpdatesWithDeclaredClasses}; @@ -43,8 +47,8 @@ pub fn call( request: EntryPointCall, block_context: BlockContext, state: Box, -) -> Result, EntryPointExecutionError> { - let res = raw_call(request, block_context, state, 1_000_000_000, 1_000_000_000)?; +) -> Result, TransactionExecutionError> { + let res = raw_call(request, block_context, state, 1_000_000_000)?; let retdata = res.execution.retdata.0; let retdata = retdata.into_iter().map(|f| f.into()).collect::>(); Ok(retdata) @@ -83,10 +87,9 @@ pub fn raw_call( block_context: BlockContext, state: Box, initial_gas: u64, - max_n_steps: usize, -) -> Result { - let mut state = CachedState::new(StateRefDb::from(state)); - let mut state = CachedState::new(MutRefState::new(&mut state)); +) -> Result { + let mut state = CachedState::new(StateRefDb::from(state), GlobalContractCache::default()); + let mut state = CachedState::new(MutRefState::new(&mut state), GlobalContractCache::default()); let call = CallEntryPoint { initial_gas, @@ -96,15 +99,28 @@ pub fn raw_call( ..Default::default() }; + // TODO: this must be false if fees are disabled I assume. + let limit_steps_by_resources = true; + + // Now, the max step is not given directly to this function. + // It's computed by a new function max_steps, and it tooks the values + // from teh block context itself instead of the input give. + // https://github.com/starkware-libs/blockifier/blob/51b343fe38139a309a69b2482f4b484e8caa5edf/crates/blockifier/src/execution/entry_point.rs#L165 + // The blockifier patch must be adjusted to modify this function to return + // the limit we have into the block context without min applied: + // https://github.com/starkware-libs/blockifier/blob/51b343fe38139a309a69b2482f4b484e8caa5edf/crates/blockifier/src/execution/entry_point.rs#L215 call.execute( &mut state, &mut ExecutionResources::default(), &mut EntryPointExecutionContext::new( - block_context, - AccountTransactionContext::default(), - max_n_steps, - ), + &block_context, + // TODO: the current does not have Default, let's use the old one for now. + &AccountTransactionContext::Deprecated(DeprecatedAccountTransactionContext::default()), + ExecutionMode::Execute, + limit_steps_by_resources, + )?, ) + .map_err(TransactionExecutionError::ExecutionError) } /// Calculate the fee of a transaction execution. @@ -117,7 +133,11 @@ pub fn calculate_execution_fee( let total_l1_gas_usage = l1_gas_usage as f64 + l1_gas_by_vm_usage; - let gas_price = block_context.gas_price as u64; + // Gas prices are now in two currencies: eth and strk. + // For now let's only consider eth to be compatible with V2. + // https://github.com/starkware-libs/blockifier/blob/51b343fe38139a309a69b2482f4b484e8caa5edf/crates/blockifier/src/block_context.rs#L19C26-L19C26 + // https://github.com/starkware-libs/blockifier/blob/51b343fe38139a309a69b2482f4b484e8caa5edf/crates/blockifier/src/block_context.rs#L49 + let gas_price = block_context.gas_prices.eth_l1_gas_price as u64; let gas_consumed = total_l1_gas_usage.ceil() as u64; let overall_fee = total_l1_gas_usage.ceil() as u64 * gas_price; @@ -126,8 +146,7 @@ pub fn calculate_execution_fee( pub(crate) fn warn_message_transaction_error_exec_error(err: &TransactionExecutionError) { match err { - TransactionExecutionError::EntryPointExecutionError(ref eperr) - | TransactionExecutionError::ExecutionError(ref eperr) => match eperr { + TransactionExecutionError::ExecutionError(ref eperr) => match eperr { EntryPointExecutionError::ExecutionFailed { error_data } => { let mut reasons: Vec = vec![]; error_data.iter().for_each(|felt| { diff --git a/crates/katana/rpc/src/starknet.rs b/crates/katana/rpc/src/starknet.rs index 7aac882eac..a10e6c56dd 100644 --- a/crates/katana/rpc/src/starknet.rs +++ b/crates/katana/rpc/src/starknet.rs @@ -122,7 +122,7 @@ impl StarknetApiServer for StarknetApi { let header = PartialHeader { parent_hash: latest_hash, - gas_price: block_context.gas_price, + gas_price: block_context.gas_prices.eth_l1_gas_price, number: block_context.block_number.0, timestamp: block_context.block_timestamp.0, sequencer_address: block_context.sequencer_address.into(), @@ -191,7 +191,7 @@ impl StarknetApiServer for StarknetApi { let header = PartialHeader { parent_hash: latest_hash, - gas_price: block_context.gas_price, + gas_price: block_context.gas_prices.eth_l1_gas_price, number: block_context.block_number.0, timestamp: block_context.block_timestamp.0, sequencer_address: block_context.sequencer_address.into(), diff --git a/crates/katana/src/args.rs b/crates/katana/src/args.rs index 070f5b6c56..ed2b8238ee 100644 --- a/crates/katana/src/args.rs +++ b/crates/katana/src/args.rs @@ -231,7 +231,7 @@ mod test { fn default_block_context_from_args() { let args = KatanaArgs::parse_from(["katana"]); let block_context = args.starknet_config().block_context(); - assert_eq!(block_context.gas_price, DEFAULT_GAS_PRICE); + assert_eq!(block_context.gas_prices.eth_l1_gas_price, DEFAULT_GAS_PRICE); assert_eq!(block_context.chain_id.0, "KATANA".to_string()); assert_eq!(block_context.validate_max_n_steps, DEFAULT_VALIDATE_MAX_STEPS); assert_eq!(block_context.invoke_tx_max_n_steps, DEFAULT_INVOKE_MAX_STEPS); @@ -253,7 +253,7 @@ mod test { let block_context = args.starknet_config().block_context(); - assert_eq!(block_context.gas_price, 10); + assert_eq!(block_context.gas_prices.eth_l1_gas_price, 10); assert_eq!(block_context.chain_id.0, "SN_GOERLI".to_string()); assert_eq!(block_context.validate_max_n_steps, 100); assert_eq!(block_context.invoke_tx_max_n_steps, 200); diff --git a/crates/katana/storage/db/Cargo.toml b/crates/katana/storage/db/Cargo.toml index adf0975273..ef4fdd5526 100644 --- a/crates/katana/storage/db/Cargo.toml +++ b/crates/katana/storage/db/Cargo.toml @@ -20,4 +20,4 @@ thiserror.workspace = true [dependencies.libmdbx] git = "https://github.com/paradigmxyz/reth.git" package = "reth-libmdbx" -version = "=0.1.0-alpha.12" +version = "=0.1.0-alpha.13" diff --git a/crates/sozo/Cargo.toml b/crates/sozo/Cargo.toml index 24418dabef..d6fbb86796 100644 --- a/crates/sozo/Cargo.toml +++ b/crates/sozo/Cargo.toml @@ -18,6 +18,7 @@ cairo-lang-sierra.workspace = true cairo-lang-starknet.workspace = true cairo-lang-test-plugin.workspace = true cairo-lang-test-runner.workspace = true +cairo-lang-utils.workspace = true camino.workspace = true clap-verbosity-flag = "2.0.1" clap.workspace = true diff --git a/crates/sozo/src/commands/build.rs b/crates/sozo/src/commands/build.rs index 860978b49d..6c5695fd0f 100644 --- a/crates/sozo/src/commands/build.rs +++ b/crates/sozo/src/commands/build.rs @@ -1,19 +1,17 @@ use anyhow::Result; use clap::Args; +use dojo_lang::scarb_internal::compile_workspace; use scarb::core::{Config, TargetKind}; -use scarb::ops::{self, CompileOpts}; +use scarb::ops::CompileOpts; #[derive(Args, Debug)] pub struct BuildArgs; impl BuildArgs { pub fn run(self, config: &Config) -> Result<()> { - let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let packages = ws.members().map(|p| p.id).collect(); - ops::compile( - packages, + compile_workspace( + config, CompileOpts { include_targets: vec![], exclude_targets: vec![TargetKind::TEST] }, - &ws, ) } } diff --git a/crates/sozo/src/commands/dev.rs b/crates/sozo/src/commands/dev.rs index 744bfffb99..b55a24b9af 100644 --- a/crates/sozo/src/commands/dev.rs +++ b/crates/sozo/src/commands/dev.rs @@ -8,6 +8,7 @@ use cairo_lang_compiler::db::RootDatabase; use cairo_lang_filesystem::db::{AsFilesGroupMut, FilesGroupEx, PrivRawFileContentQuery}; use cairo_lang_filesystem::ids::FileId; use clap::Args; +use dojo_lang::scarb_internal::build_scarb_root_database; use dojo_world::manifest::Manifest; use dojo_world::migration::world::WorldDiff; use notify_debouncer_mini::notify::RecursiveMode; @@ -23,7 +24,6 @@ use tracing_log::log; use super::options::account::AccountOptions; use super::options::starknet::StarknetOptions; use super::options::world::WorldOptions; -use super::scarb_internal::build_scarb_root_database; use crate::ops::migration; #[derive(Args)] @@ -85,9 +85,11 @@ fn load_context(config: &Config) -> Result> { .into_iter() .filter(|cu| packages.contains(&cu.main_package_id)) .collect::>(); + // we have only 1 unit in projects + // TODO: double check if we always have one with the new version and the order if many. let unit = compilation_units.first().unwrap(); - let db = build_scarb_root_database(unit, &ws).unwrap(); + let db = build_scarb_root_database(unit).unwrap(); Ok(DevContext { db, unit: unit.clone(), ws }) } diff --git a/crates/sozo/src/commands/migrate.rs b/crates/sozo/src/commands/migrate.rs index a37e578fa2..7664d5bb8d 100644 --- a/crates/sozo/src/commands/migrate.rs +++ b/crates/sozo/src/commands/migrate.rs @@ -1,5 +1,6 @@ use anyhow::Result; use clap::Args; +use dojo_lang::scarb_internal::compile_workspace; use scarb::core::{Config, TargetKind}; use scarb::ops::CompileOpts; @@ -49,11 +50,9 @@ impl MigrateArgs { let target_dir = target_dir.join(ws.config().profile().as_str()); if !target_dir.join("manifest.json").exists() { - let packages = ws.members().map(|p| p.id).collect(); - scarb::ops::compile( - packages, + compile_workspace( + config, CompileOpts { include_targets: vec![], exclude_targets: vec![TargetKind::TEST] }, - &ws, )?; } diff --git a/crates/sozo/src/commands/mod.rs b/crates/sozo/src/commands/mod.rs index e093ab8ab8..8281d5cc41 100644 --- a/crates/sozo/src/commands/mod.rs +++ b/crates/sozo/src/commands/mod.rs @@ -16,9 +16,6 @@ pub(crate) mod options; pub(crate) mod register; pub(crate) mod test; -// copy of non pub functions from scarb -pub(crate) mod scarb_internal; - pub fn run(command: Commands, config: &Config) -> Result<()> { match command { Commands::Init(args) => args.run(config), diff --git a/crates/sozo/src/commands/scarb_internal/mod.rs b/crates/sozo/src/commands/scarb_internal/mod.rs deleted file mode 100644 index a7f3379580..0000000000 --- a/crates/sozo/src/commands/scarb_internal/mod.rs +++ /dev/null @@ -1,55 +0,0 @@ -// I have copied source code from https://github.com/software-mansion/scarb/blob/main/scarb/src/compiler/db.rs -// since build_scarb_root_database is not public -// -// NOTE: This files needs to be updated whenever scarb version is updated -use anyhow::Result; -use cairo_lang_compiler::db::RootDatabase; -use cairo_lang_compiler::project::{ProjectConfig, ProjectConfigContent}; -use cairo_lang_filesystem::ids::Directory; -use scarb::compiler::CompilationUnit; -use scarb::core::Workspace; -use tracing::trace; - -// TODO(mkaput): ScarbDatabase? -pub(crate) fn build_scarb_root_database( - unit: &CompilationUnit, - ws: &Workspace<'_>, -) -> Result { - let mut b = RootDatabase::builder(); - b.with_project_config(build_project_config(unit)?); - b.with_cfg(unit.cfg_set.clone()); - - for plugin_info in &unit.cairo_plugins { - let package_id = plugin_info.package.id; - let plugin = ws.config().cairo_plugins().fetch(package_id)?; - let instance = plugin.instantiate()?; - for macro_plugin in instance.macro_plugins() { - b.with_macro_plugin(macro_plugin); - } - for (name, inline_macro_plugin) in instance.inline_macro_plugins() { - b.with_inline_macro_plugin(&name, inline_macro_plugin); - } - } - - b.build() -} - -fn build_project_config(unit: &CompilationUnit) -> Result { - let crate_roots = unit - .components - .iter() - .filter(|model| !model.package.id.is_core()) - .map(|model| (model.cairo_package_name(), model.target.source_root().into())) - .collect(); - - let corelib = Some(Directory::Real(unit.core_package_component().target.source_root().into())); - - let content = ProjectConfigContent { crate_roots }; - - let project_config = - ProjectConfig { base_path: unit.main_component().package.root().into(), corelib, content }; - - trace!(?project_config); - - Ok(project_config) -} diff --git a/crates/sozo/src/commands/test.rs b/crates/sozo/src/commands/test.rs index ff73c9ab3a..b464a78e76 100644 --- a/crates/sozo/src/commands/test.rs +++ b/crates/sozo/src/commands/test.rs @@ -1,23 +1,17 @@ //! Compiles and runs tests for a Dojo project. - -use std::sync::Arc; - use anyhow::{bail, Result}; use cairo_lang_compiler::db::RootDatabase; use cairo_lang_compiler::diagnostics::DiagnosticsReporter; use cairo_lang_compiler::project::{ProjectConfig, ProjectConfigContent}; use cairo_lang_filesystem::cfg::{Cfg, CfgSet}; use cairo_lang_filesystem::ids::Directory; -use cairo_lang_starknet::inline_macros::selector::SelectorMacro; -use cairo_lang_starknet::plugin::StarkNetPlugin; -use cairo_lang_test_plugin::TestPlugin; +use cairo_lang_starknet::starknet_plugin_suite; +use cairo_lang_test_plugin::test_plugin_suite; use cairo_lang_test_runner::{CompiledTestRunner, TestCompiler, TestRunConfig}; use clap::Args; use dojo_lang::compiler::{collect_core_crate_ids, collect_external_crate_ids, Props}; -use dojo_lang::inline_macros::emit::EmitMacro; -use dojo_lang::inline_macros::get::GetMacro; -use dojo_lang::inline_macros::set::SetMacro; -use dojo_lang::plugin::BuiltinDojoPlugin; +use dojo_lang::plugin::dojo_plugin_suite; +use dojo_lang::scarb_internal::crates_config_for_compilation_unit; use scarb::compiler::helpers::collect_main_crate_ids; use scarb::compiler::CompilationUnit; use scarb::core::Config; @@ -94,14 +88,9 @@ pub(crate) fn build_root_database(unit: &CompilationUnit) -> Result Result { .collect(); let corelib = Some(Directory::Real(unit.core_package_component().target.source_root().into())); + let crates_config = crates_config_for_compilation_unit(unit); - let content = ProjectConfigContent { crate_roots }; + let content = ProjectConfigContent { crate_roots, crates_config }; let project_config = ProjectConfig { base_path: unit.main_component().package.root().into(), corelib, content }; diff --git a/crates/sozo/src/ops/migration/mod.rs b/crates/sozo/src/ops/migration/mod.rs index fe9d700efb..7b1c04adcc 100644 --- a/crates/sozo/src/ops/migration/mod.rs +++ b/crates/sozo/src/ops/migration/mod.rs @@ -52,7 +52,7 @@ where // Load local and remote World manifests. let (local_manifest, remote_manifest) = - load_world_manifests(&target_dir, &account, world_address, ui).await?; + load_world_manifests(&target_dir, &account, world_address, &ui).await?; // Calculate diff between local and remote World manifests. @@ -129,7 +129,7 @@ where S: Signer + Sync + Send + 'static, { let ui = ws.config().ui(); - let strategy = prepare_migration(target_dir, diff, name, world_address, ui)?; + let strategy = prepare_migration(target_dir, diff, name, world_address, &ui)?; println!(" "); @@ -288,7 +288,7 @@ where match &strategy.executor { Some(executor) => { ui.print_header("# Executor"); - deploy_contract(executor, "executor", vec![], migrator, ui, &txn_config).await?; + deploy_contract(executor, "executor", vec![], migrator, &ui, &txn_config).await?; // There is no world migration, so it exists already. if strategy.world.is_none() { @@ -336,7 +336,9 @@ where strategy.executor.as_ref().unwrap().contract_address, strategy.base.as_ref().unwrap().diff.local, ]; - deploy_contract(world, "world", calldata.clone(), migrator, ui, &txn_config).await?; + deploy_contract(world, "world", calldata.clone(), migrator, &ui, &txn_config) + .await + .map_err(|e| anyhow!("Failed to deploy world: {e}"))?; ui.print_sub(format!("Contract address: {:#x}", world.contract_address)); @@ -362,8 +364,8 @@ where None => {} }; - register_models(strategy, migrator, ui, txn_config.clone()).await?; - deploy_contracts(strategy, migrator, ui, txn_config).await?; + register_models(strategy, migrator, &ui, txn_config.clone()).await?; + deploy_contracts(strategy, migrator, &ui, txn_config).await?; // This gets current block numder if helpful // let block_height = migrator.provider().block_number().await.ok(); diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index 927faf3a0a..667a47ea17 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -252,7 +252,7 @@ pub async fn spinup_types_test() -> Result { execute_strategy(&ws, &migration, &account, None).await.unwrap(); // Execute `create` and insert 10 records into storage - let records_contract = "0x2e6254aaf7e47502319f35de01376cece263f9b83afe6169a4b3a76ef47c8a3"; + let records_contract = "0x414e9776a1626963ba21c4f45ddd7b4d2ac907d20c230e9c6a2e6119c2e5d"; let InvokeTransactionResult { transaction_hash } = account .execute(vec![Call { calldata: vec![FieldElement::from_str("0xa").unwrap()], diff --git a/crates/torii/graphql/src/tests/types-test/Scarb.lock b/crates/torii/graphql/src/tests/types-test/Scarb.lock index 6a1758f1d7..e229ddf091 100644 --- a/crates/torii/graphql/src/tests/types-test/Scarb.lock +++ b/crates/torii/graphql/src/tests/types-test/Scarb.lock @@ -10,8 +10,7 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.3.11" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7d8aa29a92062fcb9e6659" +version = "0.4.0" [[package]] name = "types_test" diff --git a/examples/spawn-and-move/.tool-versions b/examples/spawn-and-move/.tool-versions new file mode 100644 index 0000000000..21cfc80772 --- /dev/null +++ b/examples/spawn-and-move/.tool-versions @@ -0,0 +1 @@ +scarb 2.4.0 diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 97759bbd25..0e594f379c 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,5 +1,5 @@ [package] -cairo-version = "2.3.1" +cairo-version = "2.4.0" name = "dojo_examples" version = "0.4.0-rc0"