From 9763ffaed553d0dbfb648040033656c6b77375a0 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Sun, 7 Jul 2024 15:14:30 +0530 Subject: [PATCH 1/4] update manifest structure --- bin/sozo/src/commands/clean.rs | 41 ++++++++++--------- bin/sozo/src/commands/migrate.rs | 4 +- crates/benches/src/deployer.rs | 4 +- crates/dojo-lang/src/compiler.rs | 20 +++++---- .../contracts/ccf-cairo_v240-8d921297.json | 0 .../contracts/ccf-cairo_v260-465ec7fe.json | 0 .../{abis/base => base/abis}/dojo-base.json | 0 .../{abis/base => base/abis}/dojo-world.json | 0 .../contracts/ccf-cairo_v240-8d921297.toml | 2 +- .../contracts/ccf-cairo_v260-465ec7fe.toml | 2 +- .../manifests/dev/base/dojo-base.toml | 2 +- .../manifests/dev/base/dojo-world.toml | 2 +- crates/dojo-world/src/manifest/mod.rs | 2 +- crates/dojo-world/src/metadata_test.rs | 2 +- crates/sozo/ops/src/migration/migrate.rs | 25 ++++++----- crates/torii/core/src/sql_test.rs | 1 - .../dojo_examples-actions-40b6994c.json | 0 .../dojo_examples-mock_token-31599eb2.json | 0 .../dojo_examples-others-61de2c18.json | 0 .../{abis/base => base/abis}/dojo-base.json | 0 .../{abis/base => base/abis}/dojo-world.json | 0 ...examples-ContractInitialized-376b7bd6.json | 0 .../dojo_examples-Message-1bb1d226.json | 0 .../dojo_examples-MockToken-38903c7c.json | 0 .../models/dojo_examples-Moved-318ae40d.json | 0 .../models/dojo_examples-Moves-2e2accba.json | 0 .../dojo_examples-PlayerConfig-3adad785.json | 0 .../dojo_examples-Position-1e145e26.json | 0 .../dojo_examples-ServerProfile-4caad1e6.json | 0 .../dojo_examples-actions-40b6994c.toml | 2 +- .../dojo_examples-mock_token-31599eb2.toml | 2 +- .../dojo_examples-others-61de2c18.toml | 2 +- .../manifests/dev/base/dojo-base.toml | 2 +- .../manifests/dev/base/dojo-world.toml | 2 +- ...examples-ContractInitialized-376b7bd6.toml | 2 +- .../dojo_examples-Message-1bb1d226.toml | 2 +- .../dojo_examples-MockToken-38903c7c.toml | 2 +- .../models/dojo_examples-Moved-318ae40d.toml | 2 +- .../models/dojo_examples-Moves-2e2accba.toml | 2 +- .../dojo_examples-PlayerConfig-3adad785.toml | 2 +- .../dojo_examples-Position-1e145e26.toml | 2 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 2 +- .../dojo_examples-actions-40b6994c.json | 0 .../dojo_examples-mock_token-31599eb2.json | 0 .../dojo_examples-others-61de2c18.json | 0 .../abis}/dojo-world.json | 0 ...examples-ContractInitialized-376b7bd6.json | 0 .../dojo_examples-Message-1bb1d226.json | 0 .../dojo_examples-MockToken-38903c7c.json | 0 .../models/dojo_examples-Moved-318ae40d.json | 0 .../models/dojo_examples-Moves-2e2accba.json | 0 .../dojo_examples-PlayerConfig-3adad785.json | 0 .../dojo_examples-Position-1e145e26.json | 0 .../dojo_examples-ServerProfile-4caad1e6.json | 0 .../dev/{ => deployment}/manifest.json | 2 +- .../dev/{ => deployment}/manifest.toml | 26 ++++++------ .../dojo_examples-actions-40b6994c.json | 0 .../dojo_examples-mock_token-31599eb2.json | 0 .../dojo_examples-others-61de2c18.json | 0 .../{abis/base => base/abis}/dojo-base.json | 0 .../{abis/base => base/abis}/dojo-world.json | 0 ...examples-ContractInitialized-376b7bd6.json | 0 .../dojo_examples-Message-1bb1d226.json | 0 .../dojo_examples-MockToken-38903c7c.json | 0 .../models/dojo_examples-Moved-318ae40d.json | 0 .../models/dojo_examples-Moves-2e2accba.json | 0 .../dojo_examples-PlayerConfig-3adad785.json | 0 .../dojo_examples-Position-1e145e26.json | 0 .../dojo_examples-ServerProfile-4caad1e6.json | 0 .../dojo_examples-actions-40b6994c.toml | 2 +- .../dojo_examples-mock_token-31599eb2.toml | 2 +- .../dojo_examples-others-61de2c18.toml | 2 +- .../manifests/release/base/dojo-base.toml | 2 +- .../manifests/release/base/dojo-world.toml | 2 +- ...examples-ContractInitialized-376b7bd6.toml | 2 +- .../dojo_examples-Message-1bb1d226.toml | 2 +- .../dojo_examples-MockToken-38903c7c.toml | 2 +- .../models/dojo_examples-Moved-318ae40d.toml | 2 +- .../models/dojo_examples-Moves-2e2accba.toml | 2 +- .../dojo_examples-PlayerConfig-3adad785.toml | 2 +- .../dojo_examples-Position-1e145e26.toml | 2 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 2 +- 82 files changed, 98 insertions(+), 89 deletions(-) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/contracts/ccf-cairo_v240-8d921297.json (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/contracts/ccf-cairo_v260-465ec7fe.json (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/dojo-base.json (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/contracts/dojo_examples-actions-40b6994c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/contracts/dojo_examples-mock_token-31599eb2.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/contracts/dojo_examples-others-61de2c18.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/dojo-base.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-ContractInitialized-376b7bd6.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Message-1bb1d226.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-MockToken-38903c7c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Moved-318ae40d.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Moves-2e2accba.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-PlayerConfig-3adad785.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Position-1e145e26.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-ServerProfile-4caad1e6.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/contracts/dojo_examples-actions-40b6994c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/contracts/dojo_examples-mock_token-31599eb2.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/contracts/dojo_examples-others-61de2c18.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-ContractInitialized-376b7bd6.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Message-1bb1d226.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-MockToken-38903c7c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Moved-318ae40d.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Moves-2e2accba.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-PlayerConfig-3adad785.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Position-1e145e26.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-ServerProfile-4caad1e6.json (100%) rename examples/spawn-and-move/manifests/dev/{ => deployment}/manifest.json (99%) rename examples/spawn-and-move/manifests/dev/{ => deployment}/manifest.toml (88%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/contracts/dojo_examples-actions-40b6994c.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/contracts/dojo_examples-mock_token-31599eb2.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/contracts/dojo_examples-others-61de2c18.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/dojo-base.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-ContractInitialized-376b7bd6.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Message-1bb1d226.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-MockToken-38903c7c.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Moved-318ae40d.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Moves-2e2accba.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-PlayerConfig-3adad785.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Position-1e145e26.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-ServerProfile-4caad1e6.json (100%) diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 54650fcd96..46f92eb92c 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -3,7 +3,7 @@ use std::fs; use anyhow::{Context, Result}; use camino::Utf8PathBuf; use clap::Args; -use dojo_world::manifest::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; +use dojo_world::manifest::{BASE_DIR, MANIFESTS_DIR}; use scarb::core::Config; use scarb::ops; use tracing::trace; @@ -28,7 +28,7 @@ impl CleanArgs { /// * `profile_dir` - The directory where the profile files are located. pub fn clean_manifests(profile_dir: &Utf8PathBuf) -> Result<()> { trace!(?profile_dir, "Cleaning manifests."); - let dirs = vec![profile_dir.join(BASE_DIR), profile_dir.join(ABIS_DIR).join(BASE_DIR)]; + let dirs = vec![profile_dir.join(BASE_DIR)]; for d in dirs { if d.exists() { @@ -96,6 +96,8 @@ impl CleanArgs { #[cfg(test)] mod tests { use dojo_test_utils::compiler; + use dojo_world::manifest::DEPLOYMENT_DIR; + use dojo_world::metadata::ABIS_DIR; use scarb::compiler::Profile; use super::*; @@ -147,11 +149,11 @@ mod tests { ); assert!( fs::read_dir(dev_manifests_abis_base_dir).is_err(), - "Expected 'manifests/dev/abis/base' to be empty" + "Expected 'manifests/dev/base/abis' to be empty" ); assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_ok(), - "Expected 'manifests/dev/abis/deployments' to not be empty" + "Expected 'manifests/dev/deployment/abis' to not be empty" ); // we expect release profile to be not affected @@ -161,7 +163,7 @@ mod tests { ); assert!( fs::read_dir(release_manifests_abis_base_dir).is_ok(), - "Expected 'manifests/release/abis/base' to be non empty" + "Expected 'manifests/release/base/abis' to be non empty" ); assert!(dev_manifest_toml.exists(), "Expected 'manifest.toml' to exist"); @@ -172,7 +174,7 @@ mod tests { assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_err(), - "Expected 'manifests/dev/abis/deployments' to be empty" + "Expected 'manifests/dev/deployment/abis' to be empty" ); assert!(!dev_manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); assert!(!dev_manifest_json.exists(), "Expected 'manifest.json' to not exist"); @@ -200,18 +202,19 @@ mod tests { let target_dev_dir = temp_project_dir.join("target").join(dev_profile_name); let target_release_dir = temp_project_dir.join("target").join(release_profile_name); - let dev_manifests_dir = temp_project_dir.join("manifests").join(dev_profile_name); - let release_manifests_dir = temp_project_dir.join("manifests").join(release_profile_name); + let dev_manifests_dir = temp_project_dir.join(MANIFESTS_DIR).join(dev_profile_name); + let release_manifests_dir = temp_project_dir.join(MANIFESTS_DIR).join(release_profile_name); - let dev_manifests_base_dir = dev_manifests_dir.join("base"); - let dev_manifests_abis_base_dir = dev_manifests_dir.join("abis").join("base"); - let release_manifests_base_dir = release_manifests_dir.join("base"); - let release_manifests_abis_base_dir = release_manifests_dir.join("abis").join("base"); + let dev_manifests_base_dir = dev_manifests_dir.join(BASE_DIR); + let dev_manifests_abis_base_dir = dev_manifests_base_dir.join(ABIS_DIR); + let release_manifests_base_dir = release_manifests_dir.join(BASE_DIR); + let release_manifests_abis_base_dir = release_manifests_base_dir.join(ABIS_DIR); - let dev_manifests_abis_depl_dir = dev_manifests_dir.join("abis").join("deployments"); + let dev_manifests_deploy_dir = dev_manifests_dir.join(DEPLOYMENT_DIR); + let dev_manifests_abis_depl_dir = dev_manifests_deploy_dir.join(ABIS_DIR); - let dev_manifest_toml = dev_manifests_dir.join("manifest").with_extension("toml"); - let dev_manifest_json = dev_manifests_dir.join("manifest").with_extension("json"); + let dev_manifest_toml = dev_manifests_deploy_dir.join("manifest").with_extension("toml"); + let dev_manifest_json = dev_manifests_deploy_dir.join("manifest").with_extension("json"); assert!(fs::read_dir(target_dev_dir).is_err(), "Expected 'target/dev' to be empty"); assert!(fs::read_dir(target_release_dir).is_err(), "Expected 'target/release' to be empty"); @@ -222,11 +225,11 @@ mod tests { ); assert!( fs::read_dir(dev_manifests_abis_base_dir).is_err(), - "Expected 'manifests/dev/abis/base' to be empty" + "Expected 'manifests/dev/base/abis' to be empty" ); assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_ok(), - "Expected 'manifests/dev/abis/deployments' to not be empty" + "Expected 'manifests/dev/deployment/abis' to not be empty" ); assert!( @@ -235,7 +238,7 @@ mod tests { ); assert!( fs::read_dir(release_manifests_abis_base_dir).is_err(), - "Expected 'manifests/release/abis/base' to be empty" + "Expected 'manifests/release/base/abis' to be empty" ); assert!(dev_manifest_toml.exists(), "Expected 'manifest.toml' to exist"); @@ -246,7 +249,7 @@ mod tests { assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_err(), - "Expected 'manifests/dev/abis/deployments' to be empty" + "Expected 'manifests/dev/deployment/abis' to be empty" ); assert!(!dev_manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); assert!(!dev_manifest_json.exists(), "Expected 'manifest.json' to not exist"); diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index c697a15e7c..cc0b28559a 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -81,8 +81,10 @@ impl MigrateArgs { None }; + let profile_name = + ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); - if !manifest_dir.join(MANIFESTS_DIR).exists() { + if !manifest_dir.join(MANIFESTS_DIR).join(profile_name).exists() { return Err(anyhow!("Build project using `sozo build` first")); } diff --git a/crates/benches/src/deployer.rs b/crates/benches/src/deployer.rs index 9dcf7e961e..ad4db203a1 100644 --- a/crates/benches/src/deployer.rs +++ b/crates/benches/src/deployer.rs @@ -5,7 +5,7 @@ use anyhow::{anyhow, bail, Context, Ok, Result}; use clap::Parser; use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; -use dojo_world::manifest::{DeploymentManifest, DEPLOYMENTS_DIR, MANIFESTS_DIR}; +use dojo_world::manifest::{DeploymentManifest, DEPLOYMENT_DIR, MANIFESTS_DIR}; use futures::executor::block_on; use katana_runner::KatanaRunner; use scarb::compiler::CompilerRepository; @@ -97,7 +97,7 @@ async fn prepare_migration_args(args: SozoArgs) -> Result { let manifest_dir = manifest_path.parent().unwrap(); let manifest = DeploymentManifest::load_from_path( - &manifest_dir.join(MANIFESTS_DIR).join("dev").join(DEPLOYMENTS_DIR).with_extension("toml"), + &manifest_dir.join(MANIFESTS_DIR).join("dev").join(DEPLOYMENT_DIR).with_extension("toml"), ) .expect("failed to load manifest"); diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index 826d1dc4fc..54e4f631b6 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -223,10 +223,12 @@ fn update_files( ) -> anyhow::Result<()> { let profile_name = ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); - let profile_dir = Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name); + let relative_manifest_dir = Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name); + + // relative path to manifests and abi + let base_manifests_dir = Utf8PathBuf::new().join(relative_manifest_dir).join(BASE_DIR); + let base_abis_dir = Utf8PathBuf::new().join(&base_manifests_dir).join(ABIS_DIR); - let relative_manifests_dir = Utf8PathBuf::new().join(&profile_dir).join(BASE_DIR); - let relative_abis_dir = Utf8PathBuf::new().join(&profile_dir).join(ABIS_DIR).join(BASE_DIR); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); fn get_compiled_artifact_from_map<'a>( @@ -247,8 +249,8 @@ fn update_files( let (hash, class) = get_compiled_artifact_from_map(&compiled_artifacts, qualified_path)?; let filename = naming::get_filename_from_tag(tag); write_manifest_and_abi( - &relative_manifests_dir, - &relative_abis_dir, + &base_manifests_dir, + &base_abis_dir, &manifest_dir, &mut Manifest::new( // abi path will be written by `write_manifest` @@ -334,8 +336,8 @@ fn update_files( for (_, (manifest, class, module_id)) in contracts.iter_mut() { write_manifest_and_abi( - &relative_manifests_dir.join(CONTRACTS_DIR), - &relative_abis_dir.join(CONTRACTS_DIR), + &base_manifests_dir.join(CONTRACTS_DIR), + &base_abis_dir.join(CONTRACTS_DIR), &manifest_dir, manifest, &class.abi, @@ -360,8 +362,8 @@ fn update_files( for (_, (manifest, class, module_id)) in models.iter_mut() { write_manifest_and_abi( - &relative_manifests_dir.join(MODELS_DIR), - &relative_abis_dir.join(MODELS_DIR), + &base_manifests_dir.join(MODELS_DIR), + &base_abis_dir.join(MODELS_DIR), &manifest_dir, manifest, &class.abi, diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml index be3fb94735..2dc026c126 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" original_class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json" +abi = "manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json" reads = [] writes = [] computed = [] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml index f4443a58d4..df70ed0ff9 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" original_class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json" +abi = "manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json" reads = [] writes = [] computed = [] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml index 4e2fc2e0bb..35f4edd8d1 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/base/dojo-base.json" +abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml index 94821ba3f7..2e7374451b 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "manifests/dev/abis/base/dojo-world.json" +abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 876a1f814e..e1c0369674 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -41,10 +41,10 @@ pub const WORLD_QUALIFIED_PATH: &str = "dojo::world::world"; pub const BASE_QUALIFIED_PATH: &str = "dojo::base::base"; pub const MANIFESTS_DIR: &str = "manifests"; +pub const DEPLOYMENT_DIR: &str = "deployment"; pub const TARGET_DIR: &str = "target"; pub const BASE_DIR: &str = "base"; pub const OVERLAYS_DIR: &str = "overlays"; -pub const DEPLOYMENTS_DIR: &str = "deployments"; pub const ABIS_DIR: &str = "abis"; pub const CONTRACTS_DIR: &str = "contracts"; diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index adf9156617..ff32eda35c 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -131,7 +131,7 @@ async fn get_full_dojo_metadata_from_workspace() { let manifest_dir = manifest_dir.join(MANIFESTS_DIR).join(profile.as_str()); let target_dir = ws.target_dir().path_existent().unwrap(); let target_dir = target_dir.join(profile.as_str()); - let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); + let abis_dir = manifest_dir.join(BASE_DIR).join(ABIS_DIR); let dojo_metadata = dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index e2fcfcecbc..ca08a1d9d8 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -11,7 +11,7 @@ use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, BASE_DIR, - DEPLOYMENTS_DIR, MANIFESTS_DIR, + DEPLOYMENT_DIR, MANIFESTS_DIR, }; use dojo_world::metadata::{dojo_metadata_from_workspace, ResourceMetadata}; use dojo_world::migration::class::ClassMigration; @@ -807,8 +807,10 @@ pub async fn update_manifests_and_abis( let ui = ws.config().ui(); ui.print_step(5, "✨", "Updating manifests..."); - let deployed_path = manifest_dir.join("manifest").with_extension("toml"); - let deployed_path_json = manifest_dir.join("manifest").with_extension("json"); + let deployment_dir = manifest_dir.join(DEPLOYMENT_DIR); + + let deployed_path = deployment_dir.join("manifest").with_extension("toml"); + let deployed_path_json = deployment_dir.join("manifest").with_extension("json"); let mut local_manifest: DeploymentManifest = local_manifest.into(); @@ -862,7 +864,7 @@ pub async fn update_manifests_and_abis( } }); - // copy abi files from `abi/base` to `abi/deployments/{chain_id}` and update abi path in + // copy abi files from `base/abi` to `deployment/abi` and update abi path in // local_manifest update_manifest_abis(&mut local_manifest, manifest_dir, profile_name).await; @@ -887,25 +889,26 @@ async fn update_manifest_abis( ) where T: ManifestMethods, { - // manifests/dev/abis/base/contract/dojo-world.json -> abis/base/contract/dojo-world.json let base_relative_path = manifest.inner.abi().unwrap().to_path().unwrap(); + + // manifests/dev/base/abis/contract/contract.json -> abis/contract/contract.json let base_relative_path = base_relative_path .strip_prefix(Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name)) .unwrap(); - // abis/base/dojo-world.json -> dojo-world.json + // base/abis/contract/contract.json -> contract/contract.json let stripped_path = base_relative_path - .strip_prefix(Utf8PathBuf::new().join(ABIS_DIR).join(BASE_DIR)) + .strip_prefix(Utf8PathBuf::new().join(BASE_DIR).join(ABIS_DIR)) .unwrap(); - // abis/deployments/dojo-world.json + // deployment/abis/dojo-world.json let deployed_relative_path = - Utf8PathBuf::new().join(ABIS_DIR).join(DEPLOYMENTS_DIR).join(stripped_path); + Utf8PathBuf::new().join(DEPLOYMENT_DIR).join(ABIS_DIR).join(stripped_path); - // /abis/base/dojo-world.json + // /base/abis/dojo-world.json let full_base_path = manifest_dir.join(base_relative_path); - // /abis/deployments/dojo-world.json + // /deployment/abis/dojo-world.json let full_deployed_path = manifest_dir.join(deployed_relative_path.clone()); fs::create_dir_all(full_deployed_path.parent().unwrap()) diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index b367eeab61..a1d3d55e37 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -64,7 +64,6 @@ async fn test_load_from_remote() { SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json rename to examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json rename to examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json rename to examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json rename to examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json rename to examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml index 34d9543e28..99bc7921ee 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json" +abi = "manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml index 1a2a64dea4..a0d11e457e 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml index 31438c1f0f..07b05e0714 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json" +abi = "manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-base.toml b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml index 4e2fc2e0bb..35f4edd8d1 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-base.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/base/dojo-base.json" +abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml index 94821ba3f7..2e7374451b 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "manifests/dev/abis/base/dojo-world.json" +abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index 0aacc170a4..f226e89204 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml index 698d0a8f0e..1a2e2802f7 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml index b607d23d57..23435c0a3a 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json" +abi = "manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml index c8e044bd5a..b90e61eafe 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml index 0a661e61c7..c652d944a0 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml index a83db11151..22d3ca018e 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml index 6eea086fef..db21e81459 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml index 4b77f78c88..4055b284ec 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json similarity index 99% rename from examples/spawn-and-move/manifests/dev/manifest.json rename to examples/spawn-and-move/manifests/dev/deployment/manifest.json index 162816500f..b2115e9e85 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1122,7 +1122,7 @@ "kind": "Class", "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": "manifests/dev/abis/base/dojo-base.json", + "abi": "manifests/dev/base/abis/dojo-base.json", "tag": "dojo-base", "manifest_name": "dojo-base" }, diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml similarity index 88% rename from examples/spawn-and-move/manifests/dev/manifest.toml rename to examples/spawn-and-move/manifests/dev/deployment/manifest.toml index ad80716ce8..001e305e97 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml @@ -2,7 +2,7 @@ kind = "WorldContract" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "abis/deployments/dojo-world.json" +abi = "deployment/abis/dojo-world.json" address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" transaction_hash = "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287" block_number = 3 @@ -17,7 +17,7 @@ rpc_url = "http://localhost:5050/" kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/base/dojo-base.json" +abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" @@ -27,7 +27,7 @@ address = "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "abis/deployments/contracts/dojo_examples-actions-40b6994c.json" +abi = "deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [ "dojo_examples-Moves", @@ -44,7 +44,7 @@ address = "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] @@ -58,7 +58,7 @@ address = "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "abis/deployments/contracts/dojo_examples-others-61de2c18.json" +abi = "deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] @@ -74,7 +74,7 @@ manifest_name = "dojo_examples-others-61de2c18" kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" @@ -97,7 +97,7 @@ key = false kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "abis/deployments/models/dojo_examples-Message-1bb1d226.json" +abi = "deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" @@ -125,7 +125,7 @@ key = true kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "abis/deployments/models/dojo_examples-MockToken-38903c7c.json" +abi = "deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" @@ -143,7 +143,7 @@ key = false kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "abis/deployments/models/dojo_examples-Moved-318ae40d.json" +abi = "deployment/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" @@ -161,7 +161,7 @@ key = false kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "abis/deployments/models/dojo_examples-Moves-2e2accba.json" +abi = "deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" @@ -184,7 +184,7 @@ key = false kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" @@ -212,7 +212,7 @@ key = false kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "abis/deployments/models/dojo_examples-Position-1e145e26.json" +abi = "deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" @@ -230,7 +230,7 @@ key = false kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json rename to examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json rename to examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json rename to examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo-base.json b/examples/spawn-and-move/manifests/release/base/abis/dojo-base.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/dojo-base.json rename to examples/spawn-and-move/manifests/release/base/abis/dojo-base.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo-world.json b/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/dojo-world.json rename to examples/spawn-and-move/manifests/release/base/abis/dojo-world.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml index d50705247c..dd16bfa324 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json" +abi = "manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml index b9109222f9..e11d4ceb3c 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml index 2b791ea2d5..6dd2fc4ebf 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json" +abi = "manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/release/base/dojo-base.toml b/examples/spawn-and-move/manifests/release/base/dojo-base.toml index feb0efd085..83de14f171 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-base.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/release/abis/base/dojo-base.json" +abi = "manifests/release/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/release/base/dojo-world.toml b/examples/spawn-and-move/manifests/release/base/dojo-world.toml index cad6228974..7249b9c358 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "manifests/release/abis/base/dojo-world.json" +abi = "manifests/release/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index 9e7ac1b5fa..ef09f4f8da 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml index 415899e171..fdb190ac8c 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json" +abi = "manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml index 90d11271ae..71fa47c3e7 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json" +abi = "manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml index 3dc784d978..4bb3b5cc3f 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json" +abi = "manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml index 50f4c1774f..4eb4aa9f97 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json" +abi = "manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml index 762114119b..4c0855b673 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml index be845b84a8..0b5a593985 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json" +abi = "manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml index b41cbad8c7..19ca33fbe3 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" From 29bb52fd80568293eab3d2f1693469ee32739216 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Sun, 7 Jul 2024 15:54:43 +0530 Subject: [PATCH 2/4] fix abi path in manifest --- crates/dojo-world/src/manifest/mod.rs | 8 +- crates/sozo/ops/src/migration/migrate.rs | 21 +++- .../dev/deployment/abis/dojo-base.json | 98 +++++++++++++++++++ .../manifests/dev/deployment/manifest.json | 2 +- .../manifests/dev/deployment/manifest.toml | 26 ++--- 5 files changed, 132 insertions(+), 23 deletions(-) create mode 100644 examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index e1c0369674..48397654f3 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -366,25 +366,25 @@ impl DeploymentManifest { Ok(()) } - pub fn write_to_path_json(&self, path: &Utf8PathBuf, profile_dir: &Utf8PathBuf) -> Result<()> { + pub fn write_to_path_json(&self, path: &Utf8PathBuf, root_dir: &Utf8PathBuf) -> Result<()> { fs::create_dir_all(path.parent().unwrap())?; // Embedding ABIs into the manifest. let mut manifest_with_abis = self.clone(); if let Some(abi_format) = &manifest_with_abis.world.inner.abi { - manifest_with_abis.world.inner.abi = Some(abi_format.to_embed(profile_dir)?); + manifest_with_abis.world.inner.abi = Some(abi_format.to_embed(root_dir)?); } for contract in &mut manifest_with_abis.contracts { if let Some(abi_format) = &contract.inner.abi { - contract.inner.abi = Some(abi_format.to_embed(profile_dir)?); + contract.inner.abi = Some(abi_format.to_embed(root_dir)?); } } for model in &mut manifest_with_abis.models { if let Some(abi_format) = &model.inner.abi { - model.inner.abi = Some(abi_format.to_embed(profile_dir)?); + model.inner.abi = Some(abi_format.to_embed(root_dir)?); } } diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index ca08a1d9d8..c38c40b0f2 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -9,7 +9,7 @@ use dojo_world::contracts::naming::{ }; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ - AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, + AbiFormat, BaseManifest, Class, DeploymentManifest, DojoContract, DojoModel, Manifest, ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, BASE_DIR, DEPLOYMENT_DIR, MANIFESTS_DIR, }; @@ -868,8 +868,15 @@ pub async fn update_manifests_and_abis( // local_manifest update_manifest_abis(&mut local_manifest, manifest_dir, profile_name).await; - local_manifest.write_to_path_toml(&deployed_path)?; - local_manifest.write_to_path_json(&deployed_path_json, manifest_dir)?; + local_manifest + .write_to_path_toml(&deployed_path) + .with_context(|| "Failed to write toml manifest")?; + + let root_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + + local_manifest + .write_to_path_json(&deployed_path_json, &root_dir) + .with_context(|| "Failed to write json manifest")?; ui.print("\n✨ Done."); Ok(()) @@ -891,7 +898,7 @@ async fn update_manifest_abis( { let base_relative_path = manifest.inner.abi().unwrap().to_path().unwrap(); - // manifests/dev/base/abis/contract/contract.json -> abis/contract/contract.json + // manifests/dev/base/abis/contract/contract.json -> base/abis/contract/contract.json let base_relative_path = base_relative_path .strip_prefix(Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name)) .unwrap(); @@ -917,12 +924,16 @@ async fn update_manifest_abis( fs::copy(full_base_path, full_deployed_path).await.expect("Failed to copy abi file"); - manifest.inner.set_abi(Some(AbiFormat::Path(deployed_relative_path))); + manifest.inner.set_abi(Some(AbiFormat::Path( + Utf8PathBuf::from(MANIFESTS_DIR).join(profile_name).join(deployed_relative_path), + ))); } inner_helper::(manifest_dir, profile_name, &mut local_manifest.world) .await; + inner_helper::(manifest_dir, profile_name, &mut local_manifest.base).await; + for contract in local_manifest.contracts.iter_mut() { inner_helper::(manifest_dir, profile_name, contract).await; } diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json new file mode 100644 index 0000000000..ee9ceaac66 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json @@ -0,0 +1,98 @@ +[ + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::base::base::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "flat" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json index b2115e9e85..655b688a82 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1122,7 +1122,7 @@ "kind": "Class", "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": "manifests/dev/base/abis/dojo-base.json", + "abi": "manifests/dev/deployment/abis/dojo-base.json", "tag": "dojo-base", "manifest_name": "dojo-base" }, diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml index 001e305e97..7097b14bc4 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml @@ -2,7 +2,7 @@ kind = "WorldContract" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "deployment/abis/dojo-world.json" +abi = "manifests/dev/deployment/abis/dojo-world.json" address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" transaction_hash = "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287" block_number = 3 @@ -17,7 +17,7 @@ rpc_url = "http://localhost:5050/" kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/base/abis/dojo-base.json" +abi = "manifests/dev/deployment/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" @@ -27,7 +27,7 @@ address = "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "deployment/abis/contracts/dojo_examples-actions-40b6994c.json" +abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [ "dojo_examples-Moves", @@ -44,7 +44,7 @@ address = "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] @@ -58,7 +58,7 @@ address = "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "deployment/abis/contracts/dojo_examples-others-61de2c18.json" +abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] @@ -74,7 +74,7 @@ manifest_name = "dojo_examples-others-61de2c18" kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" @@ -97,7 +97,7 @@ key = false kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "deployment/abis/models/dojo_examples-Message-1bb1d226.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" @@ -125,7 +125,7 @@ key = true kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "deployment/abis/models/dojo_examples-MockToken-38903c7c.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" @@ -143,7 +143,7 @@ key = false kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "deployment/abis/models/dojo_examples-Moved-318ae40d.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" @@ -161,7 +161,7 @@ key = false kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "deployment/abis/models/dojo_examples-Moves-2e2accba.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" @@ -184,7 +184,7 @@ key = false kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" @@ -212,7 +212,7 @@ key = false kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "deployment/abis/models/dojo_examples-Position-1e145e26.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" @@ -230,7 +230,7 @@ key = false kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" From b7da4bf3c7ab559ce018c895e29dcd75b08546bf Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Sun, 7 Jul 2024 19:33:53 +0530 Subject: [PATCH 3/4] fix test --- crates/dojo-world/src/metadata.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index b796ae4636..1e3644640d 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -34,6 +34,7 @@ fn build_artifact_from_filename( let abi_file = abi_dir.join(format!("{filename}.json")); let src_file = source_dir.join(format!("{filename}.cairo")); + dbg!(&abi_file, &src_file); ArtifactMetadata { abi: if abi_file.exists() { Some(Uri::File(abi_file.into_std_path_buf())) } else { None }, source: if src_file.exists() { @@ -93,7 +94,7 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Result let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); let manifest_dir = manifest_dir.join(MANIFESTS_DIR).join(profile.as_str()); - let abi_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); + let abi_dir = manifest_dir.join(BASE_DIR).join(ABIS_DIR); let source_dir = ws.target_dir().path_existent().unwrap(); let source_dir = source_dir.join(profile.as_str()); From 07f35c239079a7631462f24ce6b652e3aaf3c175 Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 7 Jul 2024 13:56:17 -0600 Subject: [PATCH 4/4] fix: fix typo and remove dbg --- bin/sozo/src/commands/clean.rs | 14 ++++++++------ crates/dojo-world/src/metadata.rs | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 46f92eb92c..59a76f15c1 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -113,6 +113,8 @@ mod tests { Profile::DEV, ); + println!("path {:?}", config.manifest_path()); + let temp_project_dir = config.manifest_path().parent().unwrap().to_path_buf(); let clean_cmd = CleanArgs { full: false, all_profiles: false }; @@ -128,14 +130,14 @@ mod tests { let release_manifests_dir = temp_project_dir.join("manifests").join(release_profile_name); let dev_manifests_base_dir = dev_manifests_dir.join("base"); - let dev_manifests_abis_base_dir = dev_manifests_dir.join("abis").join("base"); + let dev_manifests_abis_base_dir = dev_manifests_dir.join("base").join("abis"); let release_manifests_base_dir = release_manifests_dir.join("base"); - let release_manifests_abis_base_dir = release_manifests_dir.join("abis").join("base"); - - let dev_manifests_abis_depl_dir = dev_manifests_dir.join("abis").join("deployments"); + let release_manifests_abis_base_dir = release_manifests_dir.join("base").join("abis"); - let dev_manifest_toml = dev_manifests_dir.join("manifest").with_extension("toml"); - let dev_manifest_json = dev_manifests_dir.join("manifest").with_extension("json"); + let dev_manifests_depl_dir = dev_manifests_dir.join("deployment"); + let dev_manifests_abis_depl_dir = dev_manifests_depl_dir.join("abis"); + let dev_manifest_toml = dev_manifests_depl_dir.join("manifest").with_extension("toml"); + let dev_manifest_json = dev_manifests_depl_dir.join("manifest").with_extension("json"); assert!(fs::read_dir(target_dev_dir).is_err(), "Expected 'target/dev' to be empty"); assert!( diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index 1e3644640d..e948cf2ada 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -34,7 +34,6 @@ fn build_artifact_from_filename( let abi_file = abi_dir.join(format!("{filename}.json")); let src_file = source_dir.join(format!("{filename}.cairo")); - dbg!(&abi_file, &src_file); ArtifactMetadata { abi: if abi_file.exists() { Some(Uri::File(abi_file.into_std_path_buf())) } else { None }, source: if src_file.exists() {