From d7930e6d649f908960adf73d4fd8f9475f9f0f24 Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 25 Nov 2024 12:40:39 -0600 Subject: [PATCH] fix: ensure the manifest existence is correctly tested (#2713) * fix: ensure the manifest existence is correctly tested * tests: fix policies --- bin/sozo/tests/test_data/policies.json | 82 +++++++++++------------ crates/sozo/ops/src/migration_ui.rs | 2 +- crates/sozo/scarbext/src/workspace.rs | 2 +- crates/torii/types-test/Scarb.lock | 2 +- examples/simple/Scarb.lock | 2 +- examples/simple/Scarb.toml | 2 +- examples/spawn-and-move/Scarb.lock | 2 +- examples/spawn-and-move/manifest_dev.json | 18 ++--- 8 files changed, 56 insertions(+), 56 deletions(-) diff --git a/bin/sozo/tests/test_data/policies.json b/bin/sozo/tests/test_data/policies.json index 2c336026ad..b61f8c47b4 100644 --- a/bin/sozo/tests/test_data/policies.json +++ b/bin/sozo/tests/test_data/policies.json @@ -1,130 +1,130 @@ [ { - "target": "0x7e2c18814dd45847ae85d3c8eb40196cc2aa869614efd1ff67edf380c45cb8e", - "method": "upgrade" - }, - { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "uuid" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "set_metadata" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "register_namespace" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "register_event" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "register_model" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "register_contract" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "init_contract" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "upgrade_event" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "upgrade_model" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "upgrade_contract" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "emit_event" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "emit_events" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "set_entity" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "set_entities" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "delete_entity" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "delete_entities" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "grant_owner" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "revoke_owner" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "grant_writer" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "method": "revoke_writer" }, { - "target": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "target": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", + "method": "upgrade" + }, + { + "target": "0x7e5b903baa82407f74bd0a573352e0ca33f2b9fac3bcc2e35230119841cd08", + "method": "upgrade" + }, + { + "target": "0x32bc6ef441c52acfc62ee1186885760803d88e165119fdad6e16f9424547981", "method": "upgrade" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x72b95d835f6158dd1454c1b4463a91222c6088f1bf5dd2cdd09268f92dad16f", + "method": "upgrade" + }, + { + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "spawn" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "move" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "set_player_config" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "reset_player_config" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "set_player_server_profile" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "set_models" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "enter_dungeon" }, { - "target": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", - "method": "upgrade" - }, - { - "target": "0x7077c3246c125a91b17e8c0a90f45af790ad6feabe65a3df225277d9eb02310", - "method": "upgrade" - }, - { - "target": "0x74967fafd9ea26b0c14287fdafa5867cf6e2d16d9e6fda3dde4361a7cf75c9d", + "target": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", "method": "upgrade" }, { diff --git a/crates/sozo/ops/src/migration_ui.rs b/crates/sozo/ops/src/migration_ui.rs index 1dc629f444..df2e31cd94 100644 --- a/crates/sozo/ops/src/migration_ui.rs +++ b/crates/sozo/ops/src/migration_ui.rs @@ -22,7 +22,7 @@ impl MigrationUi { /// Returns a new instance with the default frames. pub fn new(text: Option<&'static str>) -> Self { if let Some(text) = text { - let frames = spinner!(["⛩️ ", "🥷", "🗡️ "], 500); + let frames = spinner!(["⛩️ ", "🥷 ", "🗡️ "], 500); let spinner = Spinner::new(frames.clone(), text, None); Self { spinner, default_frames: frames, silent: false } } else { diff --git a/crates/sozo/scarbext/src/workspace.rs b/crates/sozo/scarbext/src/workspace.rs index 224eb410fc..c18582a93c 100644 --- a/crates/sozo/scarbext/src/workspace.rs +++ b/crates/sozo/scarbext/src/workspace.rs @@ -146,7 +146,7 @@ impl WorkspaceExt for Workspace<'_> { let manifest_dir = self.manifest_path().parent().unwrap(); let manifest_dir = Filesystem::new(manifest_dir.into()); - if !manifest_dir.exists() { + if !manifest_dir.child(manifest_name.clone()).exists() { return Ok(None); } diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index 0d453bfdcb..6d49c5fc86 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -14,7 +14,7 @@ version = "2.8.4" [[package]] name = "types_test" -version = "1.0.0" +version = "1.0.1" dependencies = [ "dojo", ] diff --git a/examples/simple/Scarb.lock b/examples/simple/Scarb.lock index 4067faed93..83d7d63f53 100644 --- a/examples/simple/Scarb.lock +++ b/examples/simple/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "1.0.0" +version = "1.0.1" dependencies = [ "dojo_plugin", ] diff --git a/examples/simple/Scarb.toml b/examples/simple/Scarb.toml index 088aba4870..388df4c4b1 100644 --- a/examples/simple/Scarb.toml +++ b/examples/simple/Scarb.toml @@ -6,7 +6,7 @@ edition = "2024_07" [[target.starknet-contract]] sierra = true -# casm = true +casm = true build-external-contracts = ["dojo::world::world_contract::world"] [dependencies] diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index a3ce4d9320..95abffec9e 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -31,7 +31,7 @@ dependencies = [ [[package]] name = "dojo_examples" -version = "1.0.0" +version = "1.0.1" dependencies = [ "armory", "bestiary", diff --git a/examples/spawn-and-move/manifest_dev.json b/examples/spawn-and-move/manifest_dev.json index 0e88c840b8..7a92b22fe5 100644 --- a/examples/spawn-and-move/manifest_dev.json +++ b/examples/spawn-and-move/manifest_dev.json @@ -1,7 +1,7 @@ { "world": { - "class_hash": "0x2f92b70bd2b5a40ddef12c55257f245176870b25c7eb0bd7a60cf1f1f2fbf0e", - "address": "0x54d0f13bf3fb5f15a8674c5204aad35e3022af96bcc23bdbd16b7e297ffd399", + "class_hash": "0x79d9ce84b97bcc2a631996c3100d57966fc2f5b061fb1ec4dfd0040976bcac6", + "address": "0x70058e3886cb7411e8a77db90ee3dd453ac16b763b30bd99b3c8440fe42056e", "seed": "dojo_examples", "name": "example", "entrypoints": [ @@ -1243,8 +1243,8 @@ }, "contracts": [ { - "address": "0x7d32611d1b96df37b041f0a285bf340227cebc144d46c2f34cedd81e2fd5239", - "class_hash": "0x3449ac13c575e4ed3a0e897bf16929f449f0fadea49b119dd25046f6b347301", + "address": "0x1cc5853cbf65c96d7c3c8f951e6315f3c1f19a34ace7b579da9ba87b974dce3", + "class_hash": "0x636c2cf31b094097625cb5ada96f54ee9a3f7bc6d8cde00cc85e5ef0c622c8b", "abi": [ { "type": "impl", @@ -1584,7 +1584,7 @@ ] }, { - "address": "0x74967fafd9ea26b0c14287fdafa5867cf6e2d16d9e6fda3dde4361a7cf75c9d", + "address": "0x32bc6ef441c52acfc62ee1186885760803d88e165119fdad6e16f9424547981", "class_hash": "0x16e8d864b5b5484bad069133a751f72961f9e5edade4f4f3b3b6076f6394c5b", "abi": [ { @@ -1778,7 +1778,7 @@ ] }, { - "address": "0x7077c3246c125a91b17e8c0a90f45af790ad6feabe65a3df225277d9eb02310", + "address": "0x7e5b903baa82407f74bd0a573352e0ca33f2b9fac3bcc2e35230119841cd08", "class_hash": "0x43e7cc34a35abdb9baf6804c71526811d8d3cccf58d66be5a095bd79b9be82e", "abi": [ { @@ -1954,7 +1954,7 @@ ] }, { - "address": "0x7e2c18814dd45847ae85d3c8eb40196cc2aa869614efd1ff67edf380c45cb8e", + "address": "0x72b95d835f6158dd1454c1b4463a91222c6088f1bf5dd2cdd09268f92dad16f", "class_hash": "0xa1884cbaa79b05287019b513a94f993f0d98ed4d9602370bc2e5aaa04feebc", "abi": [ { @@ -2178,13 +2178,13 @@ "events": [ { "members": [], - "class_hash": "0x3dc79bcf7e88304d1331cdf9e232ff9f78ac19a719e998bd68016eb5ebb3e38", + "class_hash": "0x2999886b1a0ee530eb279f9808632b70750ac93418da8493fb554eebfb7b99a", "tag": "ns-Moved", "selector": "0x6d4c1ac3717ba997500153c52344a2acac5123bbfa0f78d3dcc04cb786826b0" }, { "members": [], - "class_hash": "0x7ddb49b2db32089d1bb14a6f66d91582fffdd09d18325187840de65ae443598", + "class_hash": "0x4771fc691467af7b9b606ae34d5fa9abe762adb856d65d2c508ce66b3941671", "tag": "ns-MyInit", "selector": "0xe1c030210beae7e2153a7b996d7d2ae6a428faf16a61f192f02178718b6f0" }