diff --git a/Cargo.lock b/Cargo.lock index 0e9ebb404c..95f5bd457b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2147,7 +2147,6 @@ dependencies = [ "serde_with", "smol_str", "starknet", - "starknet-crypto 0.5.1", "thiserror", "tokio", "tracing", diff --git a/crates/dojo-client/src/api.rs b/crates/dojo-client/src/api.rs deleted file mode 100644 index e834c609f0..0000000000 --- a/crates/dojo-client/src/api.rs +++ /dev/null @@ -1,85 +0,0 @@ -use dojo_world::manifest::Dependency; -use starknet::core::types::InvokeTransactionResult; -use starknet_crypto::FieldElement; - -pub trait Component { - const NAME: String; - const CLASS_HASH: FieldElement; - - fn len(&self) -> usize; -} - -pub trait System { - const NAME: String; - const CLASS_HASH: FieldElement; - - fn dependencies(&self) -> Vec; -} - -#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] -#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] -pub trait WorldWriter { - type Error; - - async fn set_executor( - &self, - executor: FieldElement, - ) -> Result; - - async fn register_systems( - &mut self, - components: Vec, - ) -> Result; - - async fn register_components( - &mut self, - systems: Vec, - ) -> Result; - - /// Set the component value for an entity. - fn set_entity( - &mut self, - component: String, - partition: FieldElement, - keys: Vec, - values: Vec, - ) -> Result; - - /// Delete a component from an entity. - fn delete_entity( - &mut self, - component: String, - partition: FieldElement, - key: FieldElement, - ) -> Result; -} - -#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)] -#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))] -pub trait WorldReader { - type Error; - - async fn component(&self, name: FieldElement) -> FieldElement; - - async fn system(&self, name: FieldElement) -> FieldElement; - - // async fn entity( - // &self, - // component: FieldElement, - // key: Query, - // offset: u8, - // length: usize, - // ) -> Vec; - - async fn entities( - &self, - component: FieldElement, - partition: FieldElement, - ) -> (Vec, Vec>); - - async fn executor(&self) -> FieldElement; - - async fn is_owner(&self, account: FieldElement, target: FieldElement) -> bool; - - async fn is_writer(&self, component: FieldElement, system: FieldElement) -> bool; -} diff --git a/crates/dojo-client/src/local/storage.rs b/crates/dojo-client/src/local/storage.rs index 2527e86037..91cea79287 100644 --- a/crates/dojo-client/src/local/storage.rs +++ b/crates/dojo-client/src/local/storage.rs @@ -6,57 +6,10 @@ use starknet::core::types::FieldElement; /// [`StorageWriter`] defines a mutable interface to the storage. pub trait StorageWriter { type Error; - - // /// Register a component. - // fn register_component(&mut self, component: Component) -> Result<(), Self::Error>; - - // /// Register a system. - // fn register_system(&mut self, system: System) -> Result<(), Self::Error>; - - // /// Set the executor contract address. - // fn set_executor(&mut self, executor: FieldElement) -> Result<(), Self::Error>; - - // /// Set the component value for an entity. - // fn set_entity( - // &mut self, - // component: String, - // partition: FieldElement, - // keys: Vec, - // values: Vec, - // ) -> Result<(), Self::Error>; - - // /// Delete a component from an entity. - // fn delete_entity( - // &mut self, - // component: String, - // partition: FieldElement, - // key: FieldElement, - // ) -> Result<(), Self::Error>; } /// [`StorageReader`] defines a immutable interface or a reference to the storage. It provides /// more granular access to the World state. pub trait StorageReader { type Error; - - // /// Get the component by its name - // fn component(&self, component: String) -> Result; - - // /// Get the system by its name - // fn system(&self, system: String) -> Result; - - // /// Get the component value for an entity - // fn entity( - // &self, - // component: String, - // partition: FieldElement, - // key: FieldElement, - // ) -> Result, Self::Error>; - - // /// Get the entity IDs and entities that contain the component state - // fn entities( - // &self, - // component: String, - // partition: FieldElement, - // ) -> Result>, Self::Error>; } diff --git a/crates/dojo-client/src/provider/jsonrpc.rs b/crates/dojo-client/src/provider/jsonrpc.rs index 309f603f47..9924eba7a4 100644 --- a/crates/dojo-client/src/provider/jsonrpc.rs +++ b/crates/dojo-client/src/provider/jsonrpc.rs @@ -16,16 +16,3 @@ where Self { provider, world_address } } } - -// #[cfg_attr(not(target_arch = "wasm32"), async_trait)] -// #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] -// impl

Provider for WorldProvider

-// where -// P: starknet::providers::Provider + Send + Sync, -// { -// type Error = P::Error; - -// async fn world_address(&self) -> Result { -// Ok(self.world_address) -// } -// } diff --git a/crates/dojo-client/src/types/mod.rs b/crates/dojo-client/src/types/mod.rs deleted file mode 100644 index e69de29bb2..0000000000