diff --git a/.github/workflows/contracts.yaml b/.github/workflows/contracts.yaml index 2496c9f..7af72a5 100644 --- a/.github/workflows/contracts.yaml +++ b/.github/workflows/contracts.yaml @@ -5,7 +5,7 @@ on: pull_request: env: - DOJO_VERSION: v1.0.0-rc.1 + DOJO_VERSION: v1.0.0 SCARB_VERSION: 2.8.4 WORKING_DIRECTORY: ./contracts diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml index 714b40a..73d99ed 100644 --- a/.github/workflows/packages.yaml +++ b/.github/workflows/packages.yaml @@ -5,7 +5,7 @@ on: pull_request: env: - DOJO_VERSION: v1.0.0-rc.1 + DOJO_VERSION: v1.0.0 SCARB_VERSION: 2.8.4 WORKING_DIRECTORY: ./packages diff --git a/Scarb.lock b/Scarb.lock index 201799b..713371f 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -19,8 +19,8 @@ dependencies = [ [[package]] name = "dojo" -version = "1.0.0-rc.0" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-rc.1#c789997f1a7cf5628d6b3fc01ce2851fca7a35bf" +version = "1.0.0" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331487dede59f9b2e378cd3" dependencies = [ "dojo_plugin", ] @@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "dojo_cairo_test" version = "1.0.0-rc.0" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-rc.1#c789997f1a7cf5628d6b3fc01ce2851fca7a35bf" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331487dede59f9b2e378cd3" dependencies = [ "dojo", ] @@ -36,4 +36,4 @@ dependencies = [ [[package]] name = "dojo_plugin" version = "2.8.4" -source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0-rc.1#c789997f1a7cf5628d6b3fc01ce2851fca7a35bf" +source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331487dede59f9b2e378cd3" diff --git a/Scarb.toml b/Scarb.toml index f2c65ed..602d517 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -8,8 +8,8 @@ cairo-version = "2.8.4" version = "0.0.0" [workspace.dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-rc.1" } -dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-rc.1" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" } +dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" } starknet = "2.8.4" cairo_test = "2.8.4" diff --git a/contracts/Scarb.toml b/contracts/Scarb.toml index e23d0bb..983e925 100644 --- a/contracts/Scarb.toml +++ b/contracts/Scarb.toml @@ -10,13 +10,13 @@ sierra-replace-ids = true dev = "sozo clean && sozo build --typescript && sozo migrate plan && sozo migrate apply" [dependencies] -dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-rc.1" } +dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" } bushido_registry = { path = ".." } starknet = "2.8.4" cairo_test = "2.8.4" [dev-dependencies] -dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-rc.1" } +dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" } [[target.starknet-contract]] build-external-contracts = [ diff --git a/packages/registry/src/tests/setup.cairo b/packages/registry/src/tests/setup.cairo index 671c515..aef569f 100644 --- a/packages/registry/src/tests/setup.cairo +++ b/packages/registry/src/tests/setup.cairo @@ -12,7 +12,10 @@ mod setup { // Dojo imports use dojo::world::{WorldStorage, WorldStorageTrait}; - use dojo_cairo_test::{spawn_test_world, NamespaceDef, TestResource, ContractDefTrait}; + use dojo_cairo_test::{ + spawn_test_world, NamespaceDef, ContractDef, TestResource, ContractDefTrait, + WorldStorageTestTrait + }; // Internal imports @@ -57,26 +60,30 @@ mod setup { fn setup_namespace() -> NamespaceDef { NamespaceDef { namespace: "namespace", resources: [ - TestResource::Model(models::m_Game::TEST_CLASS_HASH.try_into().unwrap()), - TestResource::Model(models::m_Achievement::TEST_CLASS_HASH.try_into().unwrap()), - TestResource::Contract( - ContractDefTrait::new(Controller::TEST_CLASS_HASH, "Controller") - .with_writer_of([dojo::utils::bytearray_hash(@"namespace")].span()) - ), - TestResource::Contract( - ContractDefTrait::new(Registrer::TEST_CLASS_HASH, "Registrer") - .with_writer_of([dojo::utils::bytearray_hash(@"namespace")].span()) - ), + TestResource::Model(models::m_Game::TEST_CLASS_HASH), + TestResource::Model(models::m_Achievement::TEST_CLASS_HASH), + TestResource::Contract(Controller::TEST_CLASS_HASH), + TestResource::Contract(Registrer::TEST_CLASS_HASH), ].span() } } + fn setup_contracts() -> Span { + [ + ContractDefTrait::new(@"namespace", @"Controller") + .with_writer_of([dojo::utils::bytearray_hash(@"namespace")].span()), + ContractDefTrait::new(@"namespace", @"Registrer") + .with_writer_of([dojo::utils::bytearray_hash(@"namespace")].span()), + ].span() + } + #[inline] fn spawn_game() -> (WorldStorage, Systems, Context) { // [Setup] World set_contract_address(OWNER()); let namespace_def = setup_namespace(); let world = spawn_test_world([namespace_def].span()); + world.sync_perms_and_inits(setup_contracts()); // [Setup] Systems let (controller_address, _) = world.dns(@"Controller").unwrap(); let (registrer_address, _) = world.dns(@"Registrer").unwrap(); diff --git a/packages/trophy/src/tests/setup.cairo b/packages/trophy/src/tests/setup.cairo index a50e59c..bbbd4f4 100644 --- a/packages/trophy/src/tests/setup.cairo +++ b/packages/trophy/src/tests/setup.cairo @@ -12,7 +12,10 @@ mod setup { // Dojo imports use dojo::world::{WorldStorage, WorldStorageTrait}; - use dojo_cairo_test::{spawn_test_world, NamespaceDef, TestResource, ContractDefTrait}; + use dojo_cairo_test::{ + spawn_test_world, NamespaceDef, ContractDef, TestResource, ContractDefTrait, + WorldStorageTestTrait + }; // Internal imports @@ -53,24 +56,27 @@ mod setup { fn setup_namespace() -> NamespaceDef { NamespaceDef { namespace: "namespace", resources: [ - TestResource::Event(events::e_TrophyCreation::TEST_CLASS_HASH.try_into().unwrap()), - TestResource::Event( - events::e_TrophyProgression::TEST_CLASS_HASH.try_into().unwrap() - ), - TestResource::Contract( - ContractDefTrait::new(Achiever::TEST_CLASS_HASH, "Achiever") - .with_writer_of([dojo::utils::bytearray_hash(@"namespace")].span()) - ), + TestResource::Event(events::e_TrophyCreation::TEST_CLASS_HASH), + TestResource::Event(events::e_TrophyProgression::TEST_CLASS_HASH), + TestResource::Contract(Achiever::TEST_CLASS_HASH), ].span() } } + fn setup_contracts() -> Span { + [ + ContractDefTrait::new(@"namespace", @"Achiever") + .with_writer_of([dojo::utils::bytearray_hash(@"namespace")].span()), + ].span() + } + #[inline] fn spawn_game() -> (WorldStorage, Systems, Context) { // [Setup] World set_contract_address(OWNER()); let namespace_def = setup_namespace(); let world = spawn_test_world([namespace_def].span()); + world.sync_perms_and_inits(setup_contracts()); // [Setup] Systems let (achiever_address, _) = world.dns(@"Achiever").unwrap(); let systems = Systems {