From d90730f1aed385083899bebddb730269ecd4f9c0 Mon Sep 17 00:00:00 2001 From: Asuma Yamada Date: Wed, 13 Nov 2024 14:01:27 +0900 Subject: [PATCH] fix: remove overlay and add config to dojo config files --- .gitignore | 2 +- contracts/.vscode/tasks.json | 4 +- contracts/Scarb.lock | 2 +- contracts/dojo_dev-pop.toml | 15 +++++++ contracts/dojo_dev.toml | 21 +++++++-- contracts/dojo_sepolia.toml | 16 +++++++ contracts/dojo_slot.toml | 16 +++++++ contracts/output.txt | 43 ------------------- contracts/overlays/dev-pop/core_actions.toml | 11 ----- contracts/overlays/dev-pop/paint_actions.toml | 2 - contracts/overlays/dev-pop/snake_actions.toml | 2 - contracts/overlays/dev/core_actions.toml | 11 ----- contracts/overlays/dev/paint_actions.toml | 2 - contracts/overlays/dev/snake_actions.toml | 2 - contracts/overlays/sepolia/core_actions.toml | 11 ----- contracts/overlays/sepolia/paint_actions.toml | 2 - contracts/overlays/sepolia/snake_actions.toml | 2 - 17 files changed, 69 insertions(+), 95 deletions(-) delete mode 100644 contracts/output.txt delete mode 100644 contracts/overlays/dev-pop/core_actions.toml delete mode 100644 contracts/overlays/dev-pop/paint_actions.toml delete mode 100644 contracts/overlays/dev-pop/snake_actions.toml delete mode 100644 contracts/overlays/dev/core_actions.toml delete mode 100644 contracts/overlays/dev/paint_actions.toml delete mode 100644 contracts/overlays/dev/snake_actions.toml delete mode 100644 contracts/overlays/sepolia/core_actions.toml delete mode 100644 contracts/overlays/sepolia/paint_actions.toml delete mode 100644 contracts/overlays/sepolia/snake_actions.toml diff --git a/.gitignore b/.gitignore index cb38176..b79746a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,9 @@ target/ contracts/out +contracts/db contracts/target contracts/manifest_dev.json *.account.json *.keystore.json - diff --git a/contracts/.vscode/tasks.json b/contracts/.vscode/tasks.json index 001c2f5..481f2a5 100644 --- a/contracts/.vscode/tasks.json +++ b/contracts/.vscode/tasks.json @@ -4,7 +4,7 @@ { "label": "Start Katana", "type": "shell", - "command": "katana --disable-fee --allowed-origins '*' --db-dir db/katana", + "command": "katana --http.cors_origins '*' --db-dir db/katana", "isBackground": true, "problemMatcher": [], "presentation": { @@ -16,7 +16,7 @@ { "label": "Start Torii", "type": "shell", - "command": "torii --world 0x263ae44e5414519a5c5a135cccaf3d9d7ee196d37e8de47a178da91f3de9b34 --database db/torii --allowed-origins '*'", + "command": "torii --world 0x06f130c8e150882e39cbe878c650c8f35c86579180dbc77d0c1cbe169449b5f6 --http.cors_origins '*' --db-dir db/torii", "isBackground": true, "problemMatcher": [], "presentation": { diff --git a/contracts/Scarb.lock b/contracts/Scarb.lock index 8f78232..ebbe1db 100644 --- a/contracts/Scarb.lock +++ b/contracts/Scarb.lock @@ -24,7 +24,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331 [[package]] name = "pixelaw" -version = "0.5.0" +version = "0.5.1" dependencies = [ "dojo", "dojo_cairo_test", diff --git a/contracts/dojo_dev-pop.toml b/contracts/dojo_dev-pop.toml index 9e3e8c2..06dc88f 100644 --- a/contracts/dojo_dev-pop.toml +++ b/contracts/dojo_dev-pop.toml @@ -13,3 +13,18 @@ account_address = "0x3c4dd268780ef738920c801edc3a75b6337bc17558c74795b530c0ff502 private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a" world_address = "0x5729e109ed70ce4f33e3164505c78476e9fec57874b69467cdf0ba51636085" +[writers] +"pixelaw-App" = ["pixelaw-actions"] +"pixelaw-AppName" = ["pixelaw-actions"] +"pixelaw-AppUser" = ["pixelaw-actions"] +"pixelaw-CoreActionsAddress" = ["pixelaw-actions"] +"pixelaw-Pixel" = [ + "pixelaw-actions", + "pixelaw-paint_actions", + "pixelaw-snake_actions", +] +"pixelaw-QueueItem" = ["pixelaw-actions"] +"pixelaw-Snake" = ["pixelaw-actions", "pixelaw-snake_actions"] +"pixelaw-RTree" = ["pixelaw-actions"] +"pixelaw-Area" = ["pixelaw-actions"] +"pixelaw-SnakeSegment" = ["pixelaw-snake_actions"] diff --git a/contracts/dojo_dev.toml b/contracts/dojo_dev.toml index 704dc29..dcded90 100644 --- a/contracts/dojo_dev.toml +++ b/contracts/dojo_dev.toml @@ -9,7 +9,22 @@ mappings = {} [env] rpc_url = "http://localhost:5050/" -account_address = "0x3c4dd268780ef738920c801edc3a75b6337bc17558c74795b530c0ff502486" -private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a" -world_address = "0x6f130c8e150882e39cbe878c650c8f35c86579180dbc77d0c1cbe169449b5f6" +account_address = "0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec" +private_key = "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912" +world_address = "0x06f130c8e150882e39cbe878c650c8f35c86579180dbc77d0c1cbe169449b5f6" +[writers] +"pixelaw-App" = ["pixelaw-actions"] +"pixelaw-AppName" = ["pixelaw-actions"] +"pixelaw-AppUser" = ["pixelaw-actions"] +"pixelaw-CoreActionsAddress" = ["pixelaw-actions"] +"pixelaw-Pixel" = [ + "pixelaw-actions", + "pixelaw-paint_actions", + "pixelaw-snake_actions", +] +"pixelaw-QueueItem" = ["pixelaw-actions"] +"pixelaw-Snake" = ["pixelaw-actions", "pixelaw-snake_actions"] +"pixelaw-RTree" = ["pixelaw-actions"] +"pixelaw-Area" = ["pixelaw-actions"] +"pixelaw-SnakeSegment" = ["pixelaw-snake_actions"] diff --git a/contracts/dojo_sepolia.toml b/contracts/dojo_sepolia.toml index 594ee5b..0f8ddbd 100644 --- a/contracts/dojo_sepolia.toml +++ b/contracts/dojo_sepolia.toml @@ -17,3 +17,19 @@ rpc_url = "https://starknet-sepolia.public.blastapi.io/rpc/v0_7" keystore_path = "accounts/deployer.keystore.json" account_address = "0x02c306e30b02a1a734bc770af37b32619911f1cfd6ccecb93c5899632f379da9" world_address = "0x4adbe4bfe631a95a5ce99d8200a8721b1ac8096ff8941cecddc4e79a7b2d5d5" + +[writers] +"pixelaw-App" = ["pixelaw-actions"] +"pixelaw-AppName" = ["pixelaw-actions"] +"pixelaw-AppUser" = ["pixelaw-actions"] +"pixelaw-CoreActionsAddress" = ["pixelaw-actions"] +"pixelaw-Pixel" = [ + "pixelaw-actions", + "pixelaw-paint_actions", + "pixelaw-snake_actions", +] +"pixelaw-QueueItem" = ["pixelaw-actions"] +"pixelaw-Snake" = ["pixelaw-actions", "pixelaw-snake_actions"] +"pixelaw-RTree" = ["pixelaw-actions"] +"pixelaw-Area" = ["pixelaw-actions"] +"pixelaw-SnakeSegment" = ["pixelaw-snake_actions"] diff --git a/contracts/dojo_slot.toml b/contracts/dojo_slot.toml index 0d7a151..bfe5af9 100644 --- a/contracts/dojo_slot.toml +++ b/contracts/dojo_slot.toml @@ -16,3 +16,19 @@ rpc_url = "https://api.cartridge.gg/x/pixelaw-dev/katana/" account_address = "0x75aab901b406698604a33f1c81c6487b8de3b2d7ad2456cf01658b68b12aa5" private_key = "0x74825107c10098a1a991b1419e0afad3afc9e9ba4d16dec23995916cdca4366" world_address = "0x263ae44e5414519a5c5a135cccaf3d9d7ee196d37e8de47a178da91f3de9b34" + +[writers] +"pixelaw-App" = ["pixelaw-actions"] +"pixelaw-AppName" = ["pixelaw-actions"] +"pixelaw-AppUser" = ["pixelaw-actions"] +"pixelaw-CoreActionsAddress" = ["pixelaw-actions"] +"pixelaw-Pixel" = [ + "pixelaw-actions", + "pixelaw-paint_actions", + "pixelaw-snake_actions", +] +"pixelaw-QueueItem" = ["pixelaw-actions"] +"pixelaw-Snake" = ["pixelaw-actions", "pixelaw-snake_actions"] +"pixelaw-RTree" = ["pixelaw-actions"] +"pixelaw-Area" = ["pixelaw-actions"] +"pixelaw-SnakeSegment" = ["pixelaw-snake_actions"] diff --git a/contracts/output.txt b/contracts/output.txt deleted file mode 100644 index a3d923a..0000000 --- a/contracts/output.txt +++ /dev/null @@ -1,43 +0,0 @@ -testing test(pixelaw_unittest) pixelaw v0.4.7 (/home/caspar/Development/core/contracts/Scarb.toml) -2024-11-05T21:31:51.933657Z  WARN Subcommand{name="Test"}: log: Function `pixelaw::core::tests::helpers::setup_apps` has semantic diagnostics in its body: -error[E0002]: Method `deploy_contract` not found on type `dojo::world::storage::WorldStorage`. Did you import the correct trait and impl? - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:120:10 - .deploy_contract('salt3', paint_actions::TEST_CLASS_HASH.try_into().unwrap()); - ^*************^ - -error[E0002]: Method `deploy_contract` not found on type `dojo::world::storage::WorldStorage`. Did you import the correct trait and impl? - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:124:10 - .deploy_contract('salt4', snake_actions::TEST_CLASS_HASH.try_into().unwrap()); - ^*************^ - -error[E0002]: Method `grant_writer` could not be called on type `dojo::world::storage::WorldStorage`. -Candidate `IWorld::grant_writer` inference failed with: Trait has no implementation in context: dojo::world::iworld::IWorld::. - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:128:11 - world.grant_writer(selector_from_tag!("pixelaw-Snake"), core_address.value); - ^**********^ - -error[E0002]: Method `grant_writer` could not be called on type `dojo::world::storage::WorldStorage`. -Candidate `IWorld::grant_writer` inference failed with: Trait has no implementation in context: dojo::world::iworld::IWorld::. - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:129:11 - world.grant_writer(selector_from_tag!("pixelaw-SnakeSegment"), core_address.value); - ^**********^ - -error[E0002]: Method `grant_writer` could not be called on type `dojo::world::storage::WorldStorage`. -Candidate `IWorld::grant_writer` inference failed with: Trait has no implementation in context: dojo::world::iworld::IWorld::. - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:131:11 - world.grant_writer(selector_from_tag!("pixelaw-Snake"), snake_actions_address); - ^**********^ - -error[E0002]: Method `grant_writer` could not be called on type `dojo::world::storage::WorldStorage`. -Candidate `IWorld::grant_writer` inference failed with: Trait has no implementation in context: dojo::world::iworld::IWorld::. - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:132:11 - world.grant_writer(selector_from_tag!("pixelaw-SnakeSegment"), snake_actions_address); - ^**********^ - -warning[E0001]: Unused variable. Consider ignoring by prefixing with `_`. - --> /home/caspar/Development/core/contracts/src/core/tests/helpers.cairo:117:9 - let core_address: CoreActionsAddress = world.read_model(CORE_ACTIONS_KEY); - ^**********^ - - -error: failed to compile diff --git a/contracts/overlays/dev-pop/core_actions.toml b/contracts/overlays/dev-pop/core_actions.toml deleted file mode 100644 index 6025c34..0000000 --- a/contracts/overlays/dev-pop/core_actions.toml +++ /dev/null @@ -1,11 +0,0 @@ -tag = "pixelaw-actions" -writes = [ - "pixelaw-App", - "pixelaw-AppName", - "pixelaw-CoreActionsAddress", - "pixelaw-Pixel", - "pixelaw-QueueItem", - "pixelaw-Snake", - "pixelaw-RTree", - "pixelaw-Area", -] diff --git a/contracts/overlays/dev-pop/paint_actions.toml b/contracts/overlays/dev-pop/paint_actions.toml deleted file mode 100644 index 003cb54..0000000 --- a/contracts/overlays/dev-pop/paint_actions.toml +++ /dev/null @@ -1,2 +0,0 @@ -tag = "pixelaw-paint_actions" -writes = ["pixelaw-Pixel"] diff --git a/contracts/overlays/dev-pop/snake_actions.toml b/contracts/overlays/dev-pop/snake_actions.toml deleted file mode 100644 index 235540a..0000000 --- a/contracts/overlays/dev-pop/snake_actions.toml +++ /dev/null @@ -1,2 +0,0 @@ -tag = "pixelaw-snake_actions" -writes = ["pixelaw-Snake", "pixelaw-SnakeSegment"] diff --git a/contracts/overlays/dev/core_actions.toml b/contracts/overlays/dev/core_actions.toml deleted file mode 100644 index 6025c34..0000000 --- a/contracts/overlays/dev/core_actions.toml +++ /dev/null @@ -1,11 +0,0 @@ -tag = "pixelaw-actions" -writes = [ - "pixelaw-App", - "pixelaw-AppName", - "pixelaw-CoreActionsAddress", - "pixelaw-Pixel", - "pixelaw-QueueItem", - "pixelaw-Snake", - "pixelaw-RTree", - "pixelaw-Area", -] diff --git a/contracts/overlays/dev/paint_actions.toml b/contracts/overlays/dev/paint_actions.toml deleted file mode 100644 index 003cb54..0000000 --- a/contracts/overlays/dev/paint_actions.toml +++ /dev/null @@ -1,2 +0,0 @@ -tag = "pixelaw-paint_actions" -writes = ["pixelaw-Pixel"] diff --git a/contracts/overlays/dev/snake_actions.toml b/contracts/overlays/dev/snake_actions.toml deleted file mode 100644 index 235540a..0000000 --- a/contracts/overlays/dev/snake_actions.toml +++ /dev/null @@ -1,2 +0,0 @@ -tag = "pixelaw-snake_actions" -writes = ["pixelaw-Snake", "pixelaw-SnakeSegment"] diff --git a/contracts/overlays/sepolia/core_actions.toml b/contracts/overlays/sepolia/core_actions.toml deleted file mode 100644 index 6025c34..0000000 --- a/contracts/overlays/sepolia/core_actions.toml +++ /dev/null @@ -1,11 +0,0 @@ -tag = "pixelaw-actions" -writes = [ - "pixelaw-App", - "pixelaw-AppName", - "pixelaw-CoreActionsAddress", - "pixelaw-Pixel", - "pixelaw-QueueItem", - "pixelaw-Snake", - "pixelaw-RTree", - "pixelaw-Area", -] diff --git a/contracts/overlays/sepolia/paint_actions.toml b/contracts/overlays/sepolia/paint_actions.toml deleted file mode 100644 index 003cb54..0000000 --- a/contracts/overlays/sepolia/paint_actions.toml +++ /dev/null @@ -1,2 +0,0 @@ -tag = "pixelaw-paint_actions" -writes = ["pixelaw-Pixel"] diff --git a/contracts/overlays/sepolia/snake_actions.toml b/contracts/overlays/sepolia/snake_actions.toml deleted file mode 100644 index 235540a..0000000 --- a/contracts/overlays/sepolia/snake_actions.toml +++ /dev/null @@ -1,2 +0,0 @@ -tag = "pixelaw-snake_actions" -writes = ["pixelaw-Snake", "pixelaw-SnakeSegment"]