Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Sep 28, 2023
1 parent b3a75df commit 1121e8d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crates/dojo-lang/src/manifest_test_data/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ test_manifest_file
{
"name": "player_actions",
"address": null,
"class_hash": "0x17e7124e5652e7909f2d4ff6fb3c71b316a206d818205b289b108a84904fdbe",
"class_hash": "0x4b8aedc50c01814ad20b7e976f9d4fe76d13f56fa57aabd2a6399c7fbc1a187",
"abi": [
{
"type": "impl",
Expand Down
2 changes: 1 addition & 1 deletion crates/dojo-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
8 changes: 4 additions & 4 deletions crates/torii/client/src/client/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")],
};
Expand All @@ -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")],
};
Expand All @@ -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")],
};
Expand Down
6 changes: 3 additions & 3 deletions crates/torii/client/src/client/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/grpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dojo_types::component::EntityModel>,
entities: Vec<dojo_types::model::EntityModel>,
) -> Result<tonic::Streaming<SubscribeEntitiesResponse>, Error> {
self.inner
.subscribe_entities(SubscribeEntitiesRequest {
Expand Down
8 changes: 4 additions & 4 deletions crates/torii/grpc/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use starknet_crypto::FieldElement;

use crate::protos;

impl TryFrom<protos::types::ModelMetadata> for dojo_types::component::ModelMetadata {
impl TryFrom<protos::types::ModelMetadata> for dojo_types::model::ModelMetadata {
type Error = FromStrError;
fn try_from(value: protos::types::ModelMetadata) -> Result<Self, Self::Error> {
Ok(Self {
Expand All @@ -31,7 +31,7 @@ impl TryFrom<protos::types::WorldMetadata> for dojo_types::WorldMetadata {
.models
.into_iter()
.map(|component| Ok((component.name.clone(), component.try_into()?)))
.collect::<Result<HashMap<_, dojo_types::component::ModelMetadata>, _>>()?;
.collect::<Result<HashMap<_, dojo_types::model::ModelMetadata>, _>>()?;

let systems = value
.systems
Expand All @@ -50,8 +50,8 @@ impl TryFrom<protos::types::WorldMetadata> for dojo_types::WorldMetadata {
}
}

impl From<dojo_types::component::EntityModel> for protos::types::EntityModel {
fn from(value: dojo_types::component::EntityModel) -> Self {
impl From<dojo_types::model::EntityModel> 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(),
Expand Down

0 comments on commit 1121e8d

Please sign in to comment.