From 1121e8d5a729bfed9ea818e556c9a997166584d9 Mon Sep 17 00:00:00 2001 From: Kariy Date: Thu, 28 Sep 2023 22:33:12 +0700 Subject: [PATCH] resolve conflicts --- crates/dojo-lang/src/manifest_test_data/manifest | 2 +- crates/dojo-types/src/lib.rs | 2 +- crates/torii/client/src/client/mod.rs | 2 +- crates/torii/client/src/client/storage.rs | 8 ++++---- crates/torii/client/src/client/subscription.rs | 6 +++--- crates/torii/grpc/src/client.rs | 2 +- crates/torii/grpc/src/conversion.rs | 8 ++++---- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/dojo-lang/src/manifest_test_data/manifest b/crates/dojo-lang/src/manifest_test_data/manifest index e893063785..1721425fb2 100644 --- a/crates/dojo-lang/src/manifest_test_data/manifest +++ b/crates/dojo-lang/src/manifest_test_data/manifest @@ -531,7 +531,7 @@ test_manifest_file { "name": "player_actions", "address": null, - "class_hash": "0x17e7124e5652e7909f2d4ff6fb3c71b316a206d818205b289b108a84904fdbe", + "class_hash": "0x4b8aedc50c01814ad20b7e976f9d4fe76d13f56fa57aabd2a6399c7fbc1a187", "abi": [ { "type": "impl", diff --git a/crates/dojo-types/src/lib.rs b/crates/dojo-types/src/lib.rs index 675952e1cb..07f1b87f29 100644 --- a/crates/dojo-types/src/lib.rs +++ b/crates/dojo-types/src/lib.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use component::ModelMetadata; +use model::ModelMetadata; use serde::Serialize; use starknet::core::types::FieldElement; use system::SystemMetadata; diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index 96d445bbfc..3494a671cb 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -4,7 +4,7 @@ pub mod subscription; use std::sync::Arc; -use dojo_types::component::EntityModel; +use dojo_types::model::EntityModel; use dojo_types::WorldMetadata; use futures::channel::mpsc; use parking_lot::{Mutex, RwLock}; diff --git a/crates/torii/client/src/client/storage.rs b/crates/torii/client/src/client/storage.rs index 034056f17e..7c61e2e912 100644 --- a/crates/torii/client/src/client/storage.rs +++ b/crates/torii/client/src/client/storage.rs @@ -102,7 +102,7 @@ mod tests { fn create_dummy_metadata() -> WorldMetadata { let components = HashMap::from([( "Position".into(), - dojo_types::component::ModelMetadata { + dojo_types::model::ModelMetadata { name: "Position".into(), class_hash: felt!("1"), size: 3, @@ -120,7 +120,7 @@ mod tests { #[test] fn err_if_set_values_too_many() { let storage = create_dummy_storage(); - let entity = dojo_types::component::EntityModel { + let entity = dojo_types::model::EntityModel { model: "Position".into(), keys: vec![felt!("0x12345")], }; @@ -135,7 +135,7 @@ mod tests { #[test] fn err_if_set_values_too_few() { let storage = create_dummy_storage(); - let entity = dojo_types::component::EntityModel { + let entity = dojo_types::model::EntityModel { model: "Position".into(), keys: vec![felt!("0x12345")], }; @@ -150,7 +150,7 @@ mod tests { #[test] fn set_and_get_entity_value() { let storage = create_dummy_storage(); - let entity = dojo_types::component::EntityModel { + let entity = dojo_types::model::EntityModel { model: "Position".into(), keys: vec![felt!("0x12345")], }; diff --git a/crates/torii/client/src/client/subscription.rs b/crates/torii/client/src/client/subscription.rs index 7d5efff1df..d42520a802 100644 --- a/crates/torii/client/src/client/subscription.rs +++ b/crates/torii/client/src/client/subscription.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use std::task::Poll; use anyhow::{anyhow, bail, Result}; -use dojo_types::component::EntityModel; +use dojo_types::model::EntityModel; use dojo_types::WorldMetadata; use futures::channel::mpsc::{Receiver, Sender}; use futures_util::StreamExt; @@ -211,7 +211,7 @@ mod tests { use std::collections::HashMap; use std::sync::Arc; - use dojo_types::component::EntityModel; + use dojo_types::model::EntityModel; use dojo_types::WorldMetadata; use parking_lot::RwLock; use starknet::core::utils::cairo_short_string_to_felt; @@ -221,7 +221,7 @@ mod tests { fn create_dummy_metadata() -> WorldMetadata { let components = HashMap::from([( "Position".into(), - dojo_types::component::ModelMetadata { + dojo_types::model::ModelMetadata { name: "Position".into(), class_hash: felt!("1"), size: 3, diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index 2580a63ab4..3c9b4052bf 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -92,7 +92,7 @@ impl WorldClient { /// Subscribe to the state diff for a set of entities of a World. pub async fn subscribe_entities( &mut self, - entities: Vec, + entities: Vec, ) -> Result, Error> { self.inner .subscribe_entities(SubscribeEntitiesRequest { diff --git a/crates/torii/grpc/src/conversion.rs b/crates/torii/grpc/src/conversion.rs index 0a58f4ab00..31d9884443 100644 --- a/crates/torii/grpc/src/conversion.rs +++ b/crates/torii/grpc/src/conversion.rs @@ -6,7 +6,7 @@ use starknet_crypto::FieldElement; use crate::protos; -impl TryFrom for dojo_types::component::ModelMetadata { +impl TryFrom for dojo_types::model::ModelMetadata { type Error = FromStrError; fn try_from(value: protos::types::ModelMetadata) -> Result { Ok(Self { @@ -31,7 +31,7 @@ impl TryFrom for dojo_types::WorldMetadata { .models .into_iter() .map(|component| Ok((component.name.clone(), component.try_into()?))) - .collect::, _>>()?; + .collect::, _>>()?; let systems = value .systems @@ -50,8 +50,8 @@ impl TryFrom for dojo_types::WorldMetadata { } } -impl From for protos::types::EntityModel { - fn from(value: dojo_types::component::EntityModel) -> Self { +impl From for protos::types::EntityModel { + fn from(value: dojo_types::model::EntityModel) -> Self { Self { model: value.model, keys: value.keys.into_iter().map(|key| format!("{key:#}")).collect(),