diff --git a/bin/sozo/tests/test_data/policies.json b/bin/sozo/tests/test_data/policies.json index 60b4ca826e..1ea9baedbc 100644 --- a/bin/sozo/tests/test_data/policies.json +++ b/bin/sozo/tests/test_data/policies.json @@ -67,6 +67,14 @@ "target": "0x74c73d35df54ddc53bcf34aab5e0dbb09c447e99e01f4d69535441253c9571a", "method": "register_namespace" }, + { + "target": "0x74c73d35df54ddc53bcf34aab5e0dbb09c447e99e01f4d69535441253c9571a", + "method": "register_event" + }, + { + "target": "0x74c73d35df54ddc53bcf34aab5e0dbb09c447e99e01f4d69535441253c9571a", + "method": "upgrade_event" + }, { "target": "0x74c73d35df54ddc53bcf34aab5e0dbb09c447e99e01f4d69535441253c9571a", "method": "deploy_contract" diff --git a/bin/sozo/tests/test_migrate.rs b/bin/sozo/tests/test_migrate.rs index b1f672b929..3d6c25265e 100644 --- a/bin/sozo/tests/test_migrate.rs +++ b/bin/sozo/tests/test_migrate.rs @@ -45,7 +45,8 @@ async fn migrate_dry_run() { assert!(output.contains("Migration Strategy")); assert!(output.contains("# Base Contract")); - assert!(output.contains("# Models (10)")); + assert!(output.contains("# Models (8)")); + assert!(output.contains("# Events (2)")); assert!(output.contains("# World")); assert!(output.contains("# Contracts (4)")); } diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index 4f8f3f7f15..a421626295 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -184,7 +184,7 @@ fn filter_model_tokens(tokens: &TokenizedAbi) -> TokenizedAbi { // All types from introspect module can also be removed as the clients does not rely on them. // Events are also always empty at model contract level. fn skip_token(token: &Token) -> bool { - if token.type_path().starts_with("dojo::model::introspect") { + if token.type_path().starts_with("dojo::meta::introspect") { return true; } @@ -246,7 +246,7 @@ mod tests { ) .unwrap(); - assert_eq!(data.models.len(), 10); + assert_eq!(data.models.len(), 8); assert_eq!(data.world.name, "dojo_example"); diff --git a/crates/dojo-core/src/event/event.cairo b/crates/dojo-core/src/event/event.cairo new file mode 100644 index 0000000000..bd407c7730 --- /dev/null +++ b/crates/dojo-core/src/event/event.cairo @@ -0,0 +1,65 @@ +use starknet::SyscallResult; + +use dojo::meta::Layout; +use dojo::meta::introspect::Ty; +use dojo::world::IWorldDispatcher; + +pub trait Event { + fn name() -> ByteArray; + fn namespace() -> ByteArray; + fn tag() -> ByteArray; + + fn version() -> u8; + + fn selector() -> felt252; + fn instance_selector(self: @T) -> felt252; + + fn name_hash() -> felt252; + fn namespace_hash() -> felt252; + + fn layout() -> Layout; + fn schema(self: @T) -> Ty; + + fn packed_size() -> Option; + fn unpacked_size() -> Option; +} + +#[starknet::interface] +pub trait IEvent { + fn name(self: @T) -> ByteArray; + fn namespace(self: @T) -> ByteArray; + fn tag(self: @T) -> ByteArray; + + fn version(self: @T) -> u8; + + fn selector(self: @T) -> felt252; + fn name_hash(self: @T) -> felt252; + fn namespace_hash(self: @T) -> felt252; + + fn packed_size(self: @T) -> Option; + fn unpacked_size(self: @T) -> Option; + + fn layout(self: @T) -> Layout; + fn schema(self: @T) -> Ty; +} + +/// Deploys an event with the given [`ClassHash`] and retrieves it's name. +/// Currently, the event is expected to already be declared by `sozo`. +/// +/// # Arguments +/// +/// * `salt` - A salt used to uniquely deploy the event. +/// * `class_hash` - Class Hash of the event. +pub fn deploy_and_get_metadata( + salt: felt252, class_hash: starknet::ClassHash +) -> SyscallResult<(starknet::ContractAddress, ByteArray, felt252, ByteArray, felt252)> { + let (contract_address, _) = starknet::syscalls::deploy_syscall( + class_hash, salt, [].span(), false, + )?; + let event = IEventDispatcher { contract_address }; + let name = event.name(); + let selector = event.selector(); + let namespace = event.namespace(); + let namespace_hash = event.namespace_hash(); + Result::Ok((contract_address, name, selector, namespace, namespace_hash)) +} diff --git a/crates/dojo-core/src/lib.cairo b/crates/dojo-core/src/lib.cairo index ed6b9ac046..d7d214fe46 100644 --- a/crates/dojo-core/src/lib.cairo +++ b/crates/dojo-core/src/lib.cairo @@ -6,11 +6,20 @@ pub mod contract { pub mod upgradeable; } -pub mod model { +pub mod meta { pub mod introspect; pub mod layout; pub use layout::{Layout, FieldLayout}; +} + +pub mod event { + pub mod event; + pub use event::{ + Event, IEvent, IEventDispatcher, IEventDispatcherTrait, deploy_and_get_metadata + }; +} +pub mod model { pub mod model; pub use model::{ Model, ModelIndex, ModelEntity, IModel, IModelDispatcher, IModelDispatcherTrait, @@ -72,8 +81,11 @@ pub mod world { #[cfg(test)] mod tests { - mod model { + mod meta { mod introspect; + } + + mod model { mod model; } mod storage { diff --git a/crates/dojo-core/src/model/introspect.cairo b/crates/dojo-core/src/meta/introspect.cairo similarity index 97% rename from crates/dojo-core/src/model/introspect.cairo rename to crates/dojo-core/src/meta/introspect.cairo index 7138f4fe67..c8009acc2d 100644 --- a/crates/dojo-core/src/model/introspect.cairo +++ b/crates/dojo-core/src/meta/introspect.cairo @@ -1,4 +1,4 @@ -use dojo::model::{Layout, FieldLayout}; +use dojo::meta::{Layout, FieldLayout}; #[derive(Copy, Drop, Serde)] pub enum Ty { @@ -240,9 +240,9 @@ pub impl Introspect_option> of Introspect> { fn layout() -> Layout { Layout::Enum( [ - dojo::model::FieldLayout { // Some + dojo::meta::FieldLayout { // Some selector: 0, layout: Introspect::::layout() }, - dojo::model::FieldLayout { // None + dojo::meta::FieldLayout { // None selector: 1, layout: Layout::Fixed([].span()) }, ].span() ) diff --git a/crates/dojo-core/src/model/layout.cairo b/crates/dojo-core/src/meta/layout.cairo similarity index 100% rename from crates/dojo-core/src/model/layout.cairo rename to crates/dojo-core/src/meta/layout.cairo diff --git a/crates/dojo-core/src/model/metadata.cairo b/crates/dojo-core/src/model/metadata.cairo index 7a8e18080c..ed55481d82 100644 --- a/crates/dojo-core/src/model/metadata.cairo +++ b/crates/dojo-core/src/model/metadata.cairo @@ -8,8 +8,9 @@ use core::byte_array::ByteArray; use core::poseidon::poseidon_hash_span; use core::serde::Serde; -use dojo::model::introspect::{Introspect, Ty, Struct, Member}; -use dojo::model::{Model, ModelIndex, Layout, FieldLayout}; +use dojo::meta::{Layout, FieldLayout}; +use dojo::meta::introspect::{Introspect, Ty, Struct, Member}; +use dojo::model::{Model, ModelIndex}; use dojo::utils; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; @@ -32,13 +33,9 @@ pub struct ResourceMetadata { #[generate_trait] pub impl ResourceMetadataImpl of ResourceMetadataTrait { - fn from_values(resource_id: felt252, ref values: Span) -> ResourceMetadata { - let metadata_uri = Serde::::deserialize(ref values); - if metadata_uri.is_none() { - panic!("Model `ResourceMetadata`: metadata_uri deserialization failed."); - } - - ResourceMetadata { resource_id, metadata_uri: metadata_uri.unwrap() } + fn from_values(resource_id: felt252, ref values: Span) -> Option { + let metadata_uri = Serde::::deserialize(ref values)?; + Option::Some(ResourceMetadata { resource_id, metadata_uri }) } } @@ -49,7 +46,10 @@ pub impl ResourceMetadataModel of Model { }; let mut values = world.entity(Self::selector(), ModelIndex::Keys(keys), Self::layout()); - ResourceMetadataTrait::from_values(*keys.at(0), ref values) + match ResourceMetadataTrait::from_values(*keys.at(0), ref values) { + Option::Some(x) => x, + Option::None => { panic!("Model `ResourceMetadata`: deserialization failed.") } + } } fn set_model(self: @ResourceMetadata, world: IWorldDispatcher,) { @@ -198,8 +198,8 @@ pub mod resource_metadata { use super::ResourceMetadata; use super::ResourceMetadataModel; - use dojo::model::introspect::{Introspect, Ty}; - use dojo::model::Layout; + use dojo::meta::introspect::{Introspect, Ty}; + use dojo::meta::Layout; #[storage] struct Storage {} diff --git a/crates/dojo-core/src/model/model.cairo b/crates/dojo-core/src/model/model.cairo index 6b11143ca0..3f4d78a6b1 100644 --- a/crates/dojo-core/src/model/model.cairo +++ b/crates/dojo-core/src/model/model.cairo @@ -1,7 +1,7 @@ use starknet::SyscallResult; -use dojo::model::Layout; -use dojo::model::introspect::Ty; +use dojo::meta::Layout; +use dojo::meta::introspect::Ty; use dojo::world::IWorldDispatcher; #[derive(Copy, Drop, Serde, Debug, PartialEq)] @@ -16,7 +16,7 @@ pub enum ModelIndex { pub trait ModelEntity { fn id(self: @T) -> felt252; fn values(self: @T) -> Span; - fn from_values(entity_id: felt252, ref values: Span) -> T; + fn from_values(entity_id: felt252, ref values: Span) -> Option; // Get is always used with the trait path, which results in no ambiguity for the compiler. fn get(world: IWorldDispatcher, entity_id: felt252) -> T; // Update and delete can be used directly on the entity, which results in ambiguity. diff --git a/crates/dojo-core/src/storage/layout.cairo b/crates/dojo-core/src/storage/layout.cairo index f0b8e7a6b5..0cca7a8ec8 100644 --- a/crates/dojo-core/src/storage/layout.cairo +++ b/crates/dojo-core/src/storage/layout.cairo @@ -1,4 +1,4 @@ -use dojo::model::{Layout, FieldLayout}; +use dojo::meta::{Layout, FieldLayout}; use dojo::utils::{combine_key, find_field_layout}; use super::database; diff --git a/crates/dojo-core/src/tests/base.cairo b/crates/dojo-core/src/tests/base.cairo index 680691b4be..01ad2f09d1 100644 --- a/crates/dojo-core/src/tests/base.cairo +++ b/crates/dojo-core/src/tests/base.cairo @@ -220,7 +220,7 @@ mod invalid_model_world { #[test] #[available_gas(6000000)] #[should_panic( - expected: ("Resource `dojo-invalid_model` is already registered", 'ENTRYPOINT_FAILED',) + expected: ("Model `dojo-invalid_model` is already registered", 'ENTRYPOINT_FAILED',) )] fn test_deploy_from_world_invalid_model() { let world = deploy_world(); diff --git a/crates/dojo-core/src/tests/benchmarks.cairo b/crates/dojo-core/src/tests/benchmarks.cairo index 298057be2a..3c36bc37f4 100644 --- a/crates/dojo-core/src/tests/benchmarks.cairo +++ b/crates/dojo-core/src/tests/benchmarks.cairo @@ -12,8 +12,9 @@ use starknet::storage_access::{ }; use starknet::syscalls::{storage_read_syscall, storage_write_syscall}; -use dojo::model::{Model, Layout, ModelIndex}; -use dojo::model::introspect::Introspect; +use dojo::meta::Layout; +use dojo::model::{Model, ModelIndex}; +use dojo::meta::introspect::Introspect; use dojo::storage::{database, storage}; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; diff --git a/crates/dojo-core/src/tests/model/introspect.cairo b/crates/dojo-core/src/tests/meta/introspect.cairo similarity index 98% rename from crates/dojo-core/src/tests/model/introspect.cairo rename to crates/dojo-core/src/tests/meta/introspect.cairo index 8a519afd97..bfa89e3023 100644 --- a/crates/dojo-core/src/tests/model/introspect.cairo +++ b/crates/dojo-core/src/tests/meta/introspect.cairo @@ -1,5 +1,5 @@ -use dojo::model::introspect::Introspect; -use dojo::model::{Layout, FieldLayout}; +use dojo::meta::introspect::Introspect; +use dojo::meta::{Layout, FieldLayout}; #[derive(Drop, Introspect)] struct Base { diff --git a/crates/dojo-core/src/tests/model/model.cairo b/crates/dojo-core/src/tests/model/model.cairo index b52ebbfbe7..384e6cc47a 100644 --- a/crates/dojo-core/src/tests/model/model.cairo +++ b/crates/dojo-core/src/tests/model/model.cairo @@ -35,14 +35,16 @@ fn test_from_values() { let mut values = [3, 4].span(); let model_entity = ModelEntity::::from_values(1, ref values); + assert!(model_entity.is_some()); + let model_entity = model_entity.unwrap(); assert!(model_entity.__id == 1 && model_entity.v1 == 3 && model_entity.v2 == 4); } #[test] -#[should_panic(expected: "ModelEntity `FooEntity`: deserialization failed.")] fn test_from_values_bad_data() { let mut values = [3].span(); - let _ = ModelEntity::::from_values(1, ref values); + let res = ModelEntity::::from_values(1, ref values); + assert!(res.is_none()); } #[test] diff --git a/crates/dojo-core/src/tests/world/entities.cairo b/crates/dojo-core/src/tests/world/entities.cairo index 599ccb7631..1641a1220d 100644 --- a/crates/dojo-core/src/tests/world/entities.cairo +++ b/crates/dojo-core/src/tests/world/entities.cairo @@ -2,8 +2,9 @@ use core::array::{ArrayTrait, SpanTrait}; use starknet::{contract_address_const, ContractAddress}; -use dojo::model::{ModelIndex, Layout, FieldLayout, Model}; -use dojo::model::introspect::Introspect; +use dojo::meta::{Layout, FieldLayout}; +use dojo::model::{ModelIndex, Model}; +use dojo::meta::introspect::Introspect; use dojo::storage::database::MAX_ARRAY_LENGTH; use dojo::utils::entity_id_from_keys; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait, world}; diff --git a/crates/dojo-core/src/tests/world/resources.cairo b/crates/dojo-core/src/tests/world/resources.cairo index 94702f02a7..14ccb01c10 100644 --- a/crates/dojo-core/src/tests/world/resources.cairo +++ b/crates/dojo-core/src/tests/world/resources.cairo @@ -237,7 +237,7 @@ fn test_upgrade_model_from_model_writer() { } #[test] -#[should_panic(expected: ("Resource `dojo-Foo` is already registered", 'ENTRYPOINT_FAILED',))] +#[should_panic(expected: ("Model `dojo-Foo` is already registered", 'ENTRYPOINT_FAILED',))] fn test_upgrade_model_from_random_account() { let bob = starknet::contract_address_const::<0xb0b>(); let alice = starknet::contract_address_const::<0xa11ce>(); diff --git a/crates/dojo-core/src/utils/utils.cairo b/crates/dojo-core/src/utils/utils.cairo index 59a42ef7fb..d7ba957ab8 100644 --- a/crates/dojo-core/src/utils/utils.cairo +++ b/crates/dojo-core/src/utils/utils.cairo @@ -4,7 +4,7 @@ use core::option::Option; use core::poseidon::poseidon_hash_span; use core::serde::Serde; -use dojo::model::{Layout, FieldLayout}; +use dojo::meta::{Layout, FieldLayout}; /// Compute the poseidon hash of a serialized ByteArray pub fn bytearray_hash(data: @ByteArray) -> felt252 { diff --git a/crates/dojo-core/src/world/errors.cairo b/crates/dojo-core/src/world/errors.cairo index ca1cadfb5c..7a0e02a2e6 100644 --- a/crates/dojo-core/src/world/errors.cairo +++ b/crates/dojo-core/src/world/errors.cairo @@ -28,12 +28,20 @@ pub fn no_namespace_write_access(caller: ContractAddress, namespace: @ByteArray) format!("Caller `{:?}` has no write access on namespace `{}`", caller, namespace) } +pub fn event_already_registered(namespace: @ByteArray, name: @ByteArray) -> ByteArray { + format!("Event `{}-{}` is already registered", namespace, name) +} + +pub fn event_not_registered(namespace: @ByteArray, name: @ByteArray) -> ByteArray { + format!("Event `{}-{}` is not registered", namespace, name) +} + pub fn model_already_registered(namespace: @ByteArray, name: @ByteArray) -> ByteArray { - format!("Resource `{}-{}` is already registered", namespace, name) + format!("Model `{}-{}` is already registered", namespace, name) } pub fn model_not_registered(namespace: @ByteArray, name: @ByteArray) -> ByteArray { - format!("Resource `{}-{}` is not registered", namespace, name) + format!("Model `{}-{}` is not registered", namespace, name) } pub fn resource_not_registered(resource: felt252) -> ByteArray { diff --git a/crates/dojo-core/src/world/world_contract.cairo b/crates/dojo-core/src/world/world_contract.cairo index 7623bf607b..806cc33624 100644 --- a/crates/dojo-core/src/world/world_contract.cairo +++ b/crates/dojo-core/src/world/world_contract.cairo @@ -3,12 +3,13 @@ use core::traits::{Into, TryInto}; use starknet::{ContractAddress, ClassHash, storage_access::StorageBaseAddress, SyscallResult}; use dojo::model::{ModelIndex, ResourceMetadata}; -use dojo::model::{Layout}; +use dojo::meta::Layout; use dojo::utils::bytearray_hash; #[derive(Drop, starknet::Store, Serde, Default, Debug)] pub enum Resource { Model: (ClassHash, ContractAddress), + Event: (ClassHash, ContractAddress), Contract: (ClassHash, ContractAddress), Namespace, World, @@ -26,11 +27,15 @@ pub trait IWorld { fn register_model(ref self: T, class_hash: ClassHash); fn upgrade_model(ref self: T, class_hash: ClassHash); + fn register_event(ref self: T, class_hash: ClassHash); + fn upgrade_event(ref self: T, class_hash: ClassHash); + fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress; fn upgrade_contract(ref self: T, selector: felt252, class_hash: ClassHash) -> ClassHash; fn init_contract(ref self: T, selector: felt252, init_calldata: Span); fn uuid(ref self: T) -> usize; + fn emit(self: @T, keys: Array, values: Span); fn entity( @@ -118,9 +123,11 @@ pub mod world { IUpgradeableState, IFactRegistryDispatcher, IFactRegistryDispatcherTrait, StorageUpdate, ProgramOutput }; + use dojo::meta::Layout; + use dojo::event::{IEventDispatcher, IEventDispatcherTrait}; use dojo::model::{ - Model, IModelDispatcher, IModelDispatcherTrait, Layout, ResourceMetadata, - ResourceMetadataTrait, metadata + Model, IModelDispatcher, IModelDispatcherTrait, ResourceMetadata, ResourceMetadataTrait, + metadata }; use dojo::storage; use dojo::utils::{entity_id_from_keys, bytearray_hash}; @@ -151,6 +158,8 @@ pub mod world { NamespaceRegistered: NamespaceRegistered, ModelRegistered: ModelRegistered, ModelUpgraded: ModelUpgraded, + EventRegistered: EventRegistered, + EventUpgraded: EventUpgraded, StoreSetRecord: StoreSetRecord, StoreUpdateRecord: StoreUpdateRecord, StoreUpdateMember: StoreUpdateMember, @@ -228,6 +237,24 @@ pub mod world { pub prev_address: ContractAddress, } + #[derive(Drop, starknet::Event, Debug, PartialEq)] + pub struct EventRegistered { + pub name: ByteArray, + pub namespace: ByteArray, + pub class_hash: ClassHash, + pub address: ContractAddress, + } + + #[derive(Drop, starknet::Event, Debug, PartialEq)] + pub struct EventUpgraded { + pub name: ByteArray, + pub namespace: ByteArray, + pub class_hash: ClassHash, + pub prev_class_hash: ClassHash, + pub address: ContractAddress, + pub prev_address: ContractAddress, + } + #[derive(Drop, starknet::Event)] pub struct StoreSetRecord { pub table: felt252, @@ -276,6 +303,7 @@ pub mod world { contract_base: ClassHash, nonce: usize, models_salt: usize, + events_salt: usize, resources: Map::, owners: Map::<(felt252, ContractAddress), bool>, writers: Map::<(felt252, ContractAddress), bool>, @@ -353,7 +381,10 @@ pub mod world { Model::::layout() ); - ResourceMetadataTrait::from_values(resource_selector, ref values) + match ResourceMetadataTrait::from_values(resource_selector, ref values) { + Option::Some(x) => x, + Option::None => { panic!("Model `ResourceMetadata`: deserialization failed.") } + } } /// Sets the metadata of the resource. @@ -582,6 +613,99 @@ pub mod world { ); } + /// Registers an event in the world. If the event is already registered, + /// the implementation will be updated. + /// + /// # Arguments + /// + /// * `class_hash` - The class hash of the event to be registered. + fn register_event(ref self: ContractState, class_hash: ClassHash) { + let caller = get_caller_address(); + + let salt = self.events_salt.read(); + let (address, name, selector, namespace, namespace_hash) = + dojo::event::deploy_and_get_metadata( + salt.into(), class_hash + ) + .unwrap_syscall(); + self.events_salt.write(salt + 1); + + if selector.is_zero() { + panic_with_byte_array(@errors::invalid_resource_selector(selector)); + } + + if !self.is_namespace_registered(namespace_hash) { + panic_with_byte_array(@errors::namespace_not_registered(@namespace)); + } + + self.assert_caller_namespace_write_access(@namespace, namespace_hash); + + let event = self.resources.read(selector); + if !event.is_unregistered() { + panic_with_byte_array(@errors::event_already_registered(@namespace, @name)); + } + + self.resources.write(selector, Resource::Event((class_hash, address))); + self.owners.write((selector, caller), true); + + EventEmitter::emit(ref self, EventRegistered { name, namespace, address, class_hash }); + } + + /// + fn upgrade_event(ref self: ContractState, class_hash: ClassHash) { + let caller = get_caller_address(); + + let salt = self.events_salt.read(); + let (address, name, selector, namespace, namespace_hash) = + dojo::event::deploy_and_get_metadata( + salt.into(), class_hash + ) + .unwrap_syscall(); + self.events_salt.write(salt + 1); + + if !self.is_namespace_registered(namespace_hash) { + panic_with_byte_array(@errors::namespace_not_registered(@namespace)); + } + + self.assert_caller_namespace_write_access(@namespace, namespace_hash); + + if selector.is_zero() { + panic_with_byte_array(@errors::invalid_resource_selector(selector)); + } + + let mut prev_class_hash = core::num::traits::Zero::::zero(); + let mut prev_address = core::num::traits::Zero::::zero(); + + match self.resources.read(selector) { + // If event is already registered, validate permission to update. + Resource::Event(( + event_hash, event_address + )) => { + if !self.is_owner(selector, caller) { + panic_with_byte_array(@errors::not_owner_upgrade(caller, selector)); + } + + prev_class_hash = event_hash; + prev_address = event_address; + }, + Resource::Unregistered => { + panic_with_byte_array(@errors::event_not_registered(@namespace, @name)) + }, + _ => panic_with_byte_array( + @errors::resource_conflict(@format!("{}-{}", namespace, name), @"event") + ) + }; + + self.resources.write(selector, Resource::Event((class_hash, address))); + + EventEmitter::emit( + ref self, + EventUpgraded { + name, namespace, prev_address, address, class_hash, prev_class_hash + } + ); + } + /// Registers a namespace in the world. /// /// # Arguments diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index b4b9ab312f..8d6611ba8d 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -24,9 +24,9 @@ use camino::Utf8PathBuf; use convert_case::{Case, Casing}; use dojo_world::contracts::naming; use dojo_world::manifest::{ - AbiFormat, Class, DojoContract, DojoModel, Manifest, ManifestMethods, ABIS_DIR, - BASE_CONTRACT_TAG, BASE_DIR, BASE_QUALIFIED_PATH, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, - WORLD_CONTRACT_TAG, WORLD_QUALIFIED_PATH, + AbiFormat, Class, DojoContract, DojoEvent, DojoModel, Manifest, ManifestMethods, ABIS_DIR, + BASE_CONTRACT_TAG, BASE_DIR, BASE_QUALIFIED_PATH, CONTRACTS_DIR, EVENTS_DIR, MANIFESTS_DIR, + MODELS_DIR, WORLD_CONTRACT_TAG, WORLD_QUALIFIED_PATH, }; use itertools::{izip, Itertools}; use scarb::compiler::helpers::{build_compiler_config, collect_main_crate_ids}; @@ -40,7 +40,7 @@ use starknet::core::types::contract::SierraClass; use starknet::core::types::Felt; use tracing::{debug, trace, trace_span}; -use crate::plugin::{DojoAuxData, Model}; +use crate::plugin::{DojoAuxData, Event, Model}; use crate::scarb_internal::debug::SierraToCairoDebugInfo; #[derive(Debug, Clone)] @@ -360,6 +360,7 @@ fn update_files( } let mut models = BTreeMap::new(); + let mut events = BTreeMap::new(); let mut contracts = BTreeMap::new(); if let Some(external_contracts) = external_contracts { @@ -403,6 +404,13 @@ fn update_files( *module_id, &compiled_artifacts, )?); + + events.extend(get_dojo_event_artifacts( + db, + &dojo_aux_data.events, + *module_id, + &compiled_artifacts, + )?); } // StarknetAuxData shouldn't be required. Every dojo contract and model are starknet @@ -417,6 +425,10 @@ fn update_files( contracts.remove(model.0.as_str()); } + for event in &events { + contracts.remove(event.0.as_str()); + } + let contracts_dir = target_dir.child(CONTRACTS_DIR); if !contracts.is_empty() && !contracts_dir.exists() { fs::create_dir_all(contracts_dir.path_unchecked())?; @@ -471,7 +483,7 @@ fn update_files( } let models_dir = target_dir.child(MODELS_DIR); - if !models.is_empty() && !models_dir.exists() { + if !models_dir.exists() { fs::create_dir_all(models_dir.path_unchecked())?; } @@ -516,9 +528,98 @@ fn update_files( } } + let events_dir = target_dir.child(EVENTS_DIR); + if !events_dir.exists() { + fs::create_dir_all(events_dir.path_unchecked())?; + } + + // Ensure `event` dir exist even if no events are compiled + // to avoid errors when loading manifests. + let base_events_dir = base_manifests_dir.join(EVENTS_DIR); + let base_events_abis_dir = base_abis_dir.join(EVENTS_DIR); + if !base_events_dir.exists() { + std::fs::create_dir_all(&base_events_dir)?; + } + if !base_events_abis_dir.exists() { + std::fs::create_dir_all(&base_events_abis_dir)?; + } + + for (_, (manifest, module_id, artifact)) in events.iter_mut() { + write_manifest_and_abi( + &base_events_dir, + &base_events_abis_dir, + &manifest_dir, + manifest, + &artifact.contract_class.abi, + )?; + + let filename = naming::get_filename_from_tag(&manifest.inner.tag); + save_expanded_source_file(ws, *module_id, db, &events_dir, &filename, &manifest.inner.tag)?; + save_json_artifact_file( + ws, + &events_dir, + &artifact.contract_class, + &filename, + &manifest.inner.tag, + )?; + + if let Some(debug_info) = &artifact.debug_info { + save_json_artifact_debug_file( + ws, + &events_dir, + debug_info, + &filename, + &manifest.inner.tag, + )?; + } + } + Ok(()) } +/// Finds the inline modules annotated as events in the given crate_ids and +/// returns the corresponding Events. +#[allow(clippy::type_complexity)] +fn get_dojo_event_artifacts( + db: &RootDatabase, + aux_data: &Vec, + module_id: ModuleId, + compiled_classes: &CompiledArtifactByPath, +) -> anyhow::Result, ModuleId, CompiledArtifact)>> { + let mut events = HashMap::with_capacity(aux_data.len()); + + for event in aux_data { + if let Ok(Some(ModuleItemId::Struct(struct_id))) = + db.module_item_by_name(module_id, event.name.clone().into()) + { + // Leverages the contract selector function to only snake case the event name and + // not the full path. + let contract_selector = ContractSelector(struct_id.full_path(db)); + let qualified_path = contract_selector.path_with_model_snake_case(); + let compiled_class = compiled_classes.get(&qualified_path).cloned(); + let tag = naming::get_tag(&event.namespace, &event.name); + + if let Some(artifact) = compiled_class { + let dojo_event = DojoEvent { + abi: None, + tag: tag.clone(), + members: event.members.clone(), + class_hash: artifact.class_hash, + qualified_path: qualified_path.clone(), + original_class_hash: artifact.class_hash, + }; + + let manifest = Manifest::new(dojo_event, naming::get_filename_from_tag(&tag)); + events.insert(qualified_path, (manifest, module_id, artifact.clone())); + } else { + println!("Event {} not found in target.", tag.clone()); + } + } + } + + Ok(events) +} + /// Finds the inline modules annotated as models in the given crate_ids and /// returns the corresponding Models. #[allow(clippy::type_complexity)] diff --git a/crates/dojo-lang/src/data.rs b/crates/dojo-lang/src/data.rs new file mode 100644 index 0000000000..bf47f87ff1 --- /dev/null +++ b/crates/dojo-lang/src/data.rs @@ -0,0 +1,297 @@ +use std::collections::HashMap; + +use cairo_lang_defs::patcher::RewriteNode; +use cairo_lang_defs::plugin::PluginDiagnostic; +use cairo_lang_diagnostics::Severity; +use cairo_lang_syntax::node::ast::{ + ArgClause, Expr, ItemStruct, Member as MemberAst, OptionArgListParenthesized, +}; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::helpers::QueryAttrs; +use cairo_lang_syntax::node::{Terminal, TypedStablePtr, TypedSyntaxNode}; +use dojo_world::config::NamespaceConfig; +use dojo_world::contracts::naming; +use dojo_world::manifest::Member; + +pub const DEFAULT_DATA_VERSION: u8 = 1; + +pub const DATA_VERSION_NAME: &str = "version"; +pub const DATA_NAMESPACE: &str = "namespace"; +pub const DATA_NOMAPPING: &str = "nomapping"; + +#[derive(Debug)] +pub struct DataParameters { + pub version: u8, + pub namespace: Option, + pub nomapping: bool, +} + +impl Default for DataParameters { + fn default() -> DataParameters { + DataParameters { version: DEFAULT_DATA_VERSION, namespace: Option::None, nomapping: false } + } +} + +/// Get the version from the `Expr` parameter. +fn get_version( + db: &dyn SyntaxGroup, + attribute_name: &String, + arg_value: Expr, + diagnostics: &mut Vec, +) -> u8 { + match arg_value { + Expr::Literal(ref value) => { + if let Ok(value) = value.text(db).parse::() { + if value <= DEFAULT_DATA_VERSION { + value + } else { + diagnostics.push(PluginDiagnostic { + message: format!("{attribute_name} version {} not supported", value), + stable_ptr: arg_value.stable_ptr().untyped(), + severity: Severity::Error, + }); + DEFAULT_DATA_VERSION + } + } else { + diagnostics.push(PluginDiagnostic { + message: format!( + "The argument '{}' of {attribute_name} must be an integer", + DATA_VERSION_NAME + ), + stable_ptr: arg_value.stable_ptr().untyped(), + severity: Severity::Error, + }); + DEFAULT_DATA_VERSION + } + } + _ => { + diagnostics.push(PluginDiagnostic { + message: format!( + "The argument '{}' of {attribute_name} must be an integer", + DATA_VERSION_NAME + ), + stable_ptr: arg_value.stable_ptr().untyped(), + severity: Severity::Error, + }); + DEFAULT_DATA_VERSION + } + } +} + +/// Get the namespace from the `Expr` parameter. +fn get_namespace( + db: &dyn SyntaxGroup, + attribute_name: &String, + arg_value: Expr, + diagnostics: &mut Vec, +) -> Option { + match arg_value { + Expr::ShortString(ss) => Some(ss.string_value(db).unwrap()), + Expr::String(s) => Some(s.string_value(db).unwrap()), + _ => { + diagnostics.push(PluginDiagnostic { + message: format!( + "The argument '{}' of {attribute_name} must be a string", + DATA_NAMESPACE + ), + stable_ptr: arg_value.stable_ptr().untyped(), + severity: Severity::Error, + }); + Option::None + } + } +} + +/// Get parameters of a dojo attribute. +/// +/// Note: dojo attribute has already been checked so there is one and only one attribute. +/// +/// Parameters: +/// * db: The semantic database. +/// * struct_ast: The AST of the Dojo struct. +/// * diagnostics: vector of compiler diagnostics. +/// +/// Returns: +/// * A [`DataParameters`] object containing all the Dojo attribute parameters with their default +/// values if not set in the code. +pub fn get_parameters( + db: &dyn SyntaxGroup, + attribute_name: &String, + struct_ast: ItemStruct, + diagnostics: &mut Vec, +) -> DataParameters { + let mut parameters = DataParameters::default(); + let mut processed_args: HashMap = HashMap::new(); + + if let OptionArgListParenthesized::ArgListParenthesized(arguments) = + struct_ast.attributes(db).query_attr(db, attribute_name).first().unwrap().arguments(db) + { + arguments.arguments(db).elements(db).iter().for_each(|a| match a.arg_clause(db) { + ArgClause::Named(x) => { + let arg_name = x.name(db).text(db).to_string(); + let arg_value = x.value(db); + + if processed_args.contains_key(&arg_name) { + diagnostics.push(PluginDiagnostic { + message: format!("Too many '{}' attributes for {attribute_name}", arg_name), + stable_ptr: struct_ast.stable_ptr().untyped(), + severity: Severity::Error, + }); + } else { + processed_args.insert(arg_name.clone(), true); + + match arg_name.as_str() { + DATA_VERSION_NAME => { + parameters.version = + get_version(db, attribute_name, arg_value, diagnostics); + } + DATA_NAMESPACE => { + parameters.namespace = + get_namespace(db, attribute_name, arg_value, diagnostics); + } + DATA_NOMAPPING => { + parameters.nomapping = true; + } + _ => { + diagnostics.push(PluginDiagnostic { + message: format!( + "Unexpected argument '{}' for {attribute_name}", + arg_name + ), + stable_ptr: x.stable_ptr().untyped(), + severity: Severity::Warning, + }); + } + } + } + } + ArgClause::Unnamed(x) => { + diagnostics.push(PluginDiagnostic { + message: format!( + "Unexpected argument '{}' for {attribute_name}", + x.as_syntax_node().get_text(db) + ), + stable_ptr: x.stable_ptr().untyped(), + severity: Severity::Warning, + }); + } + ArgClause::FieldInitShorthand(x) => { + diagnostics.push(PluginDiagnostic { + message: format!( + "Unexpected argument '{}' for {attribute_name}", + x.name(db).name(db).text(db).to_string() + ), + stable_ptr: x.stable_ptr().untyped(), + severity: Severity::Warning, + }); + } + }) + } + + parameters +} + +pub fn compute_namespace( + element_name: &str, + parameters: &DataParameters, + namespace_config: &NamespaceConfig, +) -> String { + let unmapped_namespace = + parameters.namespace.clone().unwrap_or(namespace_config.default.clone()); + + if parameters.nomapping { + unmapped_namespace + } else { + // Maps namespace from the tag to ensure higher precision on matching namespace mappings. + namespace_config.get_mapping(&naming::get_tag(&unmapped_namespace, element_name)) + } +} + +pub fn parse_members( + db: &dyn SyntaxGroup, + members: &[MemberAst], + diagnostics: &mut Vec, +) -> Vec { + members + .iter() + .filter_map(|member_ast| { + let member = Member { + name: member_ast.name(db).text(db).to_string(), + ty: member_ast + .type_clause(db) + .ty(db) + .as_syntax_node() + .get_text(db) + .trim() + .to_string(), + key: member_ast.has_attr(db, "key"), + }; + + // validate key member + if member.key && member.ty == "u256" { + diagnostics.push(PluginDiagnostic { + message: "Key is only supported for core types that are 1 felt long once \ + serialized. `u256` is a struct of 2 u128, hence not supported." + .into(), + stable_ptr: member_ast.name(db).stable_ptr().untyped(), + severity: Severity::Error, + }); + None + } else { + Some(member) + } + }) + .collect::>() +} + +pub fn serialize_keys_and_values( + members: &[Member], + keys_dest_name: &str, + serialized_keys: &mut Vec, + values_dest_name: &str, + serialized_values: &mut Vec, +) { + members.iter().for_each(|member| { + if member.key { + serialized_keys.push(serialize_member_ty(member, true, keys_dest_name)); + } else { + serialized_values.push(serialize_member_ty(member, true, values_dest_name)); + } + }); +} + +pub fn deserialize_keys_and_values( + members: &[Member], + keys_input_name: &str, + deserialized_keys: &mut Vec, + values_input_name: &str, + deserialized_values: &mut Vec, +) { + members.iter().for_each(|member| { + if member.key { + deserialized_keys.push(deserialize_member_ty(member, keys_input_name)); + } else { + deserialized_values.push(deserialize_member_ty(member, values_input_name)); + } + }); +} + +/// Creates a [`RewriteNode`] for the member type serialization. +/// +/// # Arguments +/// +/// * member: The member to serialize. +pub fn serialize_member_ty(member: &Member, with_self: bool, dest_name: &str) -> RewriteNode { + RewriteNode::Text(format!( + "core::serde::Serde::serialize({}{}, ref {dest_name});\n", + if with_self { "self." } else { "@" }, + member.name + )) +} + +pub fn deserialize_member_ty(member: &Member, input_name: &str) -> RewriteNode { + RewriteNode::Text(format!( + "let {} = core::serde::Serde::<{}>::deserialize(ref {input_name})?;\n", + member.name, member.ty + )) +} diff --git a/crates/dojo-lang/src/event.rs b/crates/dojo-lang/src/event.rs index 4058d93759..3f88a64203 100644 --- a/crates/dojo-lang/src/event.rs +++ b/crates/dojo-lang/src/event.rs @@ -1,192 +1,280 @@ -use cairo_lang_defs::patcher::{ModifiedNode, RewriteNode}; +use cairo_lang_defs::patcher::RewriteNode; use cairo_lang_defs::plugin::PluginDiagnostic; -use cairo_lang_starknet::plugin::aux_data::StarkNetEventAuxData; -use cairo_lang_starknet::plugin::consts::{ - EVENT_TRAIT, EVENT_TYPE_NAME, KEY_ATTR, NESTED_ATTR, SERDE_ATTR, -}; -use cairo_lang_starknet::plugin::events::EventData; -use cairo_lang_starknet_classes::abi::EventFieldKind; +use cairo_lang_diagnostics::Severity; +use cairo_lang_starknet::plugin::consts::EVENT_TRAIT; use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::helpers::QueryAttrs; -use cairo_lang_syntax::node::{ast, Terminal, TypedStablePtr, TypedSyntaxNode}; -use indoc::formatdoc; - -use crate::plugin::DojoAuxData; - -// A custom implementation of the starknet::Event derivation path. -// We append the event selector directly within the append_keys_and_data function. -// Without the need of the enum for all event variants. +use cairo_lang_syntax::node::{ast, TypedStablePtr, TypedSyntaxNode}; +use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; +use convert_case::{Case, Casing}; +use dojo_world::config::NamespaceConfig; +use dojo_world::contracts::naming; -// https://github.com/starkware-libs/cairo/blob/main/crates/cairo-lang-starknet/src/plugin/derive/event.rs +use crate::data::{ + compute_namespace, deserialize_keys_and_values, get_parameters, parse_members, + serialize_keys_and_values, +}; +use crate::plugin::{DojoAuxData, Event, DOJO_EVENT_ATTR}; pub fn handle_event_struct( db: &dyn SyntaxGroup, aux_data: &mut DojoAuxData, struct_ast: ast::ItemStruct, + namespace_config: &NamespaceConfig, ) -> (RewriteNode, Vec) { let mut diagnostics = vec![]; - // TODO(spapini): Support generics. - let generic_params = struct_ast.generic_params(db); - match generic_params { - ast::OptionWrappedGenericParamList::Empty(_) => {} - _ => { - diagnostics.push(PluginDiagnostic::error( - generic_params.stable_ptr().untyped(), - format!("{EVENT_TYPE_NAME} structs with generic arguments are unsupported"), - )); + let parameters = + get_parameters(db, &DOJO_EVENT_ATTR.to_string(), struct_ast.clone(), &mut diagnostics); + + let event_name = struct_ast.name(db).as_syntax_node().get_text(db).trim().to_string(); + let event_namespace = compute_namespace(&event_name, ¶meters, namespace_config); + + for (id, value) in [("name", &event_name), ("namespace", &event_namespace)] { + if !NamespaceConfig::is_name_valid(value) { + return ( + RewriteNode::empty(), + vec![PluginDiagnostic { + stable_ptr: struct_ast.name(db).stable_ptr().0, + message: format!( + "The {id} '{value}' can only contain characters (a-z/A-Z), digits (0-9) \ + and underscore (_)." + ) + .to_string(), + severity: Severity::Error, + }], + ); } } - // Generate append_keys_and_data() code. - let mut append_members = vec![]; - let mut deserialize_members = vec![]; - let mut ctor = vec![]; - let mut members = vec![]; - for member in struct_ast.members(db).elements(db) { - let member_name = RewriteNode::new_trimmed(member.name(db).as_syntax_node()); - let member_kind = - get_field_kind_for_member(db, &mut diagnostics, &member, EventFieldKind::DataSerde); - members.push((member.name(db).text(db), member_kind)); - - let member_for_append = RewriteNode::interpolate_patched( - "self.$member_name$", - &[("member_name".to_string(), member_name.clone())].into(), - ); - let append_member = append_field(member_kind, member_for_append); - let deserialize_member = deserialize_field(member_kind, member_name.clone()); - append_members.push(append_member); - deserialize_members.push(deserialize_member); - ctor.push(RewriteNode::interpolate_patched( - "$member_name$, ", - &[("member_name".to_string(), member_name)].into(), - )); - } - let event_data = EventData::Struct { members }; - aux_data.events.push(StarkNetEventAuxData { event_data }); - - let append_members = RewriteNode::Modified(ModifiedNode { children: Some(append_members) }); - let deserialize_members = - RewriteNode::Modified(ModifiedNode { children: Some(deserialize_members) }); - let ctor = RewriteNode::Modified(ModifiedNode { children: Some(ctor) }); - - // Add an implementation for `Event`. - let struct_name = RewriteNode::new_trimmed(struct_ast.name(db).as_syntax_node()); + let event_tag = naming::get_tag(&event_namespace, &event_name); + let event_name_hash = naming::compute_bytearray_hash(&event_name); + let event_namespace_hash = naming::compute_bytearray_hash(&event_namespace); + + let event_version = parameters.version.to_string(); + let event_selector = + naming::compute_selector_from_hashes(event_namespace_hash, event_name_hash).to_string(); + + let members = parse_members(db, &struct_ast.members(db).elements(db), &mut diagnostics); + + let mut serialized_keys: Vec = vec![]; + let mut serialized_values: Vec = vec![]; + + serialize_keys_and_values( + &members, + "keys", + &mut serialized_keys, + "data", + &mut serialized_values, + ); + + if serialized_keys.is_empty() { + diagnostics.push(PluginDiagnostic { + message: "Event must define at least one #[key] attribute".into(), + stable_ptr: struct_ast.name(db).stable_ptr().untyped(), + severity: Severity::Error, + }); + } + + if serialized_values.is_empty() { + diagnostics.push(PluginDiagnostic { + message: "Event must define at least one member that is not a key".into(), + stable_ptr: struct_ast.name(db).stable_ptr().untyped(), + severity: Severity::Error, + }); + } + + let mut deserialized_keys: Vec = vec![]; + let mut deserialized_values: Vec = vec![]; + + deserialize_keys_and_values( + &members, + "keys", + &mut deserialized_keys, + "data", + &mut deserialized_values, + ); + + let member_names = members + .iter() + .map(|member| RewriteNode::Text(format!("{},\n", member.name.clone()))) + .collect::>(); + + aux_data.events.push(Event { + name: event_name.clone(), + namespace: event_namespace.clone(), + members, + }); + ( - // Append the event selector using the struct_name for the selector - // and then append the members. RewriteNode::interpolate_patched( - &formatdoc!( - " - impl $struct_name$IsEvent of {EVENT_TRAIT}<$struct_name$> {{ - fn append_keys_and_data( - self: @$struct_name$, ref keys: Array, ref data: Array - ) {{ - core::array::ArrayTrait::append(ref keys, \ - dojo::model::Model::<$struct_name$>::selector()); - $append_members$ - }} - fn deserialize( - ref keys: Span, ref data: Span, - ) -> Option<$struct_name$> {{$deserialize_members$ - Option::Some($struct_name$ {{$ctor$}}) - }} - }} " - ), - &[ - ("struct_name".to_string(), struct_name), - ("append_members".to_string(), append_members), - ("deserialize_members".to_string(), deserialize_members), - ("ctor".to_string(), ctor), - ] - .into(), - ), - diagnostics, - ) -} +impl $type_name$StrkEventImpl of $strk_event_trait$<$type_name$> { -/// Generates code to emit an event for a field -fn append_field(member_kind: EventFieldKind, field: RewriteNode) -> RewriteNode { - match member_kind { - EventFieldKind::Nested | EventFieldKind::Flat => RewriteNode::interpolate_patched( - &format!( - " - {EVENT_TRAIT}::append_keys_and_data( - $field$, ref keys, ref data - );" - ), - &[("field".to_string(), field)].into(), - ), - EventFieldKind::KeySerde => RewriteNode::interpolate_patched( - " - core::serde::Serde::serialize($field$, ref keys);", - &[("field".to_string(), field)].into(), - ), - EventFieldKind::DataSerde => RewriteNode::interpolate_patched( - " - core::serde::Serde::serialize($field$, ref data);", - &[("field".to_string(), field)].into(), - ), + fn append_keys_and_data( + self: @$type_name$, ref keys: Array, ref data: Array + ) { + core::array::ArrayTrait::append( + ref keys, dojo::event::Event::<$type_name$>::selector() + ); + $serialized_keys$ + $serialized_values$ } -} -fn deserialize_field(member_kind: EventFieldKind, member_name: RewriteNode) -> RewriteNode { - RewriteNode::interpolate_patched( - match member_kind { - EventFieldKind::Nested | EventFieldKind::Flat => { - " - let $member_name$ = starknet::Event::deserialize( - ref keys, ref data - )?;" - } - EventFieldKind::KeySerde => { - " - let $member_name$ = core::serde::Serde::deserialize( - ref keys - )?;" - } - EventFieldKind::DataSerde => { - " - let $member_name$ = core::serde::Serde::deserialize( - ref data - )?;" + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option<$type_name$> { + let _ = keys.pop_front(); + + $deserialized_keys$ + $deserialized_values$ + + Option::Some( + $type_name$ { + $member_names$ } - }, - &[("member_name".to_string(), member_name)].into(), - ) + ) + } } -/// Retrieves the field kind for a given enum variant, -/// indicating how the field should be serialized. -/// See [EventFieldKind]. -fn get_field_kind_for_member( - db: &dyn SyntaxGroup, - diagnostics: &mut Vec, - member: &ast::Member, - default: EventFieldKind, -) -> EventFieldKind { - let is_nested = member.has_attr(db, NESTED_ATTR); - let is_key = member.has_attr(db, KEY_ATTR); - let is_serde = member.has_attr(db, SERDE_ATTR); - - // Currently, nested fields are unsupported. - if is_nested { - diagnostics.push(PluginDiagnostic::error( - member.stable_ptr().untyped(), - "Nested event fields are currently unsupported".to_string(), - )); - } - // Currently, serde fields are unsupported. - if is_serde { - diagnostics.push(PluginDiagnostic::error( - member.stable_ptr().untyped(), - "Serde event fields are currently unsupported".to_string(), - )); - } - - if is_key { - return EventFieldKind::KeySerde; - } - default +pub impl $type_name$EventImpl of dojo::event::Event<$type_name$> { + + #[inline(always)] + fn name() -> ByteArray { + \"$type_name$\" + } + + #[inline(always)] + fn namespace() -> ByteArray { + \"$event_namespace$\" + } + + #[inline(always)] + fn tag() -> ByteArray { + \"$event_tag$\" + } + + #[inline(always)] + fn version() -> u8 { + $event_version$ + } + + #[inline(always)] + fn selector() -> felt252 { + $event_selector$ + } + + #[inline(always)] + fn instance_selector(self: @$type_name$) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + $event_name_hash$ + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + $event_namespace_hash$ + } + + #[inline(always)] + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::<$type_name$>::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::meta::layout::compute_packed_size(Self::layout()) + } + + #[inline(always)] + fn unpacked_size() -> Option { + dojo::meta::introspect::Introspect::<$type_name$>::size() + } + + #[inline(always)] + fn schema(self: @$type_name$) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::<$type_name$>::ty() + } + +} + +#[starknet::contract] +pub mod $contract_name$ { + use super::$type_name$; + + #[storage] + struct Storage {} + + #[abi(embed_v0)] + impl DojoEventImpl of dojo::event::IEvent{ + fn name(self: @ContractState) -> ByteArray { + dojo::event::Event::<$type_name$>::name() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::event::Event::<$type_name$>::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::event::Event::<$type_name$>::tag() + } + + fn version(self: @ContractState) -> u8 { + dojo::event::Event::<$type_name$>::version() + } + + fn selector(self: @ContractState) -> felt252 { + dojo::event::Event::<$type_name$>::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::event::Event::<$type_name$>::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::event::Event::<$type_name$>::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::meta::introspect::Introspect::<$type_name$>::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::event::Event::<$type_name$>::packed_size() + } + + fn layout(self: @ContractState) -> dojo::meta::Layout { + dojo::event::Event::<$type_name$>::layout() + } + + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::<$type_name$>::ty() + } + } +} + ", + &UnorderedHashMap::from([ + ("strk_event_trait".to_string(), RewriteNode::Text(EVENT_TRAIT.to_string())), + ("contract_name".to_string(), RewriteNode::Text(event_name.to_case(Case::Snake))), + ("type_name".to_string(), RewriteNode::Text(event_name)), + ("member_names".to_string(), RewriteNode::new_modified(member_names)), + ("serialized_keys".to_string(), RewriteNode::new_modified(serialized_keys)), + ("serialized_values".to_string(), RewriteNode::new_modified(serialized_values)), + ("deserialized_keys".to_string(), RewriteNode::new_modified(deserialized_keys)), + ("deserialized_values".to_string(), RewriteNode::new_modified(deserialized_values)), + ("event_tag".to_string(), RewriteNode::Text(event_tag)), + ("event_version".to_string(), RewriteNode::Text(event_version)), + ("event_selector".to_string(), RewriteNode::Text(event_selector)), + ("event_namespace".to_string(), RewriteNode::Text(event_namespace.clone())), + ("event_name_hash".to_string(), RewriteNode::Text(event_name_hash.to_string())), + ( + "event_namespace_hash".to_string(), + RewriteNode::Text(event_namespace_hash.to_string()), + ), + ]), + ), + diagnostics, + ) } diff --git a/crates/dojo-lang/src/introspect/layout.rs b/crates/dojo-lang/src/introspect/layout.rs index 7d0edf781c..6f327eab36 100644 --- a/crates/dojo-lang/src/introspect/layout.rs +++ b/crates/dojo-lang/src/introspect/layout.rs @@ -30,7 +30,7 @@ pub fn build_field_layouts( let field_selector = get_selector_from_name(&field_name.to_string()).unwrap(); let field_layout = get_layout_from_type_clause(db, diagnostics, &m.type_clause(db)); Some(format!( - "dojo::model::FieldLayout {{ + "dojo::meta::FieldLayout {{ selector: {field_selector}, layout: {field_layout} }}" @@ -57,7 +57,7 @@ pub fn build_variant_layouts( let variant_layout = match v.type_clause(db) { OptionTypeClause::Empty(_) => { - "dojo::model::Layout::Fixed(array![].span())".to_string() + "dojo::meta::Layout::Fixed(array![].span())".to_string() } OptionTypeClause::TypeClause(type_clause) => { get_layout_from_type_clause(db, diagnostics, &type_clause) @@ -65,7 +65,7 @@ pub fn build_variant_layouts( }; format!( - "dojo::model::FieldLayout {{ + "dojo::meta::FieldLayout {{ selector: {selector}, layout: {variant_layout} }}" @@ -112,7 +112,7 @@ pub fn build_array_layout_from_type( if is_tuple(&array_item_type) { format!( - "dojo::model::Layout::Array( + "dojo::meta::Layout::Array( array![ {} ].span() @@ -121,7 +121,7 @@ pub fn build_array_layout_from_type( ) } else if is_array(&array_item_type) { format!( - "dojo::model::Layout::Array( + "dojo::meta::Layout::Array( array![ {} ].span() @@ -129,7 +129,7 @@ pub fn build_array_layout_from_type( build_array_layout_from_type(diagnostics, diagnostic_item, &array_item_type) ) } else { - format!("dojo::model::introspect::Introspect::<{}>::layout()", item_type) + format!("dojo::meta::introspect::Introspect::<{}>::layout()", item_type) } } @@ -146,7 +146,7 @@ pub fn build_tuple_layout_from_type( .collect::>() .join(",\n"); format!( - "dojo::model::Layout::Tuple( + "dojo::meta::Layout::Tuple( array![ {} ].span() @@ -176,12 +176,12 @@ pub fn build_item_layout_from_type( }); } - format!("dojo::model::introspect::Introspect::<{}>::layout()", item_type) + format!("dojo::meta::introspect::Introspect::<{}>::layout()", item_type) } } pub fn is_custom_layout(layout: &str) -> bool { - layout.starts_with("dojo::model::introspect::Introspect::") + layout.starts_with("dojo::meta::introspect::Introspect::") } pub fn build_packed_struct_layout( @@ -207,7 +207,7 @@ pub fn build_packed_struct_layout( generate_cairo_code_for_fixed_layout_with_custom_types(&layouts) } else { format!( - "dojo::model::Layout::Fixed( + "dojo::meta::Layout::Fixed( array![ {} ].span() @@ -224,7 +224,7 @@ pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String] if is_custom_layout(l) { l.to_string() } else { - format!("dojo::model::Layout::Fixed(array![{l}].span())") + format!("dojo::meta::Layout::Fixed(array![{l}].span())") } }) .collect::>() @@ -240,7 +240,7 @@ pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String] match ArrayTrait::pop_front(ref layouts) {{ Option::Some(mut layout) => {{ match layout {{ - dojo::model::Layout::Fixed(mut l) => {{ + dojo::meta::Layout::Fixed(mut l) => {{ loop {{ match SpanTrait::pop_front(ref l) {{ Option::Some(x) => merged_layout.append(*x), @@ -255,7 +255,7 @@ pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String] }}; }}; - dojo::model::Layout::Fixed(merged_layout.span()) + dojo::meta::Layout::Fixed(merged_layout.span()) ", ) } @@ -288,7 +288,7 @@ pub fn build_packed_enum_layout( generate_cairo_code_for_fixed_layout_with_custom_types(&variant_layout) } else { format!( - "dojo::model::Layout::Fixed( + "dojo::meta::Layout::Fixed( array![ {} ].span() @@ -352,7 +352,7 @@ pub fn get_packed_item_layout_from_type( // as we cannot verify that an enum/struct custom type is packable, // we suppose it is and let the user verify this. // If it's not the case, the Dojo model layout function will panic. - vec![format!("dojo::model::introspect::Introspect::<{}>::layout()", item_type)] + vec![format!("dojo::meta::introspect::Introspect::<{}>::layout()", item_type)] } } } diff --git a/crates/dojo-lang/src/introspect/mod.rs b/crates/dojo-lang/src/introspect/mod.rs index 3fc4f244e7..62a2b11757 100644 --- a/crates/dojo-lang/src/introspect/mod.rs +++ b/crates/dojo-lang/src/introspect/mod.rs @@ -28,7 +28,7 @@ pub fn handle_introspect_struct( layout::build_packed_struct_layout(db, diagnostics, &struct_ast) } else { format!( - "dojo::model::Layout::Struct( + "dojo::meta::Layout::Struct( array![ {} ].span() @@ -66,7 +66,7 @@ pub fn handle_introspect_enum( } } else { format!( - "dojo::model::Layout::Enum( + "dojo::meta::Layout::Enum( array![ {} ].span() @@ -94,19 +94,19 @@ fn generate_introspect( ) -> RewriteNode { RewriteNode::interpolate_patched( " -impl $name$Introspect<$generics$> of dojo::model::introspect::Introspect<$name$<$generics_types$>> \ +impl $name$Introspect<$generics$> of dojo::meta::introspect::Introspect<$name$<$generics_types$>> \ { #[inline(always)] fn size() -> Option { $size$ } - fn layout() -> dojo::model::Layout { + fn layout() -> dojo::meta::Layout { $layout$ } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { + fn ty() -> dojo::meta::introspect::Ty { $ty$ } } @@ -148,7 +148,7 @@ fn build_generic_types_and_impls( let generic_impls = generic_types .iter() - .map(|g| format!("{g}, impl {g}Introspect: dojo::model::introspect::Introspect<{g}>")) + .map(|g| format!("{g}, impl {g}Introspect: dojo::meta::introspect::Introspect<{g}>")) .collect::>() .join(", "); diff --git a/crates/dojo-lang/src/introspect/size.rs b/crates/dojo-lang/src/introspect/size.rs index e1a49ca880..efb81ea25d 100644 --- a/crates/dojo-lang/src/introspect/size.rs +++ b/crates/dojo-lang/src/introspect/size.rs @@ -187,7 +187,7 @@ pub fn compute_item_size_from_type(item_type: &String) -> Vec { if let Some(p) = primitives.get(item_type) { vec![p.0.to_string()] } else { - vec![format!("dojo::model::introspect::Introspect::<{}>::size()", item_type)] + vec![format!("dojo::meta::introspect::Introspect::<{}>::size()", item_type)] } } } diff --git a/crates/dojo-lang/src/introspect/ty.rs b/crates/dojo-lang/src/introspect/ty.rs index 8c87fc151f..d9e9e40a11 100644 --- a/crates/dojo-lang/src/introspect/ty.rs +++ b/crates/dojo-lang/src/introspect/ty.rs @@ -16,8 +16,8 @@ pub fn build_struct_ty(db: &dyn SyntaxGroup, name: &String, struct_ast: &ItemStr .collect::>(); format!( - "dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct {{ + "dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct {{ name: '{name}', attrs: array![].span(), children: array![ @@ -39,8 +39,8 @@ pub fn build_enum_ty(db: &dyn SyntaxGroup, name: &String, enum_ast: &ItemEnum) - }; format!( - "dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum {{ + "dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum {{ name: '{name}', attrs: array![].span(), children: array![ @@ -56,7 +56,7 @@ pub fn build_member_ty(db: &dyn SyntaxGroup, member: &Member) -> String { let attrs = if member.has_attr(db, "key") { vec!["'key'"] } else { vec![] }; format!( - "dojo::model::introspect::Member {{ + "dojo::meta::introspect::Member {{ name: '{name}', attrs: array![{}].span(), ty: {} @@ -71,7 +71,7 @@ pub fn build_variant_ty(db: &dyn SyntaxGroup, variant: &Variant) -> String { match variant.type_clause(db) { OptionTypeClause::Empty(_) => { // use an empty tuple if the variant has no data - format!("('{name}', dojo::model::introspect::Ty::Tuple(array![].span()))") + format!("('{name}', dojo::meta::introspect::Ty::Tuple(array![].span()))") } OptionTypeClause::TypeClause(type_clause) => { format!("('{name}', {})", build_ty_from_type_clause(db, &type_clause)) @@ -100,7 +100,7 @@ pub fn build_item_ty_from_type(item_type: &String) -> String { if is_array(item_type) { let array_item_type = get_array_item_type(item_type); format!( - "dojo::model::introspect::Ty::Array( + "dojo::meta::introspect::Ty::Array( array![ {} ].span() @@ -108,11 +108,11 @@ pub fn build_item_ty_from_type(item_type: &String) -> String { build_item_ty_from_type(&array_item_type) ) } else if is_byte_array(item_type) { - "dojo::model::introspect::Ty::ByteArray".to_string() + "dojo::meta::introspect::Ty::ByteArray".to_string() } else if is_tuple(item_type) { build_tuple_ty_from_type(item_type) } else { - format!("dojo::model::introspect::Introspect::<{}>::ty()", item_type) + format!("dojo::meta::introspect::Introspect::<{}>::ty()", item_type) } } @@ -123,7 +123,7 @@ pub fn build_tuple_ty_from_type(item_type: &str) -> String { .collect::>() .join(",\n"); format!( - "dojo::model::introspect::Ty::Tuple( + "dojo::meta::introspect::Ty::Tuple( array![ {} ].span() diff --git a/crates/dojo-lang/src/lib.rs b/crates/dojo-lang/src/lib.rs index 4ed4b70c41..4f5c028e53 100644 --- a/crates/dojo-lang/src/lib.rs +++ b/crates/dojo-lang/src/lib.rs @@ -5,6 +5,7 @@ //! Learn more at [dojoengine.gg](http://dojoengine.gg). pub mod compiler; pub mod contract; +pub mod data; pub mod event; pub mod inline_macros; pub mod interface; diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json index 8553809311..f04bdb08c4 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -146,6 +146,10 @@ "name": "Model", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" }, + { + "name": "Event", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, { "name": "Contract", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" @@ -246,6 +250,30 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -343,7 +371,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [ @@ -371,7 +399,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -391,7 +419,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -929,6 +957,70 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world_contract::world::StoreSetRecord", @@ -1186,6 +1278,16 @@ "type": "dojo::world::world_contract::world::ModelUpgraded", "kind": "nested" }, + { + "name": "EventRegistered", + "type": "dojo::world::world_contract::world::EventRegistered", + "kind": "nested" + }, + { + "name": "EventUpgraded", + "type": "dojo::world::world_contract::world::EventUpgraded", + "kind": "nested" + }, { "name": "StoreSetRecord", "type": "dojo::world::world_contract::world::StoreSetRecord", 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 ff32465d06..992555fe3d 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 = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" -original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" +original_class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-lang/src/model.rs b/crates/dojo-lang/src/model.rs index 88e21fa69a..18f01a1202 100644 --- a/crates/dojo-lang/src/model.rs +++ b/crates/dojo-lang/src/model.rs @@ -1,14 +1,9 @@ -use std::collections::HashMap; - use cairo_lang_defs::patcher::RewriteNode; use cairo_lang_defs::plugin::PluginDiagnostic; use cairo_lang_diagnostics::Severity; -use cairo_lang_syntax::node::ast::{ - ArgClause, Expr, ItemStruct, Member as MemberAst, OptionArgListParenthesized, -}; +use cairo_lang_syntax::node::ast::ItemStruct; use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::helpers::QueryAttrs; -use cairo_lang_syntax::node::{Terminal, TypedStablePtr, TypedSyntaxNode}; +use cairo_lang_syntax::node::{TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use convert_case::{Case, Casing}; use dojo_world::config::NamespaceConfig; @@ -16,184 +11,12 @@ use dojo_world::contracts::naming; use dojo_world::manifest::Member; use starknet::core::utils::get_selector_from_name; +use crate::data::{ + compute_namespace, deserialize_keys_and_values, get_parameters, parse_members, + serialize_keys_and_values, serialize_member_ty, DEFAULT_DATA_VERSION, +}; use crate::plugin::{DojoAuxData, Model, DOJO_MODEL_ATTR}; -const DEFAULT_MODEL_VERSION: u8 = 1; - -const MODEL_VERSION_NAME: &str = "version"; -const MODEL_NAMESPACE: &str = "namespace"; -const MODEL_NOMAPPING: &str = "nomapping"; - -struct ModelParameters { - version: u8, - namespace: Option, - nomapping: bool, -} - -impl Default for ModelParameters { - fn default() -> ModelParameters { - ModelParameters { - version: DEFAULT_MODEL_VERSION, - namespace: Option::None, - nomapping: false, - } - } -} - -/// Get the model version from the `Expr` parameter. -fn get_model_version( - db: &dyn SyntaxGroup, - arg_value: Expr, - diagnostics: &mut Vec, -) -> u8 { - match arg_value { - Expr::Literal(ref value) => { - if let Ok(value) = value.text(db).parse::() { - if value <= DEFAULT_MODEL_VERSION { - value - } else { - diagnostics.push(PluginDiagnostic { - message: format!("dojo::model version {} not supported", value), - stable_ptr: arg_value.stable_ptr().untyped(), - severity: Severity::Error, - }); - DEFAULT_MODEL_VERSION - } - } else { - diagnostics.push(PluginDiagnostic { - message: format!( - "The argument '{}' of dojo::model must be an integer", - MODEL_VERSION_NAME - ), - stable_ptr: arg_value.stable_ptr().untyped(), - severity: Severity::Error, - }); - DEFAULT_MODEL_VERSION - } - } - _ => { - diagnostics.push(PluginDiagnostic { - message: format!( - "The argument '{}' of dojo::model must be an integer", - MODEL_VERSION_NAME - ), - stable_ptr: arg_value.stable_ptr().untyped(), - severity: Severity::Error, - }); - DEFAULT_MODEL_VERSION - } - } -} - -/// Get the model namespace from the `Expr` parameter. -fn get_model_namespace( - db: &dyn SyntaxGroup, - arg_value: Expr, - diagnostics: &mut Vec, -) -> Option { - match arg_value { - Expr::ShortString(ss) => Some(ss.string_value(db).unwrap()), - Expr::String(s) => Some(s.string_value(db).unwrap()), - _ => { - diagnostics.push(PluginDiagnostic { - message: format!( - "The argument '{}' of dojo::model must be a string", - MODEL_NAMESPACE - ), - stable_ptr: arg_value.stable_ptr().untyped(), - severity: Severity::Error, - }); - Option::None - } - } -} - -/// Get parameters of the dojo::model attribute. -/// -/// Note: dojo::model attribute has already been checked so there is one and only one attribute. -/// -/// Parameters: -/// * db: The semantic database. -/// * struct_ast: The AST of the model struct. -/// * diagnostics: vector of compiler diagnostics. -/// -/// Returns: -/// * A [`ModelParameters`] object containing all the dojo::model parameters with their default -/// values if not set in the code. -fn get_model_parameters( - db: &dyn SyntaxGroup, - struct_ast: ItemStruct, - diagnostics: &mut Vec, -) -> ModelParameters { - let mut parameters = ModelParameters::default(); - let mut processed_args: HashMap = HashMap::new(); - - if let OptionArgListParenthesized::ArgListParenthesized(arguments) = - struct_ast.attributes(db).query_attr(db, DOJO_MODEL_ATTR).first().unwrap().arguments(db) - { - arguments.arguments(db).elements(db).iter().for_each(|a| match a.arg_clause(db) { - ArgClause::Named(x) => { - let arg_name = x.name(db).text(db).to_string(); - let arg_value = x.value(db); - - if processed_args.contains_key(&arg_name) { - diagnostics.push(PluginDiagnostic { - message: format!("Too many '{}' attributes for dojo::model", arg_name), - stable_ptr: struct_ast.stable_ptr().untyped(), - severity: Severity::Error, - }); - } else { - processed_args.insert(arg_name.clone(), true); - - match arg_name.as_str() { - MODEL_VERSION_NAME => { - parameters.version = get_model_version(db, arg_value, diagnostics); - } - MODEL_NAMESPACE => { - parameters.namespace = get_model_namespace(db, arg_value, diagnostics); - } - MODEL_NOMAPPING => { - parameters.nomapping = true; - } - _ => { - diagnostics.push(PluginDiagnostic { - message: format!( - "Unexpected argument '{}' for dojo::model", - arg_name - ), - stable_ptr: x.stable_ptr().untyped(), - severity: Severity::Warning, - }); - } - } - } - } - ArgClause::Unnamed(x) => { - diagnostics.push(PluginDiagnostic { - message: format!( - "Unexpected argument '{}' for dojo::model", - x.as_syntax_node().get_text(db) - ), - stable_ptr: x.stable_ptr().untyped(), - severity: Severity::Warning, - }); - } - ArgClause::FieldInitShorthand(x) => { - diagnostics.push(PluginDiagnostic { - message: format!( - "Unexpected argument '{}' for dojo::model", - x.name(db).name(db).text(db).to_string() - ), - stable_ptr: x.stable_ptr().untyped(), - severity: Severity::Warning, - }); - } - }) - } - - parameters -} - /// A handler for Dojo code that modifies a model struct. /// Parameters: /// * db: The semantic database. @@ -209,17 +32,11 @@ pub fn handle_model_struct( ) -> (RewriteNode, Vec) { let mut diagnostics = vec![]; - let parameters = get_model_parameters(db, struct_ast.clone(), &mut diagnostics); + let parameters = + get_parameters(db, &DOJO_MODEL_ATTR.to_string(), struct_ast.clone(), &mut diagnostics); let model_name = struct_ast.name(db).as_syntax_node().get_text(db).trim().to_string(); - let unmapped_namespace = parameters.namespace.unwrap_or(namespace_config.default.clone()); - - let model_namespace = if parameters.nomapping { - unmapped_namespace - } else { - // Maps namespace from the tag to ensure higher precision on matching namespace mappings. - namespace_config.get_mapping(&naming::get_tag(&unmapped_namespace, &model_name)) - }; + let model_namespace = compute_namespace(&model_name, ¶meters, namespace_config); for (id, value) in [("name", &model_name), ("namespace", &model_namespace)] { if !NamespaceConfig::is_name_valid(value) { @@ -245,7 +62,7 @@ pub fn handle_model_struct( let (model_version, model_selector) = match parameters.version { 0 => (RewriteNode::Text("0".to_string()), RewriteNode::Text(format!("\"{model_name}\""))), _ => ( - RewriteNode::Text(DEFAULT_MODEL_VERSION.to_string()), + RewriteNode::Text(DEFAULT_DATA_VERSION.to_string()), RewriteNode::Text( naming::compute_selector_from_hashes(model_namespace_hash, model_name_hash) .to_string(), @@ -253,38 +70,68 @@ pub fn handle_model_struct( ), }; - let mut members: Vec = vec![]; - let mut members_values: Vec = vec![]; - let mut param_keys: Vec = vec![]; + let members = parse_members(db, &struct_ast.members(db).elements(db), &mut diagnostics); + let mut serialized_keys: Vec = vec![]; - let mut serialized_param_keys: Vec = vec![]; let mut serialized_values: Vec = vec![]; - let mut field_accessors: Vec = vec![]; - let mut entity_field_accessors: Vec = vec![]; - let elements = struct_ast.members(db).elements(db); - elements.iter().for_each(|member_ast| { - let member = Member { - name: member_ast.name(db).text(db).to_string(), - ty: member_ast.type_clause(db).ty(db).as_syntax_node().get_text(db).trim().to_string(), - key: member_ast.has_attr(db, "key"), - }; + serialize_keys_and_values( + &members, + "serialized", + &mut serialized_keys, + "serialized", + &mut serialized_values, + ); + + if serialized_keys.is_empty() { + diagnostics.push(PluginDiagnostic { + message: "Model must define at least one #[key] attribute".into(), + stable_ptr: struct_ast.name(db).stable_ptr().untyped(), + severity: Severity::Error, + }); + } + + if serialized_values.is_empty() { + diagnostics.push(PluginDiagnostic { + message: "Model must define at least one member that is not a key".into(), + stable_ptr: struct_ast.name(db).stable_ptr().untyped(), + severity: Severity::Error, + }); + } + + let mut deserialized_keys: Vec = vec![]; + let mut deserialized_values: Vec = vec![]; + + deserialize_keys_and_values( + &members, + "keys", + &mut deserialized_keys, + "values", + &mut deserialized_values, + ); + let mut member_key_names: Vec = vec![]; + let mut member_value_names: Vec = vec![]; + let mut members_values: Vec = vec![]; + let mut param_keys: Vec = vec![]; + let mut serialized_param_keys: Vec = vec![]; + + members.iter().for_each(|member| { if member.key { - validate_key_member(&member, db, member_ast, &mut diagnostics); - serialized_keys.push(serialize_member_ty(&member, true)); - serialized_param_keys.push(serialize_member_ty(&member, false)); param_keys.push(format!("{}: {}", member.name, member.ty)); + serialized_param_keys.push(serialize_member_ty(member, false, "serialized")); + member_key_names.push(RewriteNode::Text(format!("{},\n", member.name.clone()))); } else { - serialized_values.push(serialize_member_ty(&member, true)); members_values .push(RewriteNode::Text(format!("pub {}: {},\n", member.name, member.ty))); + member_value_names.push(RewriteNode::Text(format!("{},\n", member.name.clone()))); } - - members.push(member); }); let param_keys = param_keys.join(", "); + let mut field_accessors: Vec = vec![]; + let mut entity_field_accessors: Vec = vec![]; + members.iter().filter(|m| !m.key).for_each(|member| { field_accessors.push(generate_field_accessors( model_name.clone(), @@ -295,22 +142,6 @@ pub fn handle_model_struct( entity_field_accessors.push(generate_entity_field_accessors(model_name.clone(), member)); }); - if serialized_keys.is_empty() { - diagnostics.push(PluginDiagnostic { - message: "Model must define at least one #[key] attribute".into(), - stable_ptr: struct_ast.name(db).stable_ptr().untyped(), - severity: Severity::Error, - }); - } - - if serialized_values.is_empty() { - diagnostics.push(PluginDiagnostic { - message: "Model must define at least one member that is not a key".into(), - stable_ptr: struct_ast.name(db).stable_ptr().untyped(), - severity: Severity::Error, - }); - } - aux_data.models.push(Model { name: model_name.clone(), namespace: model_namespace.clone(), @@ -351,22 +182,16 @@ pub impl $type_name$StoreImpl of $type_name$Store { core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> $type_name$ { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); - - let entity = core::serde::Serde::<$type_name$>::deserialize(ref serialized); - - if core::option::OptionTrait::<$type_name$>::is_none(@entity) { - panic!( - \"Model `$type_name$`: deserialization failed. Ensure the length of the keys tuple \ - is matching the number of #[key] fields in the model struct.\" - ); - } + fn from_values(ref keys: Span, ref values: Span) -> Option<$type_name$> { + $deserialized_keys$ + $deserialized_values$ - core::option::OptionTrait::<$type_name$>::unwrap(entity) + Option::Some( + $type_name$ { + $member_key_names$ + $member_value_names$ + } + ) } fn get(world: dojo::world::IWorldDispatcher, $param_keys$) -> $type_name$ { @@ -398,18 +223,15 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> $type_name$Entity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option<$type_name$Entity> { + $deserialized_values$ - let entity_values = core::serde::Serde::<$type_name$Entity>::deserialize(ref serialized); - if core::option::OptionTrait::<$type_name$Entity>::is_none(@entity_values) { - panic!( - \"ModelEntity `$type_name$Entity`: deserialization failed.\" - ); - } - core::option::OptionTrait::<$type_name$Entity>::unwrap(entity_values) + Option::Some( + $type_name$Entity { + __id: entity_id, + $member_value_names$ + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> $type_name$Entity { @@ -419,7 +241,12 @@ pub impl $type_name$ModelEntityImpl of dojo::model::ModelEntity<$type_name$Entit dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::<$type_name$>::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!(\"ModelEntity `$type_name$Entity`: deserialization failed.\") + } + } } fn update_entity(self: @$type_name$Entity, world: dojo::world::IWorldDispatcher) { @@ -520,7 +347,12 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { ); let mut _keys = keys; - $type_name$Store::from_values(ref _keys, ref values) + match $type_name$Store::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!(\"Model `$type_name$`: deserialization failed.\") + } + } } fn set_model( @@ -647,18 +479,18 @@ pub impl $type_name$ModelImpl of dojo::model::Model<$type_name$> { } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::<$type_name$>::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::<$type_name$>::layout() } #[inline(always)] - fn instance_layout(self: @$type_name$) -> dojo::model::Layout { + fn instance_layout(self: @$type_name$) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -740,19 +572,19 @@ pub mod $contract_name$ { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::<$type_name$>::size() + dojo::meta::introspect::Introspect::<$type_name$>::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::<$type_name$>::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::<$type_name$>::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::<$type_name$>::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::<$type_name$>::ty() } } @@ -766,9 +598,12 @@ pub mod $contract_name$ { &UnorderedHashMap::from([ ("contract_name".to_string(), RewriteNode::Text(model_name.to_case(Case::Snake))), ("type_name".to_string(), RewriteNode::Text(model_name)), - ("namespace".to_string(), RewriteNode::Text("namespace".to_string())), + ("member_key_names".to_string(), RewriteNode::new_modified(member_key_names)), + ("member_value_names".to_string(), RewriteNode::new_modified(member_value_names)), ("serialized_keys".to_string(), RewriteNode::new_modified(serialized_keys)), ("serialized_values".to_string(), RewriteNode::new_modified(serialized_values)), + ("deserialized_keys".to_string(), RewriteNode::new_modified(deserialized_keys)), + ("deserialized_values".to_string(), RewriteNode::new_modified(deserialized_values)), ("model_version".to_string(), model_version), ("model_selector".to_string(), model_selector), ("model_namespace".to_string(), RewriteNode::Text(model_namespace.clone())), @@ -795,48 +630,6 @@ pub mod $contract_name$ { ) } -/// Validates that the key member is valid. -/// # Arguments -/// -/// * member: The member to validate. -/// * diagnostics: The diagnostics to push to, if the member is an invalid key. -fn validate_key_member( - member: &Member, - db: &dyn SyntaxGroup, - member_ast: &MemberAst, - diagnostics: &mut Vec, -) { - if member.ty == "u256" { - diagnostics.push(PluginDiagnostic { - message: "Key is only supported for core types that are 1 felt long once serialized. \ - `u256` is a struct of 2 u128, hence not supported." - .into(), - stable_ptr: member_ast.name(db).stable_ptr().untyped(), - severity: Severity::Error, - }); - } -} - -/// Creates a [`RewriteNode`] for the member type serialization. -/// -/// # Arguments -/// -/// * member: The member to serialize. -fn serialize_member_ty(member: &Member, with_self: bool) -> RewriteNode { - match member.ty.as_str() { - "felt252" => RewriteNode::Text(format!( - "core::array::ArrayTrait::append(ref serialized, {}{});\n", - if with_self { "*self." } else { "" }, - member.name - )), - _ => RewriteNode::Text(format!( - "core::serde::Serde::serialize({}{}, ref serialized);\n", - if with_self { "self." } else { "@" }, - member.name - )), - } -} - /// Generates field accessors (`get_[field_name]` and `set_[field_name]`) for every /// fields of a model. /// diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index 317bf2cb87..0f662e201f 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -8,7 +8,6 @@ use cairo_lang_defs::plugin::{ }; use cairo_lang_diagnostics::Severity; use cairo_lang_semantic::plugin::PluginSuite; -use cairo_lang_starknet::plugin::aux_data::StarkNetEventAuxData; use cairo_lang_syntax::attribute::structured::{AttributeArgVariant, AttributeStructurize}; use cairo_lang_syntax::node::ast::Attribute; use cairo_lang_syntax::node::db::SyntaxGroup; @@ -43,6 +42,7 @@ pub const DOJO_CONTRACT_ATTR: &str = "dojo::contract"; pub const DOJO_INTERFACE_ATTR: &str = "dojo::interface"; pub const DOJO_MODEL_ATTR: &str = "dojo::model"; pub const DOJO_EVENT_ATTR: &str = "dojo::event"; +pub const DOJO_KEY_ATTR: &str = "key"; pub const DOJO_INTROSPECT_ATTR: &str = "Introspect"; pub const DOJO_PACKED_ATTR: &str = "IntrospectPacked"; @@ -54,6 +54,13 @@ pub struct Model { pub members: Vec, } +#[derive(Clone, Debug, PartialEq)] +pub struct Event { + pub name: String, + pub namespace: String, + pub members: Vec, +} + #[derive(Debug, PartialEq, Eq)] pub struct ContractAuxData { pub name: SmolStr, @@ -70,7 +77,7 @@ pub struct DojoAuxData { /// A list of contracts that were processed by the plugin and their model dependencies. pub contracts: Vec, /// A list of events that were processed by the plugin. - pub events: Vec, + pub events: Vec, } impl GeneratedFileAuxData for DojoAuxData { @@ -371,8 +378,12 @@ impl MacroPlugin for BuiltinDojoPlugin { match event_attrs.len().cmp(&1) { Ordering::Equal => { - let (event_rewrite_nodes, event_diagnostics) = - handle_event_struct(db, &mut aux_data, struct_ast.clone()); + let (event_rewrite_nodes, event_diagnostics) = handle_event_struct( + db, + &mut aux_data, + struct_ast.clone(), + &namespace_config, + ); rewrite_nodes.push(event_rewrite_nodes); diagnostics.extend(event_diagnostics); } @@ -442,7 +453,7 @@ impl MacroPlugin for BuiltinDojoPlugin { DOJO_CONTRACT_ATTR.to_string(), DOJO_EVENT_ATTR.to_string(), DOJO_MODEL_ATTR.to_string(), - "key".to_string(), + DOJO_KEY_ATTR.to_string(), ] } diff --git a/crates/dojo-lang/src/plugin_test.rs b/crates/dojo-lang/src/plugin_test.rs index 4023b900c4..35de830dff 100644 --- a/crates/dojo-lang/src/plugin_test.rs +++ b/crates/dojo-lang/src/plugin_test.rs @@ -28,6 +28,7 @@ cairo_lang_test_utils::test_file_test!( "src/plugin_test_data", { model: "model", + event: "event", print: "print", introspect: "introspect", system: "system", diff --git a/crates/dojo-lang/src/plugin_test_data/event b/crates/dojo-lang/src/plugin_test_data/event new file mode 100644 index 0000000000..db6e5022da --- /dev/null +++ b/crates/dojo-lang/src/plugin_test_data/event @@ -0,0 +1,1868 @@ +//! > Test expansion of the dojo::event. + +//! > test_runner_name +test_expand_plugin + +//! > test_id +event + +//! > cairo_code +#[derive(Drop, Serde)] +#[dojo::model] +pub struct Message { + #[key] + pub identity: ContractAddress, + #[key] + pub channel: felt252, + pub message: ByteArray, + #[key] + pub salt: felt252 +} + +#[dojo::event(namespace: 'my_namespace')] +struct MyEvent { + #[key] + id: felt252, + name: ByteArray, +} + +//! > expanded_cairo_code +#[derive(Drop, Serde)] +#[dojo::model] +pub struct Message { + #[key] + pub identity: ContractAddress, + #[key] + pub channel: felt252, + pub message: ByteArray, + #[key] + pub salt: felt252 +} + +#[dojo::event(namespace: 'my_namespace')] +struct MyEvent { + #[key] + id: felt252, + name: ByteArray, +}impl MessageDrop of core::traits::Drop::; +impl MessageSerde of core::serde::Serde:: { + fn serialize(self: @Message, ref output: core::array::Array) { + core::serde::Serde::serialize(self.identity, ref output); + core::serde::Serde::serialize(self.channel, ref output); + core::serde::Serde::serialize(self.message, ref output); + core::serde::Serde::serialize(self.salt, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(Message { + identity: core::serde::Serde::deserialize(ref serialized)?, + channel: core::serde::Serde::deserialize(ref serialized)?, + message: core::serde::Serde::deserialize(ref serialized)?, + salt: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} + +impl MessageIntrospect<> of dojo::meta::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + Option::None + } + + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( + array![ + dojo::meta::FieldLayout { + selector: 1234962429638067342109111948666382589302318509162806680039978245403372666376, + layout: dojo::meta::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { + name: 'Message', + attrs: array![].span(), + children: array![ + dojo::meta::introspect::Member { + name: 'identity', + attrs: array!['key'].span(), + ty: dojo::meta::introspect::Introspect::::ty() + }, +dojo::meta::introspect::Member { + name: 'channel', + attrs: array!['key'].span(), + ty: dojo::meta::introspect::Introspect::::ty() + }, +dojo::meta::introspect::Member { + name: 'message', + attrs: array![].span(), + ty: dojo::meta::introspect::Ty::ByteArray + }, +dojo::meta::introspect::Member { + name: 'salt', + attrs: array!['key'].span(), + ty: dojo::meta::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +#[derive(Drop, Serde)] +pub struct MessageEntity { + __id: felt252, // private field + pub message: ByteArray, + +} + +#[generate_trait] +pub impl MessageEntityStoreImpl of MessageEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> MessageEntity { + MessageModelEntityImpl::get(world, entity_id) + } + + fn update(self: @MessageEntity, world: dojo::world::IWorldDispatcher) { + dojo::model::ModelEntity::::update_entity(self, world); + } + + fn delete(self: @MessageEntity, world: dojo::world::IWorldDispatcher) { + dojo::model::ModelEntity::::delete_entity(self, world); + } + + + fn get_message(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ByteArray { + let mut values = dojo::model::ModelEntity::::get_member( + world, + entity_id, + 1234962429638067342109111948666382589302318509162806680039978245403372666376 + ); + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Message::message`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_message(self: @MessageEntity, world: dojo::world::IWorldDispatcher, value: ByteArray) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1234962429638067342109111948666382589302318509162806680039978245403372666376, + serialized.span() + ); + } + +} + +#[generate_trait] +pub impl MessageStoreImpl of MessageStore { + fn entity_id_from_keys(identity: ContractAddress, channel: felt252, salt: felt252) -> felt252 { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@identity, ref serialized); +core::serde::Serde::serialize(@channel, ref serialized); +core::serde::Serde::serialize(@salt, ref serialized); + + core::poseidon::poseidon_hash_span(serialized.span()) + } + + fn from_values(ref keys: Span, ref values: Span) -> Option { + let identity = core::serde::Serde::::deserialize(ref keys)?; +let channel = core::serde::Serde::::deserialize(ref keys)?; +let salt = core::serde::Serde::::deserialize(ref keys)?; + + let message = core::serde::Serde::::deserialize(ref values)?; + + + Option::Some( + Message { + identity, +channel, +salt, + + message, + + } + ) + } + + fn get(world: dojo::world::IWorldDispatcher, identity: ContractAddress, channel: felt252, salt: felt252) -> Message { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@identity, ref serialized); +core::serde::Serde::serialize(@channel, ref serialized); +core::serde::Serde::serialize(@salt, ref serialized); + + + dojo::model::Model::::get(world, serialized.span()) + } + + fn set(self: @Message, world: dojo::world::IWorldDispatcher) { + dojo::model::Model::::set_model(self, world); + } + + fn delete(self: @Message, world: dojo::world::IWorldDispatcher) { + dojo::model::Model::::delete_model(self, world); + } + + + fn get_message(world: dojo::world::IWorldDispatcher, identity: ContractAddress, channel: felt252, salt: felt252) -> ByteArray { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@identity, ref serialized); +core::serde::Serde::serialize(@channel, ref serialized); +core::serde::Serde::serialize(@salt, ref serialized); + + + let mut values = dojo::model::Model::::get_member( + world, + serialized.span(), + 1234962429638067342109111948666382589302318509162806680039978245403372666376 + ); + + let field_value = core::serde::Serde::::deserialize(ref values); + + if core::option::OptionTrait::::is_none(@field_value) { + panic!( + "Field `Message::message`: deserialization failed." + ); + } + + core::option::OptionTrait::::unwrap(field_value) + } + + fn set_message(self: @Message, world: dojo::world::IWorldDispatcher, value: ByteArray) { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(@value, ref serialized); + + self.set_member( + world, + 1234962429638067342109111948666382589302318509162806680039978245403372666376, + serialized.span() + ); + } + +} + +pub impl MessageModelEntityImpl of dojo::model::ModelEntity { + fn id(self: @MessageEntity) -> felt252 { + *self.__id + } + + fn values(self: @MessageEntity) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.message, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let message = core::serde::Serde::::deserialize(ref values)?; + + + Option::Some( + MessageEntity { + __id: entity_id, + message, + + } + ) + } + + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> MessageEntity { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(entity_id), + dojo::model::Model::::layout() + ); + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `MessageEntity`: deserialization failed.") + } + } + } + + fn update_entity(self: @MessageEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + self.values(), + dojo::model::Model::::layout() + ); + } + + fn delete_entity(self: @MessageEntity, world: dojo::world::IWorldDispatcher) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::Id(self.id()), + dojo::model::Model::::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + entity_id: felt252, + member_id: felt252, + ) -> Span { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @MessageEntity, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span, + ) { + match dojo::utils::find_model_field_layout(dojo::model::Model::::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + dojo::model::Model::::selector(), + dojo::model::ModelIndex::MemberId((self.id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } +} + +pub impl MessageModelImpl of dojo::model::Model { + fn get(world: dojo::world::IWorldDispatcher, keys: Span) -> Message { + let mut values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(keys), + Self::layout() + ); + let mut _keys = keys; + + match MessageStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `Message`: deserialization failed.") + } + } + } + + fn set_model( + self: @Message, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::values(self), + Self::layout() + ); + } + + fn delete_model( + self: @Message, + world: dojo::world::IWorldDispatcher + ) { + dojo::world::IWorldDispatcherTrait::delete_entity( + world, + Self::selector(), + dojo::model::ModelIndex::Keys(Self::keys(self)), + Self::layout() + ); + } + + fn get_member( + world: dojo::world::IWorldDispatcher, + keys: Span, + member_id: felt252 + ) -> Span { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + let entity_id = dojo::utils::entity_id_from_keys(keys); + dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((entity_id, member_id)), + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + fn set_member( + self: @Message, + world: dojo::world::IWorldDispatcher, + member_id: felt252, + values: Span + ) { + match dojo::utils::find_model_field_layout(Self::layout(), member_id) { + Option::Some(field_layout) => { + dojo::world::IWorldDispatcherTrait::set_entity( + world, + Self::selector(), + dojo::model::ModelIndex::MemberId((self.entity_id(), member_id)), + values, + field_layout + ) + }, + Option::None => core::panic_with_felt252('bad member id') + } + } + + #[inline(always)] + fn name() -> ByteArray { + "Message" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_test" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_test-Message" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 1906185680711303922822303398414928927091284519615502535643957313578662707163 + } + + #[inline(always)] + fn instance_selector(self: @Message) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 1218932985479400212550774377351312162398071867364919833219536439613388630232 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 1452123528942907587532668415362544424816022573043154497385993678618948064048 + } + + #[inline(always)] + fn entity_id(self: @Message) -> felt252 { + core::poseidon::poseidon_hash_span(self.keys()) + } + + #[inline(always)] + fn keys(self: @Message) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.identity, ref serialized); +core::serde::Serde::serialize(self.channel, ref serialized); +core::serde::Serde::serialize(self.salt, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @Message) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.message, ref serialized); + + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @Message) -> dojo::meta::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::meta::layout::compute_packed_size(Self::layout()) + } +} + +#[starknet::interface] +pub trait Imessage { + fn ensure_abi(self: @T, model: Message); +} + +#[starknet::contract] +pub mod message { + use super::Message; + use super::Imessage; + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + fn name(self: @ContractState) -> ByteArray { + dojo::model::Model::::name() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + + fn version(self: @ContractState) -> u8 { + dojo::model::Model::::version() + } + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::meta::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::meta::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl messageImpl of Imessage{ + fn ensure_abi(self: @ContractState, model: Message) { + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct StorageStorageBase { +} +impl StorageStorageImpl of starknet::storage::StorageTrait { + type BaseType = StorageStorageBase; + fn storage(self: starknet::storage::FlattenedStorage) -> StorageStorageBase { + StorageStorageBase { + } + } +} +#[derive(Drop, Copy)] +pub struct StorageStorageBaseMut { +} +impl StorageStorageMutImpl of starknet::storage::StorageTraitMut { + type BaseType = StorageStorageBaseMut; + fn storage_mut(self: starknet::storage::FlattenedStorage>) -> StorageStorageBaseMut { + StorageStorageBaseMut { + } + } +} + +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = starknet::storage::FlattenedStorage; + fn snapshot_deref(self: @ContractState) -> starknet::storage::FlattenedStorage { + starknet::storage::FlattenedStorage {} + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = starknet::storage::FlattenedStorage> ; + fn deref_mut(ref self: ContractState) -> starknet::storage::FlattenedStorage> { + starknet::storage::FlattenedStorage {} + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoModelImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__messageImpl__ensure_abi(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + let __arg_model = core::option::OptionTraitImpl::expect( + core::serde::Serde::::deserialize(ref data), + 'Failed to deserialize param #1' + ); + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + messageImpl::ensure_abi(@contract_state, __arg_model); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoModelImpl__name as name; + pub use super::__wrapper__DojoModelImpl__namespace as namespace; + pub use super::__wrapper__DojoModelImpl__tag as tag; + pub use super::__wrapper__DojoModelImpl__version as version; + pub use super::__wrapper__DojoModelImpl__selector as selector; + pub use super::__wrapper__DojoModelImpl__name_hash as name_hash; + pub use super::__wrapper__DojoModelImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoModelImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoModelImpl__packed_size as packed_size; + pub use super::__wrapper__DojoModelImpl__layout as layout; + pub use super::__wrapper__DojoModelImpl__schema as schema; + pub use super::__wrapper__messageImpl__ensure_abi as ensure_abi; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl StorageStorageBaseDrop of core::traits::Drop::; +impl StorageStorageBaseCopy of core::traits::Copy::; +impl StorageStorageBaseMutDrop of core::traits::Drop::; +impl StorageStorageBaseMutCopy of core::traits::Copy::; +} + +impl MyEventStrkEventImpl of starknet::Event { + + fn append_keys_and_data( + self: @MyEvent, ref keys: Array, ref data: Array + ) { + core::array::ArrayTrait::append( + ref keys, dojo::event::Event::::selector() + ); + core::serde::Serde::serialize(self.id, ref keys); + + core::serde::Serde::serialize(self.name, ref data); + + } + + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let _ = keys.pop_front(); + + let id = core::serde::Serde::::deserialize(ref keys)?; + + let name = core::serde::Serde::::deserialize(ref data)?; + + + Option::Some( + MyEvent { + id, +name, + + } + ) + } +} + +pub impl MyEventEventImpl of dojo::event::Event { + + #[inline(always)] + fn name() -> ByteArray { + "MyEvent" + } + + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_test" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_test-MyEvent" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2958269534562238924109099397789946589799451573209932519429687453334341163903 + } + + #[inline(always)] + fn instance_selector(self: @MyEvent) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn name_hash() -> felt252 { + 92771332008364601068068539620837138880006294407614916787687390903459976481 + } + + #[inline(always)] + fn namespace_hash() -> felt252 { + 1452123528942907587532668415362544424816022573043154497385993678618948064048 + } + + #[inline(always)] + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + dojo::meta::layout::compute_packed_size(Self::layout()) + } + + #[inline(always)] + fn unpacked_size() -> Option { + dojo::meta::introspect::Introspect::::size() + } + + #[inline(always)] + fn schema(self: @MyEvent) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() + } + +} + +#[starknet::contract] +pub mod my_event { + use super::MyEvent; + + #[abi(embed_v0)] + impl DojoEventImpl of dojo::event::IEvent{ + fn name(self: @ContractState) -> ByteArray { + dojo::event::Event::::name() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::event::Event::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::event::Event::::tag() + } + + fn version(self: @ContractState) -> u8 { + dojo::event::Event::::version() + } + + fn selector(self: @ContractState) -> felt252 { + dojo::event::Event::::selector() + } + + fn name_hash(self: @ContractState) -> felt252 { + dojo::event::Event::::name_hash() + } + + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::event::Event::::namespace_hash() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::meta::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::event::Event::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::meta::Layout { + dojo::event::Event::::layout() + } + + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() + } + } +#[event] +#[derive(Drop, starknet::Event)] +pub enum Event {} + + +#[phantom] +pub struct Storage { +} + +#[derive(Drop, Copy)] +pub struct StorageStorageBase { +} +impl StorageStorageImpl of starknet::storage::StorageTrait { + type BaseType = StorageStorageBase; + fn storage(self: starknet::storage::FlattenedStorage) -> StorageStorageBase { + StorageStorageBase { + } + } +} +#[derive(Drop, Copy)] +pub struct StorageStorageBaseMut { +} +impl StorageStorageMutImpl of starknet::storage::StorageTraitMut { + type BaseType = StorageStorageBaseMut; + fn storage_mut(self: starknet::storage::FlattenedStorage>) -> StorageStorageBaseMut { + StorageStorageBaseMut { + } + } +} + +pub struct ContractState { +} + +impl ContractStateDrop of Drop {} + +impl ContractStateDeref of core::ops::SnapshotDeref { + type Target = starknet::storage::FlattenedStorage; + fn snapshot_deref(self: @ContractState) -> starknet::storage::FlattenedStorage { + starknet::storage::FlattenedStorage {} + } +} +impl ContractStateDerefMut of core::ops::DerefMut { + type Target = starknet::storage::FlattenedStorage> ; + fn deref_mut(ref self: ContractState) -> starknet::storage::FlattenedStorage> { + starknet::storage::FlattenedStorage {} + } +} +pub fn unsafe_new_contract_state() -> ContractState { + ContractState { + } +} + +// TODO(Gil): This generates duplicate diagnostics because of the plugin system, squash the duplicates into one. +#[deprecated( + feature: "deprecated_legacy_map", + note: "Use `starknet::storage::Map` instead." +)] +use starknet::storage::Map as LegacyMap; + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__name(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::name(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__namespace(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::namespace(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__tag(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::tag(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__version(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::version(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__selector(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::selector(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__name_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::name_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__namespace_hash(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::namespace_hash(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__unpacked_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::unpacked_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__packed_size(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::packed_size(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::>::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__layout(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::layout(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + +#[implicit_precedence(core::pedersen::Pedersen, core::RangeCheck, core::integer::Bitwise, core::ec::EcOp, core::poseidon::Poseidon, core::SegmentArena, core::circuit::RangeCheck96, core::circuit::AddMod, core::circuit::MulMod, core::gas::GasBuiltin, System)] +fn __wrapper__DojoEventImpl__schema(mut data: Span::) -> Span:: { + core::internal::require_implicit::(); + core::internal::revoke_ap_tracking(); + core::option::OptionTraitImpl::expect(core::gas::withdraw_gas(), 'Out of gas'); + + assert(core::array::SpanTrait::is_empty(data), 'Input too long for arguments'); + core::option::OptionTraitImpl::expect( + core::gas::withdraw_gas_all(core::gas::get_builtin_costs()), 'Out of gas', + ); + let mut contract_state = unsafe_new_contract_state(); + let res = DojoEventImpl::schema(@contract_state, ); + let mut arr = ArrayTrait::new(); + // References. + // Result. + core::serde::Serde::::serialize(@res, ref arr); + core::array::ArrayTrait::span(@arr) +} + + +pub mod __external { + pub use super::__wrapper__DojoEventImpl__name as name; + pub use super::__wrapper__DojoEventImpl__namespace as namespace; + pub use super::__wrapper__DojoEventImpl__tag as tag; + pub use super::__wrapper__DojoEventImpl__version as version; + pub use super::__wrapper__DojoEventImpl__selector as selector; + pub use super::__wrapper__DojoEventImpl__name_hash as name_hash; + pub use super::__wrapper__DojoEventImpl__namespace_hash as namespace_hash; + pub use super::__wrapper__DojoEventImpl__unpacked_size as unpacked_size; + pub use super::__wrapper__DojoEventImpl__packed_size as packed_size; + pub use super::__wrapper__DojoEventImpl__layout as layout; + pub use super::__wrapper__DojoEventImpl__schema as schema; +} +pub mod __l1_handler { +} +pub mod __constructor { +} + impl ContractStateEventEmitter of starknet::event::EventEmitter< + ContractState, Event + > { + fn emit>( + ref self: ContractState, event: S + ) { + let event: Event = core::traits::Into::into(event); + let mut keys = Default::::default(); + let mut data = Default::::default(); + starknet::Event::append_keys_and_data(@event, ref keys, ref data); + starknet::SyscallResultTrait::unwrap_syscall( + starknet::syscalls::emit_event_syscall( + core::array::ArrayTrait::span(@keys), + core::array::ArrayTrait::span(@data), + ) + ) + } + } +impl EventDrop of core::traits::Drop::; +impl EventIsEvent of starknet::Event { + fn append_keys_and_data( + self: @Event, ref keys: Array, ref data: Array + ) { + match self { + } + } + fn deserialize( + ref keys: Span, ref data: Span, + ) -> Option { + let __selector__ = *core::array::SpanTrait::pop_front(ref keys)?; + Option::None + } +} +impl StorageStorageBaseDrop of core::traits::Drop::; +impl StorageStorageBaseCopy of core::traits::Copy::; +impl StorageStorageBaseMutDrop of core::traits::Drop::; +impl StorageStorageBaseMutCopy of core::traits::Copy::; +} +impl MessageEntityDrop of core::traits::Drop::; +impl MessageEntitySerde of core::serde::Serde:: { + fn serialize(self: @MessageEntity, ref output: core::array::Array) { + core::serde::Serde::serialize(self.__id, ref output); + core::serde::Serde::serialize(self.message, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(MessageEntity { + __id: core::serde::Serde::deserialize(ref serialized)?, + message: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +pub trait MessageEntityStore { + fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> MessageEntity; + + fn update(self: @MessageEntity, world: dojo::world::IWorldDispatcher); + + fn delete(self: @MessageEntity, world: dojo::world::IWorldDispatcher); + + + fn get_message(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ByteArray; + + fn set_message(self: @MessageEntity, world: dojo::world::IWorldDispatcher, value: ByteArray); + +} +pub trait MessageStore { + fn entity_id_from_keys(identity: ContractAddress, channel: felt252, salt: felt252) -> felt252; + + fn from_values(ref keys: Span, ref values: Span) -> Option; + + fn get(world: dojo::world::IWorldDispatcher, identity: ContractAddress, channel: felt252, salt: felt252) -> Message; + + fn set(self: @Message, world: dojo::world::IWorldDispatcher); + + fn delete(self: @Message, world: dojo::world::IWorldDispatcher); + + + fn get_message(world: dojo::world::IWorldDispatcher, identity: ContractAddress, channel: felt252, salt: felt252) -> ByteArray; + + fn set_message(self: @Message, world: dojo::world::IWorldDispatcher, value: ByteArray); + +} +pub trait ImessageDispatcherTrait { + fn ensure_abi(self: T, model: Message); +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct ImessageDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl ImessageDispatcherImpl of ImessageDispatcherTrait { + fn ensure_abi(self: ImessageDispatcher, model: Message) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct ImessageLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl ImessageLibraryDispatcherImpl of ImessageDispatcherTrait { + fn ensure_abi(self: ImessageLibraryDispatcher, model: Message) { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = starknet::SyscallResultTrait::unwrap_syscall(__dispatcher_return_data__); + () + } + +} + +pub trait ImessageSafeDispatcherTrait { + #[unstable(feature: "safe_dispatcher")] + fn ensure_abi(self: T, model: Message) -> starknet::SyscallResult<()>; +} + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct ImessageSafeLibraryDispatcher { + pub class_hash: starknet::ClassHash, +} + +impl ImessageSafeLibraryDispatcherImpl of ImessageSafeDispatcherTrait { + fn ensure_abi(self: ImessageSafeLibraryDispatcher, model: Message) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::library_call_syscall( + self.class_hash, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} + + +#[derive(Copy, Drop, starknet::Store, Serde)] +pub struct ImessageSafeDispatcher { + pub contract_address: starknet::ContractAddress, +} + +impl ImessageSafeDispatcherImpl of ImessageSafeDispatcherTrait { + fn ensure_abi(self: ImessageSafeDispatcher, model: Message) -> starknet::SyscallResult<()> { + let mut __calldata__ = core::traits::Default::default(); + core::serde::Serde::::serialize(@model, ref __calldata__); + + let mut __dispatcher_return_data__ = starknet::syscalls::call_contract_syscall( + self.contract_address, + selector!("ensure_abi"), + core::array::ArrayTrait::span(@__calldata__), + ); + let mut __dispatcher_return_data__ = __dispatcher_return_data__?; + Result::Ok(()) + } + +} +impl ImessageDispatcherCopy of core::traits::Copy::; +impl ImessageDispatcherDrop of core::traits::Drop::; +impl ImessageDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @ImessageDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ImessageDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImessageDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + ImessageDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: ImessageDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + ImessageDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: ImessageDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +pub struct ImessageDispatcherSubPointers { + pub contract_address: starknet::storage::StoragePointer, +} +impl ImessageDispatcherSubPointersImpl of starknet::storage::SubPointers { + type SubPointersType = ImessageDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> ImessageDispatcherSubPointers { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let contract_address_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +pub struct ImessageDispatcherSubPointersMut { + pub contract_address: starknet::storage::StoragePointer>, +} +impl ImessageDispatcherSubPointersMutImpl of starknet::storage::SubPointersMut { + type SubPointersType = ImessageDispatcherSubPointersMut; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> ImessageDispatcherSubPointersMut { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let contract_address_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageDispatcherSubPointersMut { + contract_address: contract_address_value, + } + } +} +impl ImessageLibraryDispatcherCopy of core::traits::Copy::; +impl ImessageLibraryDispatcherDrop of core::traits::Drop::; +impl ImessageLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @ImessageLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ImessageLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImessageLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + ImessageLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: ImessageLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + ImessageLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: ImessageLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +pub struct ImessageLibraryDispatcherSubPointers { + pub class_hash: starknet::storage::StoragePointer, +} +impl ImessageLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { + type SubPointersType = ImessageLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> ImessageLibraryDispatcherSubPointers { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let class_hash_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +pub struct ImessageLibraryDispatcherSubPointersMut { + pub class_hash: starknet::storage::StoragePointer>, +} +impl ImessageLibraryDispatcherSubPointersMutImpl of starknet::storage::SubPointersMut { + type SubPointersType = ImessageLibraryDispatcherSubPointersMut; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> ImessageLibraryDispatcherSubPointersMut { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let class_hash_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageLibraryDispatcherSubPointersMut { + class_hash: class_hash_value, + } + } +} +impl ImessageSafeLibraryDispatcherCopy of core::traits::Copy::; +impl ImessageSafeLibraryDispatcherDrop of core::traits::Drop::; +impl ImessageSafeLibraryDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @ImessageSafeLibraryDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.class_hash, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ImessageSafeLibraryDispatcher { + class_hash: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImessageSafeLibraryDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + ImessageSafeLibraryDispatcher { + class_hash, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: ImessageSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let class_hash = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + ImessageSafeLibraryDispatcher { + class_hash, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: ImessageSafeLibraryDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.class_hash)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +pub struct ImessageSafeLibraryDispatcherSubPointers { + pub class_hash: starknet::storage::StoragePointer, +} +impl ImessageSafeLibraryDispatcherSubPointersImpl of starknet::storage::SubPointers { + type SubPointersType = ImessageSafeLibraryDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> ImessageSafeLibraryDispatcherSubPointers { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let class_hash_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageSafeLibraryDispatcherSubPointers { + class_hash: class_hash_value, + } + } +} +#[derive(Drop, Copy)] +pub struct ImessageSafeLibraryDispatcherSubPointersMut { + pub class_hash: starknet::storage::StoragePointer>, +} +impl ImessageSafeLibraryDispatcherSubPointersMutImpl of starknet::storage::SubPointersMut { + type SubPointersType = ImessageSafeLibraryDispatcherSubPointersMut; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> ImessageSafeLibraryDispatcherSubPointersMut { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let class_hash_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageSafeLibraryDispatcherSubPointersMut { + class_hash: class_hash_value, + } + } +} +impl ImessageSafeDispatcherCopy of core::traits::Copy::; +impl ImessageSafeDispatcherDrop of core::traits::Drop::; +impl ImessageSafeDispatcherSerde of core::serde::Serde:: { + fn serialize(self: @ImessageSafeDispatcher, ref output: core::array::Array) { + core::serde::Serde::serialize(self.contract_address, ref output) + } + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + core::option::Option::Some(ImessageSafeDispatcher { + contract_address: core::serde::Serde::deserialize(ref serialized)?, + }) + } +} +impl StoreImessageSafeDispatcher of starknet::Store:: { + fn read(address_domain: u32, base: starknet::storage_access::StorageBaseAddress) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read(address_domain, base)?; + starknet::SyscallResult::Ok( + ImessageSafeDispatcher { + contract_address, + } + ) + } + fn write(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, value: ImessageSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write(address_domain, base, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + fn read_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8) -> starknet::SyscallResult { + let contract_address = starknet::Store::::read_at_offset(address_domain, base, offset)?; + starknet::SyscallResult::Ok( + ImessageSafeDispatcher { + contract_address, + } + ) + } + #[inline(always)] + fn write_at_offset(address_domain: u32, base: starknet::storage_access::StorageBaseAddress, offset: u8, value: ImessageSafeDispatcher) -> starknet::SyscallResult<()> { + starknet::Store::::write_at_offset(address_domain, base, offset, value.contract_address)?; + starknet::SyscallResult::Ok(()) + } + #[inline(always)] + fn size() -> u8 { + starknet::Store::::size() + } +} + +#[derive(Drop, Copy)] +pub struct ImessageSafeDispatcherSubPointers { + pub contract_address: starknet::storage::StoragePointer, +} +impl ImessageSafeDispatcherSubPointersImpl of starknet::storage::SubPointers { + type SubPointersType = ImessageSafeDispatcherSubPointers; + fn sub_pointers(self: starknet::storage::StoragePointer) -> ImessageSafeDispatcherSubPointers { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let contract_address_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageSafeDispatcherSubPointers { + contract_address: contract_address_value, + } + } +} +#[derive(Drop, Copy)] +pub struct ImessageSafeDispatcherSubPointersMut { + pub contract_address: starknet::storage::StoragePointer>, +} +impl ImessageSafeDispatcherSubPointersMutImpl of starknet::storage::SubPointersMut { + type SubPointersType = ImessageSafeDispatcherSubPointersMut; + fn sub_pointers_mut(self: starknet::storage::StoragePointer>) -> ImessageSafeDispatcherSubPointersMut { + let base_address = self.__storage_pointer_address__; + let mut current_offset = self.__storage_pointer_offset__; + let contract_address_value = starknet::storage::StoragePointer { + __storage_pointer_address__: base_address, + __storage_pointer_offset__: current_offset, + }; + ImessageSafeDispatcherSubPointersMut { + contract_address: contract_address_value, + } + } +} +impl ImessageDispatcherSubPointersDrop of core::traits::Drop::; +impl ImessageDispatcherSubPointersCopy of core::traits::Copy::; +impl ImessageDispatcherSubPointersMutDrop of core::traits::Drop::; +impl ImessageDispatcherSubPointersMutCopy of core::traits::Copy::; +impl ImessageLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl ImessageLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl ImessageLibraryDispatcherSubPointersMutDrop of core::traits::Drop::; +impl ImessageLibraryDispatcherSubPointersMutCopy of core::traits::Copy::; +impl ImessageSafeLibraryDispatcherSubPointersDrop of core::traits::Drop::; +impl ImessageSafeLibraryDispatcherSubPointersCopy of core::traits::Copy::; +impl ImessageSafeLibraryDispatcherSubPointersMutDrop of core::traits::Drop::; +impl ImessageSafeLibraryDispatcherSubPointersMutCopy of core::traits::Copy::; +impl ImessageSafeDispatcherSubPointersDrop of core::traits::Drop::; +impl ImessageSafeDispatcherSubPointersCopy of core::traits::Copy::; +impl ImessageSafeDispatcherSubPointersMutDrop of core::traits::Drop::; +impl ImessageSafeDispatcherSubPointersMutCopy of core::traits::Copy::; + +//! > expected_diagnostics diff --git a/crates/dojo-lang/src/plugin_test_data/introspect b/crates/dojo-lang/src/plugin_test_data/introspect index 90233dbf2f..4c5b7b38a0 100644 --- a/crates/dojo-lang/src/plugin_test_data/introspect +++ b/crates/dojo-lang/src/plugin_test_data/introspect @@ -529,22 +529,22 @@ impl Vec2Serde of core::serde::Serde:: { } } -impl Vec2Introspect<> of dojo::model::introspect::Introspect> { +impl Vec2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, - layout: dojo::model::introspect::Introspect::::layout() } ].span() @@ -552,21 +552,21 @@ dojo::model::FieldLayout { } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'Vec2', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -595,36 +595,36 @@ impl PlainEnumSerde of core::serde::Serde:: { impl PlainEnumCopy of core::traits::Copy::; impl PlainEnumDrop of core::traits::Drop::; -impl PlainEnumIntrospect<> of dojo::model::introspect::Introspect> { +impl PlainEnumIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::Layout::Fixed(array![].span()) + layout: dojo::meta::Layout::Fixed(array![].span()) }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::Layout::Fixed(array![].span()) + layout: dojo::meta::Layout::Fixed(array![].span()) } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'PlainEnum', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Ty::Tuple(array![].span())), -('Right', dojo::model::introspect::Ty::Tuple(array![].span())) + ('Left', dojo::meta::introspect::Ty::Tuple(array![].span())), +('Right', dojo::meta::introspect::Ty::Tuple(array![].span())) ].span() } @@ -652,36 +652,36 @@ impl EnumWithPrimitiveSerde of core::serde::Serde:: { impl EnumWithPrimitiveCopy of core::traits::Copy::; impl EnumWithPrimitiveDrop of core::traits::Drop::; -impl EnumWithPrimitiveIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithPrimitiveIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithPrimitive', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Introspect::::ty()), -('Right', dojo::model::introspect::Introspect::::ty()) + ('Left', dojo::meta::introspect::Introspect::::ty()), +('Right', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -709,11 +709,11 @@ impl EnumWithStructSerde of core::serde::Serde:: { impl EnumWithStructCopy of core::traits::Copy::; impl EnumWithStructDrop of core::traits::Drop::; -impl EnumWithStructIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithStructIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(1) ]; @@ -724,30 +724,30 @@ Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithStruct', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Introspect::::ty()), -('Right', dojo::model::introspect::Introspect::::ty()) + ('Left', dojo::meta::introspect::Introspect::::ty()), +('Right', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -775,42 +775,42 @@ impl EnumWithSimpleArraySerde of core::serde::Serde:: { impl EnumWithSimpleArrayCopy of core::traits::Copy::; impl EnumWithSimpleArrayDrop of core::traits::Drop::; -impl EnumWithSimpleArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithSimpleArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::>::layout() + layout: dojo::meta::introspect::Introspect::>::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::>::layout() + layout: dojo::meta::introspect::Introspect::>::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithSimpleArray', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Ty::Array( + ('Left', dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() )), -('Right', dojo::model::introspect::Ty::Array( +('Right', dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() )) @@ -840,36 +840,36 @@ impl EnumWithByteArraySerde of core::serde::Serde:: { impl EnumWithByteArrayCopy of core::traits::Copy::; impl EnumWithByteArrayDrop of core::traits::Drop::; -impl EnumWithByteArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithByteArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithByteArray', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Ty::ByteArray), -('Right', dojo::model::introspect::Ty::ByteArray) + ('Left', dojo::meta::introspect::Ty::ByteArray), +('Right', dojo::meta::introspect::Ty::ByteArray) ].span() } @@ -897,30 +897,30 @@ impl EnumWithSimpleTupleSerde of core::serde::Serde:: { impl EnumWithSimpleTupleCopy of core::traits::Copy::; impl EnumWithSimpleTupleDrop of core::traits::Drop::; -impl EnumWithSimpleTupleIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithSimpleTupleIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(4) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -929,22 +929,22 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithSimpleTuple', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Ty::Tuple( + ('Left', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )), -('Right', dojo::model::introspect::Ty::Tuple( +('Right', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )) @@ -974,11 +974,11 @@ impl EnumWithComplexTupleSerde of core::serde::Serde:: { impl EnumWithComplexTupleCopy of core::traits::Copy::; impl EnumWithComplexTupleDrop of core::traits::Drop::; -impl EnumWithComplexTupleIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithComplexTupleIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(2) ]; @@ -989,24 +989,24 @@ Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -1015,22 +1015,22 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithComplexTuple', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Ty::Tuple( + ('Left', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )), -('Right', dojo::model::introspect::Ty::Tuple( +('Right', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )) @@ -1060,36 +1060,36 @@ impl EnumWithPrimitiveSerde of core::serde::Serde:: { impl EnumWithPrimitiveCopy of core::traits::Copy::; impl EnumWithPrimitiveDrop of core::traits::Drop::; -impl EnumWithPrimitiveIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithPrimitiveIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithPrimitive', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Introspect::::ty()), -('Right', dojo::model::introspect::Introspect::::ty()) + ('Left', dojo::meta::introspect::Introspect::::ty()), +('Right', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -1117,11 +1117,11 @@ impl EnumCustomSerde of core::serde::Serde:: { impl EnumCustomCopy of core::traits::Copy::; impl EnumCustomDrop of core::traits::Drop::; -impl EnumCustomIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumCustomIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(1) ]; @@ -1132,30 +1132,30 @@ Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumCustom', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Introspect::::ty()), -('Right', dojo::model::introspect::Introspect::::ty()) + ('Left', dojo::meta::introspect::Introspect::::ty()), +('Right', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -1183,12 +1183,12 @@ impl EnumTupleMixSerde of core::serde::Serde:: { impl EnumTupleMixCopy of core::traits::Copy::; impl EnumTupleMixDrop of core::traits::Drop::; -impl EnumTupleMixIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumTupleMixIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), -dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), +dojo::meta::introspect::Introspect::::size(), Option::Some(2) ]; @@ -1199,26 +1199,26 @@ Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -1227,24 +1227,24 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumTupleMix', attrs: array![].span(), children: array![ - ('Left', dojo::model::introspect::Ty::Tuple( + ('Left', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )), -('Right', dojo::model::introspect::Ty::Tuple( +('Right', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )) @@ -1276,29 +1276,29 @@ impl EnumWithDifferentVariantDataSerde of core::serde::Serde::; impl EnumWithDifferentVariantDataDrop of core::traits::Drop::; -impl EnumWithDifferentVariantDataIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithDifferentVariantDataIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::Layout::Fixed(array![].span()) + layout: dojo::meta::Layout::Fixed(array![].span()) }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 2, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -1307,18 +1307,18 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithDifferentVariantData', attrs: array![].span(), children: array![ - ('One', dojo::model::introspect::Ty::Tuple(array![].span())), -('Two', dojo::model::introspect::Introspect::::ty()), -('Three', dojo::model::introspect::Ty::Tuple( + ('One', dojo::meta::introspect::Ty::Tuple(array![].span())), +('Two', dojo::meta::introspect::Introspect::::ty()), +('Three', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )) @@ -1330,48 +1330,48 @@ dojo::model::introspect::Introspect::::ty() impl StructWithPrimitivesCopy of core::traits::Copy::; impl StructWithPrimitivesDrop of core::traits::Drop::; -impl StructWithPrimitivesIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithPrimitivesIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithPrimitives', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -1382,11 +1382,11 @@ dojo::model::introspect::Member { impl StructWithStructCopy of core::traits::Copy::; impl StructWithStructDrop of core::traits::Drop::; -impl StructWithStructIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithStructIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(1) ]; @@ -1397,42 +1397,42 @@ Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithStruct', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -1443,50 +1443,50 @@ dojo::model::introspect::Member { impl StructWithSimpleArrayCopy of core::traits::Copy::; impl StructWithSimpleArrayDrop of core::traits::Drop::; -impl StructWithSimpleArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithSimpleArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::introspect::Introspect::>::layout() + layout: dojo::meta::introspect::Introspect::>::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithSimpleArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -1499,48 +1499,48 @@ dojo::model::introspect::Member { impl StructWithByteArrayCopy of core::traits::Copy::; impl StructWithByteArrayDrop of core::traits::Drop::; -impl StructWithByteArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithByteArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithByteArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::ByteArray + ty: dojo::meta::introspect::Ty::ByteArray } ].span() @@ -1551,50 +1551,50 @@ dojo::model::introspect::Member { impl StructWithComplexArrayCopy of core::traits::Copy::; impl StructWithComplexArrayDrop of core::traits::Drop::; -impl StructWithComplexArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithComplexArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::introspect::Introspect::>::layout() + layout: dojo::meta::introspect::Introspect::>::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithComplexArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -1607,25 +1607,25 @@ dojo::model::introspect::Member { impl StructWithSimpleTupleCopy of core::traits::Copy::; impl StructWithSimpleTupleDrop of core::traits::Drop::; -impl StructWithSimpleTupleIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithSimpleTupleIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(4) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -1634,29 +1634,29 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithSimpleTuple', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -1669,12 +1669,12 @@ dojo::model::introspect::Introspect::::ty() impl StructWithComplexTupleCopy of core::traits::Copy::; impl StructWithComplexTupleDrop of core::traits::Drop::; -impl StructWithComplexTupleIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithComplexTupleIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), -dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), +dojo::meta::introspect::Introspect::::size(), Option::Some(2) ]; @@ -1685,20 +1685,20 @@ Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -1707,30 +1707,30 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithComplexTuple', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -1743,26 +1743,26 @@ dojo::model::introspect::Introspect::::ty() impl StructWithNestedArraysCopy of core::traits::Copy::; impl StructWithNestedArraysDrop of core::traits::Drop::; -impl StructWithNestedArraysIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithNestedArraysIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::Layout::Array( + layout: dojo::meta::Layout::Array( array![ - dojo::model::Layout::Array( + dojo::meta::Layout::Array( array![ - dojo::model::introspect::Introspect::>::layout() + dojo::meta::introspect::Introspect::>::layout() ].span() ) ].span() @@ -1773,32 +1773,32 @@ dojo::model::FieldLayout { } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithNestedArrays', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Ty::Array( + dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Ty::Array( + dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) ].span() @@ -1815,12 +1815,12 @@ dojo::model::introspect::Member { impl StructWithNestedTuplesCopy of core::traits::Copy::; impl StructWithNestedTuplesDrop of core::traits::Drop::; -impl StructWithNestedTuplesIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithNestedTuplesIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), -dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), +dojo::meta::introspect::Introspect::::size(), Option::Some(3) ]; @@ -1831,27 +1831,27 @@ Option::Some(3) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::Layout::Tuple( + dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ), -dojo::model::Layout::Tuple( +dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) ].span() @@ -1862,37 +1862,37 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithNestedTuples', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Ty::Tuple( + dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ), -dojo::model::introspect::Ty::Tuple( +dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) ].span() @@ -1907,33 +1907,33 @@ dojo::model::introspect::Introspect::::ty() impl StructWithNestedTuplesAndByteArrayCopy of core::traits::Copy::; impl StructWithNestedTuplesAndByteArrayDrop of core::traits::Drop::; -impl StructWithNestedTuplesAndByteArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithNestedTuplesAndByteArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::Layout::Tuple( + dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ), -dojo::model::Layout::Tuple( +dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) ].span() @@ -1944,37 +1944,37 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithNestedTuplesAndByteArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Ty::Tuple( + dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ), -dojo::model::introspect::Ty::Tuple( +dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Ty::ByteArray + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Ty::ByteArray ].span() ) ].span() @@ -1989,53 +1989,53 @@ dojo::model::introspect::Ty::ByteArray impl StructWithNestedEverythingCopy of core::traits::Copy::; impl StructWithNestedEverythingDrop of core::traits::Drop::; -impl StructWithNestedEverythingIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithNestedEverythingIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387461982739864353524563589639770327077359184971688375275386807599796929637, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 564613130574576288414461160574656432422962213642984413874723251824844509768, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::Layout::Tuple( + dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ), -dojo::model::Layout::Tuple( +dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ), -dojo::model::Layout::Tuple( +dojo::meta::Layout::Tuple( array![ - dojo::model::Layout::Array( + dojo::meta::Layout::Array( array![ - dojo::model::Layout::Tuple( + dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) ].span() ), -dojo::model::introspect::Introspect::::layout() +dojo::meta::introspect::Introspect::::layout() ].span() ), -dojo::model::Layout::Tuple( +dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout() ].span() ) ].span() @@ -2046,57 +2046,57 @@ dojo::model::Layout::Tuple( } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithNestedEverything', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'before', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'after', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Ty::Tuple( + dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ), -dojo::model::introspect::Ty::Tuple( +dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ), -dojo::model::introspect::Ty::Tuple( +dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Ty::Array( + dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Ty::Tuple( + dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) ].span() ), -dojo::model::introspect::Introspect::::ty() +dojo::meta::introspect::Introspect::::ty() ].span() ), -dojo::model::introspect::Ty::Tuple( +dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) ].span() @@ -2121,34 +2121,34 @@ impl GenericStructSerde, +core::traits::Destruct> o } } -impl GenericStructIntrospect> of dojo::model::introspect::Introspect> { +impl GenericStructIntrospect> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 1246920879054256875300693562709339669009726288543267794550465531256469553289, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'GenericStruct', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 't', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -2169,18 +2169,18 @@ impl StructWithBadOptionSerde of core::serde::Serde:: { } } -impl StructWithBadOptionIntrospect<> of dojo::model::introspect::Introspect> { +impl StructWithBadOptionIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::>::size() + dojo::meta::introspect::Introspect::>::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect:: + layout: dojo::meta::introspect::Introspect:: >::layout() } ].span() @@ -2188,16 +2188,16 @@ impl StructWithBadOptionIntrospect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructWithBadOption', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::>::ty() + ty: dojo::meta::introspect::Introspect::>::ty() } ].span() @@ -2224,11 +2224,11 @@ impl EnumWithBadOptionSerde of core::serde::Serde:: { } } -impl EnumWithBadOptionIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumWithBadOptionIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::>::size(), + dojo::meta::introspect::Introspect::>::size(), Option::Some(1) ]; @@ -2239,25 +2239,25 @@ Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 0, - layout: dojo::model::introspect::Introspect::>::layout() + layout: dojo::meta::introspect::Introspect::>::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumWithBadOption', attrs: array![].span(), children: array![ - ('first', dojo::model::introspect::Introspect::>::ty()) + ('first', dojo::meta::introspect::Introspect::>::ty()) ].span() } @@ -2265,14 +2265,14 @@ Option::Some(1) } } -impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumIncompatibleAttrsIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ ].span() @@ -2280,9 +2280,9 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumIncompatibleAttrs', attrs: array![].span(), children: array![ @@ -2294,14 +2294,14 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl EnumIncompatibleAttrsIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8 ].span() @@ -2309,9 +2309,9 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumIncompatibleAttrs', attrs: array![].span(), children: array![ @@ -2323,14 +2323,14 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl StructIncompatibleAttrsIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ ].span() @@ -2338,9 +2338,9 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect< } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructIncompatibleAttrs', attrs: array![].span(), children: array![ @@ -2352,14 +2352,14 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect< } } -impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect> { +impl StructIncompatibleAttrsIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ ].span() @@ -2367,9 +2367,9 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect< } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructIncompatibleAttrs', attrs: array![].span(), children: array![ @@ -2381,14 +2381,14 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::model::introspect::Introspect< } } -impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { +impl StructIncompatibleAttrs2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ ].span() @@ -2396,9 +2396,9 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructIncompatibleAttrs2', attrs: array![].span(), children: array![ @@ -2410,14 +2410,14 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect } } -impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { +impl StructIncompatibleAttrs2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ ].span() @@ -2425,9 +2425,9 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructIncompatibleAttrs2', attrs: array![].span(), children: array![ @@ -2439,14 +2439,14 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect } } -impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect> { +impl EnumIncompatibleAttrs2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Enum( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Enum( array![ ].span() @@ -2454,9 +2454,9 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumIncompatibleAttrs2', attrs: array![].span(), children: array![ @@ -2468,14 +2468,14 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl EnumIncompatibleAttrs2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8 ].span() @@ -2483,9 +2483,9 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumIncompatibleAttrs2', attrs: array![].span(), children: array![ @@ -2497,14 +2497,14 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl StructPacked1Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8 ].span() @@ -2512,16 +2512,16 @@ impl StructPacked1Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructPacked1', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -2530,14 +2530,14 @@ impl StructPacked1Introspect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl StructPacked2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(3) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8,128,128 ].span() @@ -2545,21 +2545,21 @@ impl StructPacked2Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructPacked2', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -2568,14 +2568,14 @@ dojo::model::introspect::Member { } } -impl StructPacked3Introspect<> of dojo::model::introspect::Introspect> { +impl StructPacked3Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(4) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 128,128,8,32 ].span() @@ -2583,24 +2583,24 @@ impl StructPacked3Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructPacked3', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -2611,14 +2611,14 @@ dojo::model::introspect::Introspect::::ty() } } -impl StructNotPackable1Introspect<> of dojo::model::introspect::Introspect> { +impl StructNotPackable1Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8,ERROR ].span() @@ -2626,23 +2626,23 @@ impl StructNotPackable1Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructNotPackable1', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -2653,11 +2653,11 @@ dojo::model::introspect::Member { } } -impl StructPackableWithInnerPackedIntrospect<> of dojo::model::introspect::Introspect> { +impl StructPackableWithInnerPackedIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(1) ]; @@ -2666,10 +2666,10 @@ Option::Some(1) } - fn layout() -> dojo::model::Layout { + fn layout() -> dojo::meta::Layout { let mut layouts = array![ - dojo::model::Layout::Fixed(array![8].span()), -dojo::model::introspect::Introspect::::layout() + dojo::meta::Layout::Fixed(array![8].span()), +dojo::meta::introspect::Introspect::::layout() ]; let mut merged_layout = ArrayTrait::::new(); @@ -2677,7 +2677,7 @@ dojo::model::introspect::Introspect::::layout() match ArrayTrait::pop_front(ref layouts) { Option::Some(mut layout) => { match layout { - dojo::model::Layout::Fixed(mut l) => { + dojo::meta::Layout::Fixed(mut l) => { loop { match SpanTrait::pop_front(ref l) { Option::Some(x) => merged_layout.append(*x), @@ -2692,26 +2692,26 @@ dojo::model::introspect::Introspect::::layout() }; }; - dojo::model::Layout::Fixed(merged_layout.span()) + dojo::meta::Layout::Fixed(merged_layout.span()) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'StructPackableWithInnerPacked', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -2720,14 +2720,14 @@ dojo::model::introspect::Member { } } -impl EnumPacked1Introspect<> of dojo::model::introspect::Introspect> { +impl EnumPacked1Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8 ].span() @@ -2735,15 +2735,15 @@ impl EnumPacked1Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumPacked1', attrs: array![].span(), children: array![ - ('a', dojo::model::introspect::Ty::Tuple(array![].span())), -('b', dojo::model::introspect::Ty::Tuple(array![].span())), -('c', dojo::model::introspect::Ty::Tuple(array![].span())) + ('a', dojo::meta::introspect::Ty::Tuple(array![].span())), +('b', dojo::meta::introspect::Ty::Tuple(array![].span())), +('c', dojo::meta::introspect::Ty::Tuple(array![].span())) ].span() } @@ -2751,14 +2751,14 @@ impl EnumPacked1Introspect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl EnumPacked2Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(2) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8,8 ].span() @@ -2766,15 +2766,15 @@ impl EnumPacked2Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumPacked2', attrs: array![].span(), children: array![ - ('a', dojo::model::introspect::Introspect::::ty()), -('b', dojo::model::introspect::Introspect::::ty()), -('c', dojo::model::introspect::Introspect::::ty()) + ('a', dojo::meta::introspect::Introspect::::ty()), +('b', dojo::meta::introspect::Introspect::::ty()), +('c', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -2782,14 +2782,14 @@ impl EnumPacked2Introspect<> of dojo::model::introspect::Introspect of dojo::model::introspect::Introspect> { +impl EnumPacked3Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(3) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Fixed( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Fixed( array![ 8,128,128 ].span() @@ -2797,19 +2797,19 @@ impl EnumPacked3Introspect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumPacked3', attrs: array![].span(), children: array![ - ('a', dojo::model::introspect::Ty::Tuple( + ('a', dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() )), -('b', dojo::model::introspect::Introspect::::ty()) +('b', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -2817,11 +2817,11 @@ dojo::model::introspect::Introspect::::ty() } } -impl EnumPackableWithInnerPackedIntrospect<> of dojo::model::introspect::Introspect> { +impl EnumPackableWithInnerPackedIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(1) ]; @@ -2830,10 +2830,10 @@ Option::Some(1) } - fn layout() -> dojo::model::Layout { + fn layout() -> dojo::meta::Layout { let mut layouts = array![ - dojo::model::Layout::Fixed(array![8].span()), -dojo::model::introspect::Introspect::::layout() + dojo::meta::Layout::Fixed(array![8].span()), +dojo::meta::introspect::Introspect::::layout() ]; let mut merged_layout = ArrayTrait::::new(); @@ -2841,7 +2841,7 @@ dojo::model::introspect::Introspect::::layout() match ArrayTrait::pop_front(ref layouts) { Option::Some(mut layout) => { match layout { - dojo::model::Layout::Fixed(mut l) => { + dojo::meta::Layout::Fixed(mut l) => { loop { match SpanTrait::pop_front(ref l) { Option::Some(x) => merged_layout.append(*x), @@ -2856,19 +2856,19 @@ dojo::model::introspect::Introspect::::layout() }; }; - dojo::model::Layout::Fixed(merged_layout.span()) + dojo::meta::Layout::Fixed(merged_layout.span()) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumPackableWithInnerPacked', attrs: array![].span(), children: array![ - ('a', dojo::model::introspect::Introspect::::ty()), -('b', dojo::model::introspect::Introspect::::ty()) + ('a', dojo::meta::introspect::Introspect::::ty()), +('b', dojo::meta::introspect::Introspect::::ty()) ].span() } @@ -2876,25 +2876,25 @@ dojo::model::introspect::Introspect::::layout() } } -impl EnumNotPackable1Introspect<> of dojo::model::introspect::Introspect> { +impl EnumNotPackable1Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { + fn layout() -> dojo::meta::Layout { ERROR } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Enum( - dojo::model::introspect::Enum { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Enum( + dojo::meta::introspect::Enum { name: 'EnumNotPackable1', attrs: array![].span(), children: array![ - ('a', dojo::model::introspect::Introspect::::ty()), -('b', dojo::model::introspect::Introspect::::ty()) + ('a', dojo::meta::introspect::Introspect::::ty()), +('b', dojo::meta::introspect::Introspect::::ty()) ].span() } diff --git a/crates/dojo-lang/src/plugin_test_data/model b/crates/dojo-lang/src/plugin_test_data/model index 33864bf626..e35d89e4bb 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -315,39 +315,39 @@ struct ModelWithTupleNoPrimitives { x: u16, y: (u8, Vec3, u32) } -impl BadModelMultipleAttrIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelMultipleAttrIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelMultipleAttr', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -356,39 +356,39 @@ dojo::model::introspect::Member { } } -impl BadModelMultipleVersionsIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelMultipleVersionsIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelMultipleVersions', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -453,31 +453,30 @@ pub impl BadModelMultipleVersionsEntityStoreImpl of BadModelMultipleVersionsEnti pub impl BadModelMultipleVersionsStoreImpl of BadModelMultipleVersionsStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> BadModelMultipleVersions { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `BadModelMultipleVersions`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + BadModelMultipleVersions { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelMultipleVersions { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -494,7 +493,7 @@ pub impl BadModelMultipleVersionsStoreImpl of BadModelMultipleVersionsStore { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -539,18 +538,17 @@ pub impl BadModelMultipleVersionsModelEntityImpl of dojo::model::ModelEntity) -> BadModelMultipleVersionsEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `BadModelMultipleVersionsEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + BadModelMultipleVersionsEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelMultipleVersionsEntity { @@ -560,7 +558,12 @@ pub impl BadModelMultipleVersionsModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `BadModelMultipleVersionsEntity`: deserialization failed.") + } + } } fn update_entity(self: @BadModelMultipleVersionsEntity, world: dojo::world::IWorldDispatcher) { @@ -631,7 +634,12 @@ pub impl BadModelMultipleVersionsModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `BadModelMultipleVersions`: deserialization failed.") + } + } } fn set_model( @@ -746,7 +754,7 @@ pub impl BadModelMultipleVersionsModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -760,18 +768,18 @@ pub impl BadModelMultipleVersionsModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelMultipleVersions) -> dojo::model::Layout { + fn instance_layout(self: @BadModelMultipleVersions) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -816,19 +824,19 @@ pub mod bad_model_multiple_versions { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -1082,7 +1090,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -1101,7 +1109,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -1184,39 +1192,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl BadModelBadVersionTypeIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelBadVersionTypeIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelBadVersionType', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -1281,31 +1289,30 @@ pub impl BadModelBadVersionTypeEntityStoreImpl of BadModelBadVersionTypeEntitySt pub impl BadModelBadVersionTypeStoreImpl of BadModelBadVersionTypeStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> BadModelBadVersionType { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `BadModelBadVersionType`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + BadModelBadVersionType { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelBadVersionType { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -1322,7 +1329,7 @@ pub impl BadModelBadVersionTypeStoreImpl of BadModelBadVersionTypeStore { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -1367,18 +1374,17 @@ pub impl BadModelBadVersionTypeModelEntityImpl of dojo::model::ModelEntity) -> BadModelBadVersionTypeEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `BadModelBadVersionTypeEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + BadModelBadVersionTypeEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelBadVersionTypeEntity { @@ -1388,7 +1394,12 @@ pub impl BadModelBadVersionTypeModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `BadModelBadVersionTypeEntity`: deserialization failed.") + } + } } fn update_entity(self: @BadModelBadVersionTypeEntity, world: dojo::world::IWorldDispatcher) { @@ -1459,7 +1470,12 @@ pub impl BadModelBadVersionTypeModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `BadModelBadVersionType`: deserialization failed.") + } + } } fn set_model( @@ -1574,7 +1590,7 @@ pub impl BadModelBadVersionTypeModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -1588,18 +1604,18 @@ pub impl BadModelBadVersionTypeModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelBadVersionType) -> dojo::model::Layout { + fn instance_layout(self: @BadModelBadVersionType) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -1644,19 +1660,19 @@ pub mod bad_model_bad_version_type { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -1910,7 +1926,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -1929,7 +1945,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -2012,39 +2028,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl BadModelNoVersionValueIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelNoVersionValueIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelNoVersionValue', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -2109,31 +2125,30 @@ pub impl BadModelNoVersionValueEntityStoreImpl of BadModelNoVersionValueEntitySt pub impl BadModelNoVersionValueStoreImpl of BadModelNoVersionValueStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> BadModelNoVersionValue { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `BadModelNoVersionValue`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + BadModelNoVersionValue { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNoVersionValue { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -2150,7 +2165,7 @@ pub impl BadModelNoVersionValueStoreImpl of BadModelNoVersionValueStore { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -2195,18 +2210,17 @@ pub impl BadModelNoVersionValueModelEntityImpl of dojo::model::ModelEntity) -> BadModelNoVersionValueEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `BadModelNoVersionValueEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + BadModelNoVersionValueEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNoVersionValueEntity { @@ -2216,7 +2230,12 @@ pub impl BadModelNoVersionValueModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `BadModelNoVersionValueEntity`: deserialization failed.") + } + } } fn update_entity(self: @BadModelNoVersionValueEntity, world: dojo::world::IWorldDispatcher) { @@ -2287,7 +2306,12 @@ pub impl BadModelNoVersionValueModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `BadModelNoVersionValue`: deserialization failed.") + } + } } fn set_model( @@ -2402,7 +2426,7 @@ pub impl BadModelNoVersionValueModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -2416,18 +2440,18 @@ pub impl BadModelNoVersionValueModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelNoVersionValue) -> dojo::model::Layout { + fn instance_layout(self: @BadModelNoVersionValue) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -2472,19 +2496,19 @@ pub mod bad_model_no_version_value { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -2738,7 +2762,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -2757,7 +2781,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -2840,39 +2864,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl BadModelUnexpectedArgWithValueIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelUnexpectedArgWithValueIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelUnexpectedArgWithValue', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -2937,31 +2961,30 @@ pub impl BadModelUnexpectedArgWithValueEntityStoreImpl of BadModelUnexpectedArgW pub impl BadModelUnexpectedArgWithValueStoreImpl of BadModelUnexpectedArgWithValueStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArgWithValue { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `BadModelUnexpectedArgWithValue`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + BadModelUnexpectedArgWithValue { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArgWithValue { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -2978,7 +3001,7 @@ pub impl BadModelUnexpectedArgWithValueStoreImpl of BadModelUnexpectedArgWithVal fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -3023,18 +3046,17 @@ pub impl BadModelUnexpectedArgWithValueModelEntityImpl of dojo::model::ModelEnti core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> BadModelUnexpectedArgWithValueEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `BadModelUnexpectedArgWithValueEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + BadModelUnexpectedArgWithValueEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgWithValueEntity { @@ -3044,7 +3066,12 @@ pub impl BadModelUnexpectedArgWithValueModelEntityImpl of dojo::model::ModelEnti dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `BadModelUnexpectedArgWithValueEntity`: deserialization failed.") + } + } } fn update_entity(self: @BadModelUnexpectedArgWithValueEntity, world: dojo::world::IWorldDispatcher) { @@ -3115,7 +3142,12 @@ pub impl BadModelUnexpectedArgWithValueModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `BadModelUnexpectedArgWithValue`: deserialization failed.") + } + } } fn set_model( @@ -3230,7 +3262,7 @@ pub impl BadModelUnexpectedArgWithValueModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -3244,18 +3276,18 @@ pub impl BadModelUnexpectedArgWithValueModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelUnexpectedArgWithValue) -> dojo::model::Layout { + fn instance_layout(self: @BadModelUnexpectedArgWithValue) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -3300,19 +3332,19 @@ pub mod bad_model_unexpected_arg_with_value { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -3566,7 +3598,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -3585,7 +3617,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -3668,39 +3700,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl BadModelUnexpectedArgIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelUnexpectedArgIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelUnexpectedArg', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -3765,31 +3797,30 @@ pub impl BadModelUnexpectedArgEntityStoreImpl of BadModelUnexpectedArgEntityStor pub impl BadModelUnexpectedArgStoreImpl of BadModelUnexpectedArgStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArg { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `BadModelUnexpectedArg`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + BadModelUnexpectedArg { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArg { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -3806,7 +3837,7 @@ pub impl BadModelUnexpectedArgStoreImpl of BadModelUnexpectedArgStore { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -3851,18 +3882,17 @@ pub impl BadModelUnexpectedArgModelEntityImpl of dojo::model::ModelEntity) -> BadModelUnexpectedArgEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `BadModelUnexpectedArgEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + BadModelUnexpectedArgEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelUnexpectedArgEntity { @@ -3872,7 +3902,12 @@ pub impl BadModelUnexpectedArgModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `BadModelUnexpectedArgEntity`: deserialization failed.") + } + } } fn update_entity(self: @BadModelUnexpectedArgEntity, world: dojo::world::IWorldDispatcher) { @@ -3943,7 +3978,12 @@ pub impl BadModelUnexpectedArgModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `BadModelUnexpectedArg`: deserialization failed.") + } + } } fn set_model( @@ -4058,7 +4098,7 @@ pub impl BadModelUnexpectedArgModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -4072,18 +4112,18 @@ pub impl BadModelUnexpectedArgModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelUnexpectedArg) -> dojo::model::Layout { + fn instance_layout(self: @BadModelUnexpectedArg) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -4128,19 +4168,19 @@ pub mod bad_model_unexpected_arg { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -4394,7 +4434,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -4413,7 +4453,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -4496,39 +4536,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl BadModelNotSupportedVersionIntrospect<> of dojo::model::introspect::Introspect> { +impl BadModelNotSupportedVersionIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'BadModelNotSupportedVersion', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -4593,31 +4633,30 @@ pub impl BadModelNotSupportedVersionEntityStoreImpl of BadModelNotSupportedVersi pub impl BadModelNotSupportedVersionStoreImpl of BadModelNotSupportedVersionStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> BadModelNotSupportedVersion { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `BadModelNotSupportedVersion`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + BadModelNotSupportedVersion { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNotSupportedVersion { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -4634,7 +4673,7 @@ pub impl BadModelNotSupportedVersionStoreImpl of BadModelNotSupportedVersionStor fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -4679,18 +4718,17 @@ pub impl BadModelNotSupportedVersionModelEntityImpl of dojo::model::ModelEntity< core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> BadModelNotSupportedVersionEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `BadModelNotSupportedVersionEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + BadModelNotSupportedVersionEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> BadModelNotSupportedVersionEntity { @@ -4700,7 +4738,12 @@ pub impl BadModelNotSupportedVersionModelEntityImpl of dojo::model::ModelEntity< dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `BadModelNotSupportedVersionEntity`: deserialization failed.") + } + } } fn update_entity(self: @BadModelNotSupportedVersionEntity, world: dojo::world::IWorldDispatcher) { @@ -4771,7 +4814,12 @@ pub impl BadModelNotSupportedVersionModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `BadModelNotSupportedVersion`: deserialization failed.") + } + } } fn set_model( @@ -4886,7 +4934,7 @@ pub impl BadModelNotSupportedVersionModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -4900,18 +4948,18 @@ pub impl BadModelNotSupportedVersionModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelNotSupportedVersion) -> dojo::model::Layout { + fn instance_layout(self: @BadModelNotSupportedVersion) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -4956,19 +5004,19 @@ pub mod bad_model_not_supported_version { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -5222,7 +5270,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -5241,7 +5289,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -5324,39 +5372,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl Modelv0Introspect<> of dojo::model::introspect::Introspect> { +impl Modelv0Introspect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'Modelv0', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -5421,31 +5469,30 @@ pub impl Modelv0EntityStoreImpl of Modelv0EntityStore { pub impl Modelv0StoreImpl of Modelv0Store { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> Modelv0 { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `Modelv0`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + Modelv0 { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Modelv0 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -5462,7 +5509,7 @@ pub impl Modelv0StoreImpl of Modelv0Store { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -5507,18 +5554,17 @@ pub impl Modelv0ModelEntityImpl of dojo::model::ModelEntity { core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> Modelv0Entity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `Modelv0Entity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + Modelv0Entity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> Modelv0Entity { @@ -5528,7 +5574,12 @@ pub impl Modelv0ModelEntityImpl of dojo::model::ModelEntity { dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `Modelv0Entity`: deserialization failed.") + } + } } fn update_entity(self: @Modelv0Entity, world: dojo::world::IWorldDispatcher) { @@ -5599,7 +5650,12 @@ pub impl Modelv0ModelImpl of dojo::model::Model { ); let mut _keys = keys; - Modelv0Store::from_values(ref _keys, ref values) + match Modelv0Store::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `Modelv0`: deserialization failed.") + } + } } fn set_model( @@ -5714,7 +5770,7 @@ pub impl Modelv0ModelImpl of dojo::model::Model { #[inline(always)] fn keys(self: @Modelv0) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -5728,18 +5784,18 @@ pub impl Modelv0ModelImpl of dojo::model::Model { } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @Modelv0) -> dojo::model::Layout { + fn instance_layout(self: @Modelv0) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -5784,19 +5840,19 @@ pub mod modelv_0 { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -6050,7 +6106,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -6069,7 +6125,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -6152,39 +6208,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithBadNamespaceFormatIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithBadNamespaceFormatIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithBadNamespaceFormat', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -6249,31 +6305,30 @@ pub impl ModelWithBadNamespaceFormatEntityStoreImpl of ModelWithBadNamespaceForm pub impl ModelWithBadNamespaceFormatStoreImpl of ModelWithBadNamespaceFormatStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithBadNamespaceFormat { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithBadNamespaceFormat`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithBadNamespaceFormat { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithBadNamespaceFormat { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -6290,7 +6345,7 @@ pub impl ModelWithBadNamespaceFormatStoreImpl of ModelWithBadNamespaceFormatStor fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -6335,18 +6390,17 @@ pub impl ModelWithBadNamespaceFormatModelEntityImpl of dojo::model::ModelEntity< core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithBadNamespaceFormatEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithBadNamespaceFormatEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithBadNamespaceFormatEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithBadNamespaceFormatEntity { @@ -6356,7 +6410,12 @@ pub impl ModelWithBadNamespaceFormatModelEntityImpl of dojo::model::ModelEntity< dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithBadNamespaceFormatEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithBadNamespaceFormatEntity, world: dojo::world::IWorldDispatcher) { @@ -6427,7 +6486,12 @@ pub impl ModelWithBadNamespaceFormatModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `ModelWithBadNamespaceFormat`: deserialization failed.") + } + } } fn set_model( @@ -6542,7 +6606,7 @@ pub impl ModelWithBadNamespaceFormatModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -6556,18 +6620,18 @@ pub impl ModelWithBadNamespaceFormatModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithBadNamespaceFormat) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithBadNamespaceFormat) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -6612,19 +6676,19 @@ pub mod model_with_bad_namespace_format { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -6878,7 +6942,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -6897,7 +6961,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -6980,39 +7044,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithShortStringNamespaceIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithShortStringNamespaceIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithShortStringNamespace', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -7077,31 +7141,30 @@ pub impl ModelWithShortStringNamespaceEntityStoreImpl of ModelWithShortStringNam pub impl ModelWithShortStringNamespaceStoreImpl of ModelWithShortStringNamespaceStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithShortStringNamespace { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithShortStringNamespace`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithShortStringNamespace { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithShortStringNamespace { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -7118,7 +7181,7 @@ pub impl ModelWithShortStringNamespaceStoreImpl of ModelWithShortStringNamespace fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -7163,18 +7226,17 @@ pub impl ModelWithShortStringNamespaceModelEntityImpl of dojo::model::ModelEntit core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithShortStringNamespaceEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithShortStringNamespaceEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithShortStringNamespaceEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithShortStringNamespaceEntity { @@ -7184,7 +7246,12 @@ pub impl ModelWithShortStringNamespaceModelEntityImpl of dojo::model::ModelEntit dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithShortStringNamespaceEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithShortStringNamespaceEntity, world: dojo::world::IWorldDispatcher) { @@ -7255,7 +7322,12 @@ pub impl ModelWithShortStringNamespaceModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `ModelWithShortStringNamespace`: deserialization failed.") + } + } } fn set_model( @@ -7370,7 +7442,7 @@ pub impl ModelWithShortStringNamespaceModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -7384,18 +7456,18 @@ pub impl ModelWithShortStringNamespaceModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithShortStringNamespace) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithShortStringNamespace) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -7440,19 +7512,19 @@ pub mod model_with_short_string_namespace { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -7706,7 +7778,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -7725,7 +7797,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -7808,39 +7880,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithStringNamespaceIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithStringNamespaceIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithStringNamespace', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -7905,31 +7977,30 @@ pub impl ModelWithStringNamespaceEntityStoreImpl of ModelWithStringNamespaceEnti pub impl ModelWithStringNamespaceStoreImpl of ModelWithStringNamespaceStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithStringNamespace { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithStringNamespace`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithStringNamespace { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithStringNamespace { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -7946,7 +8017,7 @@ pub impl ModelWithStringNamespaceStoreImpl of ModelWithStringNamespaceStore { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -7991,18 +8062,17 @@ pub impl ModelWithStringNamespaceModelEntityImpl of dojo::model::ModelEntity) -> ModelWithStringNamespaceEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithStringNamespaceEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithStringNamespaceEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithStringNamespaceEntity { @@ -8012,7 +8082,12 @@ pub impl ModelWithStringNamespaceModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithStringNamespaceEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithStringNamespaceEntity, world: dojo::world::IWorldDispatcher) { @@ -8083,7 +8158,12 @@ pub impl ModelWithStringNamespaceModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `ModelWithStringNamespace`: deserialization failed.") + } + } } fn set_model( @@ -8198,7 +8278,7 @@ pub impl ModelWithStringNamespaceModelImpl of dojo::model::Model Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -8212,18 +8292,18 @@ pub impl ModelWithStringNamespaceModelImpl of dojo::model::Model dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithStringNamespace) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithStringNamespace) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -8268,19 +8348,19 @@ pub mod model_with_string_namespace { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -8534,7 +8614,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -8553,7 +8633,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -8636,39 +8716,39 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl PositionIntrospect<> of dojo::model::introspect::Introspect> { +impl PositionIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'Position', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'v', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -8733,31 +8813,30 @@ pub impl PositionEntityStoreImpl of PositionEntityStore { pub impl PositionStoreImpl of PositionStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> Position { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let v = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `Position`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + Position { + id, + + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Position { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -8774,7 +8853,7 @@ pub impl PositionStoreImpl of PositionStore { fn get_v(world: dojo::world::IWorldDispatcher, id: felt252) -> Vec3 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); let mut values = dojo::model::Model::::get_member( @@ -8819,18 +8898,17 @@ pub impl PositionModelEntityImpl of dojo::model::ModelEntity { core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> PositionEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let v = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `PositionEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + PositionEntity { + __id: entity_id, + v, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PositionEntity { @@ -8840,7 +8918,12 @@ pub impl PositionModelEntityImpl of dojo::model::ModelEntity { dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `PositionEntity`: deserialization failed.") + } + } } fn update_entity(self: @PositionEntity, world: dojo::world::IWorldDispatcher) { @@ -8911,7 +8994,12 @@ pub impl PositionModelImpl of dojo::model::Model { ); let mut _keys = keys; - PositionStore::from_values(ref _keys, ref values) + match PositionStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `Position`: deserialization failed.") + } + } } fn set_model( @@ -9026,7 +9114,7 @@ pub impl PositionModelImpl of dojo::model::Model { #[inline(always)] fn keys(self: @Position) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -9040,18 +9128,18 @@ pub impl PositionModelImpl of dojo::model::Model { } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @Position) -> dojo::model::Layout { + fn instance_layout(self: @Position) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -9096,19 +9184,19 @@ pub mod position { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -9362,7 +9450,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -9381,7 +9469,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -9464,18 +9552,18 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl RolesIntrospect<> of dojo::model::introspect::Introspect> { +impl RolesIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 387776731289756409274549987067854286905927440612427426920343953432870065647, - layout: dojo::model::introspect::Introspect:: + layout: dojo::meta::introspect::Introspect:: >::layout() } ].span() @@ -9483,18 +9571,18 @@ impl RolesIntrospect<> of dojo::model::introspect::Introspect> { } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'Roles', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'role_ids', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -9565,21 +9653,18 @@ pub impl RolesStoreImpl of RolesStore { core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> Roles { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + + let role_ids = core::serde::Serde::>::deserialize(ref values)?; - let entity = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `Roles`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } + Option::Some( + Roles { + + role_ids, - core::option::OptionTrait::::unwrap(entity) + } + ) } fn get(world: dojo::world::IWorldDispatcher, ) -> Roles { @@ -9644,18 +9729,17 @@ pub impl RolesModelEntityImpl of dojo::model::ModelEntity { core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> RolesEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let role_ids = core::serde::Serde::>::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `RolesEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + RolesEntity { + __id: entity_id, + role_ids, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> RolesEntity { @@ -9665,7 +9749,12 @@ pub impl RolesModelEntityImpl of dojo::model::ModelEntity { dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `RolesEntity`: deserialization failed.") + } + } } fn update_entity(self: @RolesEntity, world: dojo::world::IWorldDispatcher) { @@ -9736,7 +9825,12 @@ pub impl RolesModelImpl of dojo::model::Model { ); let mut _keys = keys; - RolesStore::from_values(ref _keys, ref values) + match RolesStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `Roles`: deserialization failed.") + } + } } fn set_model( @@ -9864,18 +9958,18 @@ pub impl RolesModelImpl of dojo::model::Model { } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @Roles) -> dojo::model::Layout { + fn instance_layout(self: @Roles) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -9920,19 +10014,19 @@ pub mod roles { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -10186,7 +10280,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -10205,7 +10299,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -10288,14 +10382,14 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl OnlyKeyModelIntrospect<> of dojo::model::introspect::Introspect> { +impl OnlyKeyModelIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ ].span() @@ -10303,16 +10397,16 @@ impl OnlyKeyModelIntrospect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'OnlyKeyModel', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -10348,31 +10442,28 @@ pub impl OnlyKeyModelEntityStoreImpl of OnlyKeyModelEntityStore { pub impl OnlyKeyModelStoreImpl of OnlyKeyModelStore { fn entity_id_from_keys(id: felt252) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> OnlyKeyModel { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let id = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `OnlyKeyModel`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } + Option::Some( + OnlyKeyModel { + id, - core::option::OptionTrait::::unwrap(entity) + + } + ) } fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> OnlyKeyModel { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, id); + core::serde::Serde::serialize(@id, ref serialized); dojo::model::Model::::get(world, serialized.span()) @@ -10400,18 +10491,15 @@ pub impl OnlyKeyModelModelEntityImpl of dojo::model::ModelEntity) -> OnlyKeyModelEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `OnlyKeyModelEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + Option::Some( + OnlyKeyModelEntity { + __id: entity_id, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> OnlyKeyModelEntity { @@ -10421,7 +10509,12 @@ pub impl OnlyKeyModelModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `OnlyKeyModelEntity`: deserialization failed.") + } + } } fn update_entity(self: @OnlyKeyModelEntity, world: dojo::world::IWorldDispatcher) { @@ -10492,7 +10585,12 @@ pub impl OnlyKeyModelModelImpl of dojo::model::Model { ); let mut _keys = keys; - OnlyKeyModelStore::from_values(ref _keys, ref values) + match OnlyKeyModelStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `OnlyKeyModel`: deserialization failed.") + } + } } fn set_model( @@ -10607,7 +10705,7 @@ pub impl OnlyKeyModelModelImpl of dojo::model::Model { #[inline(always)] fn keys(self: @OnlyKeyModel) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.id); + core::serde::Serde::serialize(self.id, ref serialized); core::array::ArrayTrait::span(@serialized) } @@ -10620,18 +10718,18 @@ pub impl OnlyKeyModelModelImpl of dojo::model::Model { } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @OnlyKeyModel) -> dojo::model::Layout { + fn instance_layout(self: @OnlyKeyModel) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -10676,19 +10774,19 @@ pub mod only_key_model { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -10942,7 +11040,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -10961,7 +11059,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -11044,14 +11142,14 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl U256KeyModelIntrospect<> of dojo::model::introspect::Introspect> { +impl U256KeyModelIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ ].span() @@ -11059,16 +11157,16 @@ impl U256KeyModelIntrospect<> of dojo::model::introspect::Introspect dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'U256KeyModel', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'id', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -11102,34 +11200,27 @@ pub impl U256KeyModelEntityStoreImpl of U256KeyModelEntityStore { #[generate_trait] pub impl U256KeyModelStoreImpl of U256KeyModelStore { - fn entity_id_from_keys(id: u256) -> felt252 { + fn entity_id_from_keys() -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::serde::Serde::serialize(@id, ref serialized); - + core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> U256KeyModel { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); - - let entity = core::serde::Serde::::deserialize(ref serialized); - - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `U256KeyModel`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } + fn from_values(ref keys: Span, ref values: Span) -> Option { + + - core::option::OptionTrait::::unwrap(entity) + Option::Some( + U256KeyModel { + + + } + ) } - fn get(world: dojo::world::IWorldDispatcher, id: u256) -> U256KeyModel { + fn get(world: dojo::world::IWorldDispatcher, ) -> U256KeyModel { let mut serialized = core::array::ArrayTrait::new(); - core::serde::Serde::serialize(@id, ref serialized); - + dojo::model::Model::::get(world, serialized.span()) } @@ -11156,18 +11247,15 @@ pub impl U256KeyModelModelEntityImpl of dojo::model::ModelEntity) -> U256KeyModelEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `U256KeyModelEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + Option::Some( + U256KeyModelEntity { + __id: entity_id, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> U256KeyModelEntity { @@ -11177,7 +11265,12 @@ pub impl U256KeyModelModelEntityImpl of dojo::model::ModelEntity::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `U256KeyModelEntity`: deserialization failed.") + } + } } fn update_entity(self: @U256KeyModelEntity, world: dojo::world::IWorldDispatcher) { @@ -11248,7 +11341,12 @@ pub impl U256KeyModelModelImpl of dojo::model::Model { ); let mut _keys = keys; - U256KeyModelStore::from_values(ref _keys, ref values) + match U256KeyModelStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `U256KeyModel`: deserialization failed.") + } + } } fn set_model( @@ -11363,8 +11461,7 @@ pub impl U256KeyModelModelImpl of dojo::model::Model { #[inline(always)] fn keys(self: @U256KeyModel) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::serde::Serde::serialize(self.id, ref serialized); - + core::array::ArrayTrait::span(@serialized) } @@ -11376,18 +11473,18 @@ pub impl U256KeyModelModelImpl of dojo::model::Model { } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @U256KeyModel) -> dojo::model::Layout { + fn instance_layout(self: @U256KeyModel) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -11432,19 +11529,19 @@ pub mod u_256_key_model { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -11698,7 +11795,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -11717,7 +11814,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -11800,44 +11897,44 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl PlayerIntrospect<> of dojo::model::introspect::Introspect> { +impl PlayerIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(1) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 1528802474226268325865027367859591458315299653151958663884057507666229546336, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() } ].span() ) } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'Player', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'game', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'name', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() } ].span() @@ -11902,32 +11999,33 @@ pub impl PlayerEntityStoreImpl of PlayerEntityStore { pub impl PlayerStoreImpl of PlayerStore { fn entity_id_from_keys(game: felt252, player: ContractAddress) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, game); + core::serde::Serde::serialize(@game, ref serialized); core::serde::Serde::serialize(@player, ref serialized); core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> Player { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let game = core::serde::Serde::::deserialize(ref keys)?; +let player = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let name = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `Player`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + Player { + game, +player, + + name, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> Player { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, game); + core::serde::Serde::serialize(@game, ref serialized); core::serde::Serde::serialize(@player, ref serialized); @@ -11945,7 +12043,7 @@ core::serde::Serde::serialize(@player, ref serialized); fn get_name(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> felt252 { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, game); + core::serde::Serde::serialize(@game, ref serialized); core::serde::Serde::serialize(@player, ref serialized); @@ -11986,23 +12084,22 @@ pub impl PlayerModelEntityImpl of dojo::model::ModelEntity { fn values(self: @PlayerEntity) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.name); + core::serde::Serde::serialize(self.name, ref serialized); core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> PlayerEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let name = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `PlayerEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + PlayerEntity { + __id: entity_id, + name, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> PlayerEntity { @@ -12012,7 +12109,12 @@ pub impl PlayerModelEntityImpl of dojo::model::ModelEntity { dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `PlayerEntity`: deserialization failed.") + } + } } fn update_entity(self: @PlayerEntity, world: dojo::world::IWorldDispatcher) { @@ -12083,7 +12185,12 @@ pub impl PlayerModelImpl of dojo::model::Model { ); let mut _keys = keys; - PlayerStore::from_values(ref _keys, ref values) + match PlayerStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `Player`: deserialization failed.") + } + } } fn set_model( @@ -12198,7 +12305,7 @@ pub impl PlayerModelImpl of dojo::model::Model { #[inline(always)] fn keys(self: @Player) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.game); + core::serde::Serde::serialize(self.game, ref serialized); core::serde::Serde::serialize(self.player, ref serialized); core::array::ArrayTrait::span(@serialized) @@ -12207,24 +12314,24 @@ core::serde::Serde::serialize(self.player, ref serialized); #[inline(always)] fn values(self: @Player) -> Span { let mut serialized = core::array::ArrayTrait::new(); - core::array::ArrayTrait::append(ref serialized, *self.name); + core::serde::Serde::serialize(self.name, ref serialized); core::array::ArrayTrait::span(@serialized) } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @Player) -> dojo::model::Layout { + fn instance_layout(self: @Player) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -12269,19 +12376,19 @@ pub mod player { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -12535,7 +12642,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -12554,7 +12661,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -12637,22 +12744,22 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithSimpleArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithSimpleArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, - layout: dojo::model::introspect::Introspect:: + layout: dojo::meta::introspect::Introspect:: >::layout() } ].span() @@ -12660,28 +12767,28 @@ dojo::model::FieldLayout { } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithSimpleArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -12782,21 +12889,22 @@ pub impl ModelWithSimpleArrayStoreImpl of ModelWithSimpleArrayStore { core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithSimpleArray { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let player = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::>::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithSimpleArray`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithSimpleArray { + player, + + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithSimpleArray { @@ -12897,18 +13005,19 @@ core::serde::Serde::serialize(self.y, ref serialized); core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithSimpleArrayEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::>::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithSimpleArrayEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithSimpleArrayEntity { + __id: entity_id, + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithSimpleArrayEntity { @@ -12918,7 +13027,12 @@ core::serde::Serde::serialize(self.y, ref serialized); dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithSimpleArrayEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithSimpleArrayEntity, world: dojo::world::IWorldDispatcher) { @@ -12989,7 +13103,12 @@ pub impl ModelWithSimpleArrayModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `ModelWithSimpleArray`: deserialization failed.") + } + } } fn set_model( @@ -13119,18 +13238,18 @@ core::serde::Serde::serialize(self.y, ref serialized); } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithSimpleArray) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithSimpleArray) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -13175,19 +13294,19 @@ pub mod model_with_simple_array { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -13441,7 +13560,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -13460,7 +13579,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -13543,22 +13662,22 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithByteArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithByteArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, - layout: dojo::model::introspect::Introspect::::layout() } ].span() @@ -13566,26 +13685,26 @@ dojo::model::FieldLayout { } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithByteArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::ByteArray + ty: dojo::meta::introspect::Ty::ByteArray } ].span() @@ -13684,21 +13803,22 @@ pub impl ModelWithByteArrayStoreImpl of ModelWithByteArrayStore { core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithByteArray { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let player = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithByteArray`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithByteArray { + player, + + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithByteArray { @@ -13799,18 +13919,19 @@ core::serde::Serde::serialize(self.y, ref serialized); core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithByteArrayEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithByteArrayEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithByteArrayEntity { + __id: entity_id, + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithByteArrayEntity { @@ -13820,7 +13941,12 @@ core::serde::Serde::serialize(self.y, ref serialized); dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithByteArrayEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithByteArrayEntity, world: dojo::world::IWorldDispatcher) { @@ -13891,7 +14017,12 @@ pub impl ModelWithByteArrayModelImpl of dojo::model::Model { ); let mut _keys = keys; - ModelWithByteArrayStore::from_values(ref _keys, ref values) + match ModelWithByteArrayStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `ModelWithByteArray`: deserialization failed.") + } + } } fn set_model( @@ -14021,18 +14152,18 @@ core::serde::Serde::serialize(self.y, ref serialized); } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithByteArray) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithByteArray) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -14077,19 +14208,19 @@ pub mod model_with_byte_array { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -14343,7 +14474,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -14362,7 +14493,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -14445,22 +14576,22 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithComplexArrayIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithComplexArrayIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, - layout: dojo::model::introspect::Introspect:: + layout: dojo::meta::introspect::Introspect:: >::layout() } ].span() @@ -14468,28 +14599,28 @@ dojo::model::FieldLayout { } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithComplexArray', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Array( + ty: dojo::meta::introspect::Ty::Array( array![ - dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -14590,21 +14721,22 @@ pub impl ModelWithComplexArrayStoreImpl of ModelWithComplexArrayStore { core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithComplexArray { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let player = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::>::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithComplexArray`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithComplexArray { + player, + + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithComplexArray { @@ -14705,18 +14837,19 @@ core::serde::Serde::serialize(self.y, ref serialized); core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithComplexArrayEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::>::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithComplexArrayEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithComplexArrayEntity { + __id: entity_id, + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithComplexArrayEntity { @@ -14726,7 +14859,12 @@ core::serde::Serde::serialize(self.y, ref serialized); dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithComplexArrayEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithComplexArrayEntity, world: dojo::world::IWorldDispatcher) { @@ -14797,7 +14935,12 @@ pub impl ModelWithComplexArrayModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `ModelWithComplexArray`: deserialization failed.") + } + } } fn set_model( @@ -14927,18 +15070,18 @@ core::serde::Serde::serialize(self.y, ref serialized); } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithComplexArray) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithComplexArray) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -14983,19 +15126,19 @@ pub mod model_with_complex_array { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -15249,7 +15392,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -15268,7 +15411,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -15351,26 +15494,26 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithTupleIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithTupleIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::Some(4) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -15379,30 +15522,30 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithTuple', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -15503,21 +15646,22 @@ pub impl ModelWithTupleStoreImpl of ModelWithTupleStore { core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithTuple { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let player = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::<(u8, u16, u32)>::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithTuple`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithTuple { + player, + + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTuple { @@ -15618,18 +15762,19 @@ core::serde::Serde::serialize(self.y, ref serialized); core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithTupleEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::<(u8, u16, u32)>::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithTupleEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithTupleEntity { + __id: entity_id, + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleEntity { @@ -15639,7 +15784,12 @@ core::serde::Serde::serialize(self.y, ref serialized); dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithTupleEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithTupleEntity, world: dojo::world::IWorldDispatcher) { @@ -15710,7 +15860,12 @@ pub impl ModelWithTupleModelImpl of dojo::model::Model { ); let mut _keys = keys; - ModelWithTupleStore::from_values(ref _keys, ref values) + match ModelWithTupleStore::from_values(ref _keys, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("Model `ModelWithTuple`: deserialization failed.") + } + } } fn set_model( @@ -15840,18 +15995,18 @@ core::serde::Serde::serialize(self.y, ref serialized); } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithTuple) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithTuple) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -15896,19 +16051,19 @@ pub mod model_with_tuple { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -16162,7 +16317,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -16181,7 +16336,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -16264,11 +16419,11 @@ impl StorageStorageBaseMutDrop of core::traits::Drop::; impl StorageStorageBaseMutCopy of core::traits::Copy::; } -impl ModelWithTupleNoPrimitivesIntrospect<> of dojo::model::introspect::Introspect> { +impl ModelWithTupleNoPrimitivesIntrospect<> of dojo::meta::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::model::introspect::Introspect::::size(), + dojo::meta::introspect::Introspect::::size(), Option::Some(3) ]; @@ -16279,20 +16434,20 @@ Option::Some(3) } - fn layout() -> dojo::model::Layout { - dojo::model::Layout::Struct( + fn layout() -> dojo::meta::Layout { + dojo::meta::Layout::Struct( array![ - dojo::model::FieldLayout { + dojo::meta::FieldLayout { selector: 512066735765477566404754172672287371265995314501343422459174036873487219331, - layout: dojo::model::introspect::Introspect::::layout() + layout: dojo::meta::introspect::Introspect::::layout() }, -dojo::model::FieldLayout { +dojo::meta::FieldLayout { selector: 1591024729085637502504777720563487898377940395575083379770417352976841400819, - layout: dojo::model::Layout::Tuple( + layout: dojo::meta::Layout::Tuple( array![ - dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout(), -dojo::model::introspect::Introspect::::layout() + dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout(), +dojo::meta::introspect::Introspect::::layout() ].span() ) } @@ -16301,30 +16456,30 @@ dojo::model::introspect::Introspect::::layout() } #[inline(always)] - fn ty() -> dojo::model::introspect::Ty { - dojo::model::introspect::Ty::Struct( - dojo::model::introspect::Struct { + fn ty() -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Ty::Struct( + dojo::meta::introspect::Struct { name: 'ModelWithTupleNoPrimitives', attrs: array![].span(), children: array![ - dojo::model::introspect::Member { + dojo::meta::introspect::Member { name: 'player', attrs: array!['key'].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'x', attrs: array![].span(), - ty: dojo::model::introspect::Introspect::::ty() + ty: dojo::meta::introspect::Introspect::::ty() }, -dojo::model::introspect::Member { +dojo::meta::introspect::Member { name: 'y', attrs: array![].span(), - ty: dojo::model::introspect::Ty::Tuple( + ty: dojo::meta::introspect::Ty::Tuple( array![ - dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty(), -dojo::model::introspect::Introspect::::ty() + dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty(), +dojo::meta::introspect::Introspect::::ty() ].span() ) } @@ -16425,21 +16580,22 @@ pub impl ModelWithTupleNoPrimitivesStoreImpl of ModelWithTupleNoPrimitivesStore core::poseidon::poseidon_hash_span(serialized.span()) } - fn from_values(ref keys: Span, ref values: Span) -> ModelWithTupleNoPrimitives { - let mut serialized = core::array::ArrayTrait::new(); - serialized.append_span(keys); - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(ref keys: Span, ref values: Span) -> Option { + let player = core::serde::Serde::::deserialize(ref keys)?; - let entity = core::serde::Serde::::deserialize(ref serialized); + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::<(u8, Vec3, u32)>::deserialize(ref values)?; - if core::option::OptionTrait::::is_none(@entity) { - panic!( - "Model `ModelWithTupleNoPrimitives`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." - ); - } - core::option::OptionTrait::::unwrap(entity) + Option::Some( + ModelWithTupleNoPrimitives { + player, + + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTupleNoPrimitives { @@ -16540,18 +16696,19 @@ core::serde::Serde::serialize(self.y, ref serialized); core::array::ArrayTrait::span(@serialized) } - fn from_values(entity_id: felt252, ref values: Span) -> ModelWithTupleNoPrimitivesEntity { - let mut serialized = array![entity_id]; - serialized.append_span(values); - let mut serialized = core::array::ArrayTrait::span(@serialized); + fn from_values(entity_id: felt252, ref values: Span) -> Option { + let x = core::serde::Serde::::deserialize(ref values)?; +let y = core::serde::Serde::<(u8, Vec3, u32)>::deserialize(ref values)?; - let entity_values = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity_values) { - panic!( - "ModelEntity `ModelWithTupleNoPrimitivesEntity`: deserialization failed." - ); - } - core::option::OptionTrait::::unwrap(entity_values) + + Option::Some( + ModelWithTupleNoPrimitivesEntity { + __id: entity_id, + x, +y, + + } + ) } fn get(world: dojo::world::IWorldDispatcher, entity_id: felt252) -> ModelWithTupleNoPrimitivesEntity { @@ -16561,7 +16718,12 @@ core::serde::Serde::serialize(self.y, ref serialized); dojo::model::ModelIndex::Id(entity_id), dojo::model::Model::::layout() ); - Self::from_values(entity_id, ref values) + match Self::from_values(entity_id, ref values) { + Option::Some(x) => x, + Option::None => { + panic!("ModelEntity `ModelWithTupleNoPrimitivesEntity`: deserialization failed.") + } + } } fn update_entity(self: @ModelWithTupleNoPrimitivesEntity, world: dojo::world::IWorldDispatcher) { @@ -16632,7 +16794,12 @@ pub impl ModelWithTupleNoPrimitivesModelImpl of dojo::model::Model x, + Option::None => { + panic!("Model `ModelWithTupleNoPrimitives`: deserialization failed.") + } + } } fn set_model( @@ -16762,18 +16929,18 @@ core::serde::Serde::serialize(self.y, ref serialized); } #[inline(always)] - fn layout() -> dojo::model::Layout { - dojo::model::introspect::Introspect::::layout() + fn layout() -> dojo::meta::Layout { + dojo::meta::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @ModelWithTupleNoPrimitives) -> dojo::model::Layout { + fn instance_layout(self: @ModelWithTupleNoPrimitives) -> dojo::meta::Layout { Self::layout() } #[inline(always)] fn packed_size() -> Option { - dojo::model::layout::compute_packed_size(Self::layout()) + dojo::meta::layout::compute_packed_size(Self::layout()) } } @@ -16818,19 +16985,19 @@ pub mod model_with_tuple_no_primitives { } fn unpacked_size(self: @ContractState) -> Option { - dojo::model::introspect::Introspect::::size() + dojo::meta::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { dojo::model::Model::::packed_size() } - fn layout(self: @ContractState) -> dojo::model::Layout { + fn layout(self: @ContractState) -> dojo::meta::Layout { dojo::model::Model::::layout() } - fn schema(self: @ContractState) -> dojo::model::introspect::Ty { - dojo::model::introspect::Introspect::::ty() + fn schema(self: @ContractState) -> dojo::meta::introspect::Ty { + dojo::meta::introspect::Introspect::::ty() } } @@ -17084,7 +17251,7 @@ fn __wrapper__DojoModelImpl__layout(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -17103,7 +17270,7 @@ fn __wrapper__DojoModelImpl__schema(mut data: Span::) -> Span::::serialize(@res, ref arr); + core::serde::Serde::::serialize(@res, ref arr); core::array::ArrayTrait::span(@arr) } @@ -17214,7 +17381,7 @@ pub trait BadModelMultipleVersionsEntityStore { pub trait BadModelMultipleVersionsStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> BadModelMultipleVersions; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelMultipleVersions; @@ -17350,7 +17517,7 @@ pub trait BadModelBadVersionTypeEntityStore { pub trait BadModelBadVersionTypeStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> BadModelBadVersionType; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelBadVersionType; @@ -17486,7 +17653,7 @@ pub trait BadModelNoVersionValueEntityStore { pub trait BadModelNoVersionValueStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> BadModelNoVersionValue; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNoVersionValue; @@ -17622,7 +17789,7 @@ pub trait BadModelUnexpectedArgWithValueEntityStore { pub trait BadModelUnexpectedArgWithValueStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArgWithValue; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArgWithValue; @@ -17758,7 +17925,7 @@ pub trait BadModelUnexpectedArgEntityStore { pub trait BadModelUnexpectedArgStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> BadModelUnexpectedArg; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelUnexpectedArg; @@ -17894,7 +18061,7 @@ pub trait BadModelNotSupportedVersionEntityStore { pub trait BadModelNotSupportedVersionStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> BadModelNotSupportedVersion; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> BadModelNotSupportedVersion; @@ -18030,7 +18197,7 @@ pub trait Modelv0EntityStore { pub trait Modelv0Store { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> Modelv0; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Modelv0; @@ -18166,7 +18333,7 @@ pub trait ModelWithBadNamespaceFormatEntityStore { pub trait ModelWithBadNamespaceFormatStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithBadNamespaceFormat; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithBadNamespaceFormat; @@ -18302,7 +18469,7 @@ pub trait ModelWithShortStringNamespaceEntityStore { pub trait ModelWithShortStringNamespaceStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithShortStringNamespace; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithShortStringNamespace; @@ -18438,7 +18605,7 @@ pub trait ModelWithStringNamespaceEntityStore { pub trait ModelWithStringNamespaceStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithStringNamespace; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> ModelWithStringNamespace; @@ -18574,7 +18741,7 @@ pub trait PositionEntityStore { pub trait PositionStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> Position; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> Position; @@ -18710,7 +18877,7 @@ pub trait RolesEntityStore { pub trait RolesStore { fn entity_id_from_keys() -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> Roles; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, ) -> Roles; @@ -18840,7 +19007,7 @@ pub trait OnlyKeyModelEntityStore { pub trait OnlyKeyModelStore { fn entity_id_from_keys(id: felt252) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> OnlyKeyModel; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, id: felt252) -> OnlyKeyModel; @@ -18964,11 +19131,11 @@ pub trait U256KeyModelEntityStore { } pub trait U256KeyModelStore { - fn entity_id_from_keys(id: u256) -> felt252; + fn entity_id_from_keys() -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> U256KeyModel; + fn from_values(ref keys: Span, ref values: Span) -> Option; - fn get(world: dojo::world::IWorldDispatcher, id: u256) -> U256KeyModel; + fn get(world: dojo::world::IWorldDispatcher, ) -> U256KeyModel; fn set(self: @U256KeyModel, world: dojo::world::IWorldDispatcher); @@ -19098,7 +19265,7 @@ pub trait PlayerEntityStore { pub trait PlayerStore { fn entity_id_from_keys(game: felt252, player: ContractAddress) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> Player; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, game: felt252, player: ContractAddress) -> Player; @@ -19240,7 +19407,7 @@ pub trait ModelWithSimpleArrayEntityStore { pub trait ModelWithSimpleArrayStore { fn entity_id_from_keys(player: ContractAddress) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithSimpleArray; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithSimpleArray; @@ -19386,7 +19553,7 @@ pub trait ModelWithByteArrayEntityStore { pub trait ModelWithByteArrayStore { fn entity_id_from_keys(player: ContractAddress) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithByteArray; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithByteArray; @@ -19532,7 +19699,7 @@ pub trait ModelWithComplexArrayEntityStore { pub trait ModelWithComplexArrayStore { fn entity_id_from_keys(player: ContractAddress) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithComplexArray; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithComplexArray; @@ -19678,7 +19845,7 @@ pub trait ModelWithTupleEntityStore { pub trait ModelWithTupleStore { fn entity_id_from_keys(player: ContractAddress) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithTuple; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTuple; @@ -19824,7 +19991,7 @@ pub trait ModelWithTupleNoPrimitivesEntityStore { pub trait ModelWithTupleNoPrimitivesStore { fn entity_id_from_keys(player: ContractAddress) -> felt252; - fn from_values(ref keys: Span, ref values: Span) -> ModelWithTupleNoPrimitives; + fn from_values(ref keys: Span, ref values: Span) -> Option; fn get(world: dojo::world::IWorldDispatcher, player: ContractAddress) -> ModelWithTupleNoPrimitives; @@ -26707,6 +26874,11 @@ error: Key is only supported for core types that are 1 felt long once serialized id: u256 ^^ +error: Model must define at least one #[key] attribute + --> /tmp/plugin_test/model/src/lib.cairo:98:8 +struct U256KeyModel { + ^**********^ + error: Model must define at least one member that is not a key --> /tmp/plugin_test/model/src/lib.cairo:98:8 struct U256KeyModel { diff --git a/crates/dojo-world/src/contracts/abi/model.rs b/crates/dojo-world/src/contracts/abi/model.rs index 13b5804fa1..febe94b9de 100644 --- a/crates/dojo-world/src/contracts/abi/model.rs +++ b/crates/dojo-world/src/contracts/abi/model.rs @@ -64,7 +64,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -72,33 +72,33 @@ abigen!( }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -106,15 +106,15 @@ abigen!( }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -122,7 +122,7 @@ abigen!( }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -132,7 +132,7 @@ abigen!( "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -149,7 +149,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -161,23 +161,23 @@ abigen!( }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -189,23 +189,23 @@ abigen!( }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -217,23 +217,23 @@ abigen!( }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -241,19 +241,19 @@ abigen!( }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -267,7 +267,7 @@ abigen!( "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index d525afb39a..1c9203d708 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -82,7 +82,7 @@ abigen!( }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -90,33 +90,33 @@ abigen!( }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -124,15 +124,15 @@ abigen!( }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -140,7 +140,7 @@ abigen!( }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -152,6 +152,10 @@ abigen!( "name": "Model", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" }, + { + "name": "Event", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, { "name": "Contract", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" @@ -252,6 +256,30 @@ abigen!( "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -349,7 +377,7 @@ abigen!( }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [ @@ -377,7 +405,7 @@ abigen!( }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -397,7 +425,7 @@ abigen!( }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -935,6 +963,70 @@ abigen!( } ] }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world_contract::world::StoreSetRecord", @@ -1192,6 +1284,16 @@ abigen!( "type": "dojo::world::world_contract::world::ModelUpgraded", "kind": "nested" }, + { + "name": "EventRegistered", + "type": "dojo::world::world_contract::world::EventRegistered", + "kind": "nested" + }, + { + "name": "EventUpgraded", + "type": "dojo::world::world_contract::world::EventUpgraded", + "kind": "nested" + }, { "name": "StoreSetRecord", "type": "dojo::world::world_contract::world::StoreSetRecord", diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs index 132bd99b0a..d7408ea972 100644 --- a/crates/dojo-world/src/contracts/model.rs +++ b/crates/dojo-world/src/contracts/model.rs @@ -124,7 +124,7 @@ where } pub async fn entity_storage(&self, keys: &[Felt]) -> Result, ModelError> { - // As the dojo::model::Layout type has been pasted + // As the dojo::meta::Layout type has been pasted // in both `model` and `world` ABI by abigen, the compiler sees both types // as different even if they are strictly identical. // Here is a trick reading the model layout as raw FieldElement diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 40da5893ad..4e7119dc41 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -73,7 +73,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea") + felt!("0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d") ); // accessing to an unknown model should return an error diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index ed166325b3..c8491c8ba8 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -20,8 +20,8 @@ use super::{ }; use crate::contracts::naming::{get_filename_from_tag, get_tag}; use crate::manifest::{ - parse_models_events, AbstractManifestError, DeploymentManifest, Manifest, OverlayClass, - OverlayDojoModel, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, + parse_models_events, AbstractManifestError, DeploymentManifest, DojoEvent, Manifest, + OverlayClass, OverlayDojoModel, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, }; use crate::metadata::dojo_metadata_from_workspace; use crate::migration::world::WorldDiff; @@ -333,10 +333,12 @@ fn fetch_remote_manifest() { DeploymentManifest::load_from_remote(provider, strat.world_address).await.unwrap() }); - assert_eq!(local_manifest.models.len(), 10); + assert_eq!(local_manifest.models.len(), 8); + assert_eq!(local_manifest.events.len(), 2); assert_eq!(local_manifest.contracts.len(), 4); - assert_eq!(remote_manifest.models.len(), 10); + assert_eq!(remote_manifest.models.len(), 8); + assert_eq!(remote_manifest.events.len(), 2); assert_eq!(remote_manifest.contracts.len(), 4); // compute diff from local and remote manifest @@ -576,6 +578,7 @@ fn overlay_merge_for_base_work_as_expected() { fn base_manifest_remove_items_work_as_expected() { let contracts = ["ns:c1", "ns:c2", "ns:c3"]; let models = ["ns:m1", "ns:m2", "ns:m3"]; + let events = ["ns:e1", "ns:e2", "ns:e3"]; let world = Manifest { manifest_name: "world".into(), inner: Default::default() }; let base = Manifest { manifest_name: "dojo-base".to_string(), inner: Default::default() }; @@ -594,10 +597,22 @@ fn base_manifest_remove_items_work_as_expected() { inner: DojoModel { tag: c.to_string(), ..Default::default() }, }) .collect(); + let events = events + .iter() + .map(|e| Manifest { + manifest_name: e.to_string(), + inner: DojoEvent { tag: e.to_string(), ..Default::default() }, + }) + .collect(); - let mut base = BaseManifest { contracts, models, world, base }; + let mut base = BaseManifest { contracts, models, events, world, base }; - base.remove_tags(&["ns:c1".to_string(), "ns:c3".to_string(), "ns:m2".to_string()]); + base.remove_tags(&[ + "ns:c1".to_string(), + "ns:c3".to_string(), + "ns:m2".to_string(), + "ns:e3".to_string(), + ]); assert_eq!(base.contracts.len(), 1); assert_eq!( @@ -610,6 +625,12 @@ fn base_manifest_remove_items_work_as_expected() { base.models.iter().map(|c| c.manifest_name.clone()).collect::>(), vec!["ns:m1", "ns:m3"] ); + + assert_eq!(base.events.len(), 2); + assert_eq!( + base.events.iter().map(|e| e.manifest_name.clone()).collect::>(), + vec!["ns:e1", "ns:e2"] + ); } fn serialize_bytearray(s: &str) -> Vec { diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index e7a067746a..dcf5b50b02 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -29,9 +29,9 @@ mod test; mod types; pub use types::{ - AbiFormat, BaseManifest, Class, DeploymentManifest, DojoContract, DojoModel, Manifest, - ManifestMethods, Member, OverlayClass, OverlayContract, OverlayDojoContract, OverlayDojoModel, - OverlayManifest, WorldContract, WorldMetadata, + AbiFormat, BaseManifest, Class, DeploymentManifest, DojoContract, DojoEvent, DojoModel, + Manifest, ManifestMethods, Member, OverlayClass, OverlayContract, OverlayDojoContract, + OverlayDojoEvent, OverlayDojoModel, OverlayManifest, WorldContract, WorldMetadata, }; pub const WORLD_CONTRACT_TAG: &str = "dojo-world"; @@ -49,6 +49,7 @@ pub const ABIS_DIR: &str = "abis"; pub const CONTRACTS_DIR: &str = "contracts"; pub const MODELS_DIR: &str = "models"; +pub const EVENTS_DIR: &str = "events"; #[derive(Error, Debug)] pub enum AbstractManifestError { @@ -105,6 +106,7 @@ impl From for DeploymentManifest { base: value.base, contracts: value.contracts, models: value.models, + events: value.events, } } } @@ -122,14 +124,16 @@ impl BaseManifest { let contracts = elements_from_path::(&path.join(CONTRACTS_DIR))?; let models = elements_from_path::(&path.join(MODELS_DIR))?; + let events = elements_from_path::(&path.join(EVENTS_DIR))?; - Ok(Self { world, base, contracts, models }) + Ok(Self { world, base, contracts, models, events }) } /// Given a list of contract or model tags, remove those from the manifest. pub fn remove_tags(&mut self, tags: &[String]) { self.contracts.retain(|contract| !tags.contains(&contract.inner.tag)); self.models.retain(|model| !tags.contains(&model.inner.tag)); + self.events.retain(|event| !tags.contains(&event.inner.tag)); } /// Generates a map of `tag -> ManifestKind` @@ -143,6 +147,10 @@ impl BaseManifest { kind_from_tags.insert(model.inner.tag.clone(), ManifestKind::Model); } + for event in self.events.as_slice() { + kind_from_tags.insert(event.inner.tag.clone(), ManifestKind::Event); + } + for contract in self.contracts.as_slice() { kind_from_tags.insert(contract.inner.tag.clone(), ManifestKind::Contract); } @@ -184,6 +192,7 @@ pub enum ManifestKind { WorldClass, Contract, Model, + Event, } impl OverlayManifest { @@ -205,6 +214,10 @@ impl OverlayManifest { let overlay: OverlayDojoModel = toml::from_str(&fs::read_to_string(path)?)?; overlays.models.push(overlay); } + ManifestKind::Event => { + let overlay: OverlayDojoEvent = toml::from_str(&fs::read_to_string(path)?)?; + overlays.events.push(overlay); + } ManifestKind::Contract => { let overlay: OverlayDojoContract = toml::from_str(&fs::read_to_string(path)?)?; overlays.contracts.push(overlay); @@ -299,6 +312,7 @@ impl OverlayManifest { overlay_to_path::(path, self.contracts.as_slice(), |c| c.tag.clone())?; overlay_to_path::(path, self.models.as_slice(), |m| m.tag.clone())?; + overlay_to_path::(path, self.events.as_slice(), |m| m.tag.clone())?; Ok(()) } @@ -326,6 +340,13 @@ impl OverlayManifest { self.models.push(other_model); } } + + for other_event in other.events { + let found = self.events.iter().find(|m| m.tag == other_event.tag); + if found.is_none() { + self.events.push(other_event); + } + } } } @@ -384,6 +405,12 @@ impl DeploymentManifest { } } + for event in &mut manifest_with_abis.events { + if let Some(abi_format) = &event.inner.abi { + event.inner.abi = Some(abi_format.to_embed(root_dir)?); + } + } + let deployed_manifest = serde_json::to_string_pretty(&manifest_with_abis)?; fs::write(path, deployed_manifest)?; @@ -417,10 +444,11 @@ impl DeploymentManifest { let base_class_hash = world.base().block_id(BLOCK_ID).call().await?; let base_class_hash = base_class_hash.into(); - let (models, contracts) = - get_remote_models_and_contracts(world_address, &world.provider()).await?; + let (events, models, contracts) = + get_remote_elements(world_address, &world.provider()).await?; Ok(DeploymentManifest { + events, models, contracts, world: Manifest::new( @@ -474,13 +502,17 @@ impl DeploymentManifest { // #[async_trait] // impl RemoteLoadable

for DeploymentManifest {} -async fn get_remote_models_and_contracts

( +async fn get_remote_elements

( world: Felt, provider: P, -) -> Result<(Vec>, Vec>), AbstractManifestError> +) -> Result< + (Vec>, Vec>, Vec>), + AbstractManifestError, +> where P: Provider + Send + Sync, { + let registered_events_event_name = starknet_keccak("EventRegistered".as_bytes()); let registered_models_event_name = starknet_keccak("ModelRegistered".as_bytes()); let contract_deployed_event_name = starknet_keccak("ContractDeployed".as_bytes()); let contract_upgraded_event_name = starknet_keccak("ContractUpgraded".as_bytes()); @@ -490,6 +522,7 @@ where &provider, world, vec![vec![ + registered_events_event_name, registered_models_event_name, contract_deployed_event_name, contract_upgraded_event_name, @@ -498,6 +531,7 @@ where ) .await?; + let mut registered_events_events = vec![]; let mut registered_models_events = vec![]; let mut contract_deployed_events = vec![]; let mut contract_upgraded_events = vec![]; @@ -505,6 +539,9 @@ where for event in events { match event.keys.first() { + Some(event_name) if *event_name == registered_events_event_name => { + registered_events_events.push(event) + } Some(event_name) if *event_name == registered_models_event_name => { registered_models_events.push(event) } @@ -521,6 +558,7 @@ where } } + let events = parse_events_events(registered_events_events); let models = parse_models_events(registered_models_events); let mut contracts = parse_contracts_events( contract_deployed_events, @@ -532,7 +570,7 @@ where contract.manifest_name = naming::get_filename_from_tag(&contract.inner.tag); } - Ok((models, contracts)) + Ok((events, models, contracts)) } async fn get_events( @@ -694,6 +732,35 @@ fn parse_contracts_events( .collect() } +fn parse_events_events(events: Vec) -> Vec> { + let mut parsed_events: HashMap = HashMap::with_capacity(events.len()); + + for e in events { + let event = match e.try_into() { + Ok(WorldEvent::EventRegistered(mr)) => mr, + Ok(_) => panic!("EventRegistered expected as already filtered"), + Err(_) => { + continue; + } + }; + + let model_name = event.name.to_string().expect("ASCII encoded name"); + let namespace = event.namespace.to_string().expect("ASCII encoded namespace"); + let event_tag = naming::get_tag(&namespace, &model_name); + + parsed_events.insert(event_tag, event.class_hash.into()); + } + + // TODO: include address of the event in the manifest. + parsed_events + .into_iter() + .map(|(tag, class_hash)| Manifest:: { + inner: DojoEvent { tag: tag.clone(), class_hash, abi: None, ..Default::default() }, + manifest_name: naming::get_filename_from_tag(&tag), + }) + .collect() +} + fn parse_models_events(events: Vec) -> Vec> { let mut models: HashMap = HashMap::with_capacity(events.len()); @@ -732,21 +799,23 @@ where { let mut elements = vec![]; - let mut entries = path - .read_dir()? - .map(|entry| entry.map(|e| e.path())) - .collect::, io::Error>>()?; + if path.try_exists().unwrap_or(false) { + let mut entries = path + .read_dir()? + .map(|entry| entry.map(|e| e.path())) + .collect::, io::Error>>()?; - // `read_dir` doesn't guarantee any order, so we sort the entries ourself. - // see: https://doc.rust-lang.org/std/fs/fn.read_dir.html#platform-specific-behavior - entries.sort(); + // `read_dir` doesn't guarantee any order, so we sort the entries ourself. + // see: https://doc.rust-lang.org/std/fs/fn.read_dir.html#platform-specific-behavior + entries.sort(); - for path in entries { - if path.is_file() { - let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; - elements.push(manifest); - } else { - continue; + for path in entries { + if path.is_file() { + let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; + elements.push(manifest); + } else { + continue; + } } } @@ -812,6 +881,36 @@ impl ManifestMethods for DojoContract { } } +impl ManifestMethods for DojoEvent { + type OverlayType = OverlayDojoEvent; + + fn abi(&self) -> Option<&AbiFormat> { + self.abi.as_ref() + } + + fn set_abi(&mut self, abi: Option) { + self.abi = abi; + } + + fn class_hash(&self) -> &Felt { + self.class_hash.as_ref() + } + + fn set_class_hash(&mut self, class_hash: Felt) { + self.class_hash = class_hash; + } + + fn original_class_hash(&self) -> &Felt { + self.original_class_hash.as_ref() + } + + fn merge(&mut self, old: Self::OverlayType) { + if let Some(class_hash) = old.original_class_hash { + self.original_class_hash = class_hash; + } + } +} + impl ManifestMethods for DojoModel { type OverlayType = OverlayDojoModel; diff --git a/crates/dojo-world/src/manifest/types.rs b/crates/dojo-world/src/manifest/types.rs index 49f6b9163e..db7c7c1e6f 100644 --- a/crates/dojo-world/src/manifest/types.rs +++ b/crates/dojo-world/src/manifest/types.rs @@ -25,6 +25,7 @@ pub struct BaseManifest { pub base: Manifest, pub contracts: Vec>, pub models: Vec>, + pub events: Vec>, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -36,6 +37,7 @@ pub struct DeploymentManifest { // hashes from the events, so needs to be handled accordingly pub contracts: Vec>, pub models: Vec>, + pub events: Vec>, } #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -45,6 +47,7 @@ pub struct OverlayManifest { pub base: Option, pub contracts: Vec, pub models: Vec, + pub events: Vec, } #[derive(Clone, Serialize, Default, Deserialize, Debug)] @@ -125,6 +128,22 @@ pub struct DojoModel { pub qualified_path: String, } +/// Represents a declaration of an event. +#[serde_as] +#[derive(Clone, Default, Debug, Serialize, Deserialize)] +#[cfg_attr(test, derive(PartialEq))] +#[serde(tag = "kind")] +pub struct DojoEvent { + pub members: Vec, + #[serde_as(as = "UfeHex")] + pub class_hash: Felt, + #[serde_as(as = "UfeHex")] + pub original_class_hash: Felt, + pub abi: Option, + pub tag: String, + pub qualified_path: String, +} + #[serde_as] #[derive(Clone, Default, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] @@ -176,6 +195,14 @@ pub struct OverlayDojoModel { pub original_class_hash: Option, } +#[serde_as] +#[derive(Clone, Default, Debug, Serialize, Deserialize)] +#[cfg_attr(test, derive(PartialEq))] +pub struct OverlayDojoEvent { + pub tag: String, + pub original_class_hash: Option, +} + #[serde_as] #[derive(Clone, Default, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] diff --git a/crates/dojo-world/src/migration/mod.rs b/crates/dojo-world/src/migration/mod.rs index 1c3396a022..2290d20f38 100644 --- a/crates/dojo-world/src/migration/mod.rs +++ b/crates/dojo-world/src/migration/mod.rs @@ -51,7 +51,7 @@ pub struct UpgradeOutput { pub struct RegisterOutput { pub transaction_hash: Felt, pub declare_output: Vec, - pub registered_models: Vec, + pub registered_elements: Vec, } #[derive(Debug, Error)] diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index fcce6e6f82..2ec902e0e0 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -13,7 +13,7 @@ use super::contract::{ContractDiff, ContractMigration}; use super::world::WorldDiff; use super::MigrationType; use crate::contracts::naming; -use crate::manifest::{CONTRACTS_DIR, MODELS_DIR}; +use crate::manifest::{CONTRACTS_DIR, EVENTS_DIR, MODELS_DIR}; #[derive(Debug, Clone)] pub enum MigrationMetadata { @@ -27,6 +27,7 @@ pub struct MigrationStrategy { pub base: Option, pub contracts: Vec, pub models: Vec, + pub events: Vec, pub metadata: HashMap, } @@ -58,6 +59,11 @@ impl MigrationStrategy { MigrationType::Update => update += 1, }); + self.events.iter().for_each(|item| match item.migration_type() { + MigrationType::New => new += 1, + MigrationType::Update => update += 1, + }); + MigrationItemsInfo { new, update } } @@ -106,6 +112,7 @@ pub fn prepare_for_migration( read_artifact_paths(target_dir, &mut artifact_paths)?; read_artifact_paths(&target_dir.join(MODELS_DIR), &mut artifact_paths)?; + read_artifact_paths(&target_dir.join(EVENTS_DIR), &mut artifact_paths)?; read_artifact_paths(&target_dir.join(CONTRACTS_DIR), &mut artifact_paths)?; // We don't need to care if a contract has already been declared or not, because @@ -122,6 +129,7 @@ pub fn prepare_for_migration( world.is_some(), )?; let models = evaluate_models_to_migrate(&diff.models, &artifact_paths, world.is_some())?; + let events = evaluate_events_to_migrate(&diff.events, &artifact_paths, world.is_some())?; // If world needs to be migrated, then we expect the `seed` to be provided. if let Some(world) = &mut world { @@ -142,13 +150,31 @@ pub fn prepare_for_migration( let world_address = world_address.unwrap_or_else(|| world.as_ref().unwrap().contract_address); let mut migration = - MigrationStrategy { world_address, world, base, contracts, models, metadata }; + MigrationStrategy { world_address, world, base, contracts, models, events, metadata }; migration.resolve_variable(world_address)?; Ok(migration) } +fn evaluate_events_to_migrate( + events: &[ClassDiff], + artifact_paths: &HashMap, + world_contract_will_migrate: bool, +) -> Result> { + let mut comps_to_migrate = vec![]; + + for c in events { + if let Ok(Some(c)) = + evaluate_class_to_migrate(c, artifact_paths, world_contract_will_migrate) + { + comps_to_migrate.push(c); + } + } + + Ok(comps_to_migrate) +} + fn evaluate_models_to_migrate( models: &[ClassDiff], artifact_paths: &HashMap, diff --git a/crates/dojo-world/src/migration/world.rs b/crates/dojo-world/src/migration/world.rs index 46d76f5569..372931286f 100644 --- a/crates/dojo-world/src/migration/world.rs +++ b/crates/dojo-world/src/migration/world.rs @@ -25,6 +25,7 @@ pub struct WorldDiff { pub base: ClassDiff, pub contracts: Vec, pub models: Vec, + pub events: Vec, } impl WorldDiff { @@ -49,6 +50,22 @@ impl WorldDiff { }) .collect::>(); + let events = local + .events + .iter() + .map(|event| ClassDiff { + tag: event.inner.tag.to_string(), + local_class_hash: *event.inner.class_hash(), + original_class_hash: *event.inner.original_class_hash(), + remote_class_hash: remote.as_ref().and_then(|m| { + m.events + .iter() + .find(|e| e.manifest_name == event.manifest_name) + .map(|s| *s.inner.class_hash()) + }), + }) + .collect::>(); + let contracts = local .contracts .iter() @@ -106,7 +123,7 @@ impl WorldDiff { remote_writes: vec![], }; - let mut diff = WorldDiff { world, base, contracts, models }; + let mut diff = WorldDiff { world, base, contracts, models, events }; diff.update_order(default_namespace)?; Ok(diff) @@ -120,6 +137,7 @@ impl WorldDiff { } count += self.models.iter().filter(|s| !s.is_same()).count(); + count += self.events.iter().filter(|s| !s.is_same()).count(); count += self.contracts.iter().filter(|s| !s.is_same()).count(); count } @@ -191,6 +209,10 @@ impl Display for WorldDiff { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { writeln!(f, "{}", self.world)?; + for event in &self.events { + writeln!(f, "{event}")?; + } + for model in &self.models { writeln!(f, "{model}")?; } diff --git a/crates/dojo-world/src/migration/world_test.rs b/crates/dojo-world/src/migration/world_test.rs index c6a0c8b8fa..1786f16474 100644 --- a/crates/dojo-world/src/migration/world_test.rs +++ b/crates/dojo-world/src/migration/world_test.rs @@ -2,7 +2,7 @@ use starknet::macros::felt; use super::*; use crate::contracts::naming::{get_filename_from_tag, get_tag}; -use crate::manifest::{BaseManifest, Class, DojoContract, DojoModel, Manifest}; +use crate::manifest::{BaseManifest, Class, DojoContract, DojoEvent, DojoModel, Manifest}; #[test] fn no_diff_when_local_and_remote_are_equal() { @@ -26,11 +26,27 @@ fn no_diff_when_local_and_remote_are_equal() { "dojo_mock-model".into(), )]; - let local = - BaseManifest { models, world: world_contract, base: base_contract, contracts: vec![] }; + let events = vec![Manifest::new( + DojoEvent { members: vec![], class_hash: 11_u32.into(), ..Default::default() }, + "dojo_mock-event".into(), + )]; + + let remote_events = vec![Manifest::new( + DojoEvent { members: vec![], class_hash: 11_u32.into(), ..Default::default() }, + "dojo_mock-event".into(), + )]; + + let local = BaseManifest { + models, + events, + world: world_contract, + base: base_contract, + contracts: vec![], + }; let mut remote: DeploymentManifest = local.clone().into(); remote.models = remote_models; + remote.events = remote_events; let diff = WorldDiff::compute(local, Some(remote), "dojo-test").unwrap(); @@ -92,6 +108,18 @@ fn diff_when_local_and_remote_are_different() { ), ]; + let events = vec![Manifest::new( + DojoEvent { + tag: get_tag("dojo_mock", "event"), + members: vec![], + class_hash: felt!("0x11"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("dojo_mock", "event")), + )]; + + let remote_events = vec![]; + let contracts = vec![ Manifest::new( DojoContract { @@ -113,19 +141,22 @@ fn diff_when_local_and_remote_are_different() { ), ]; - let local = BaseManifest { models, contracts, world: world_contract, base: base_contract }; + let local = + BaseManifest { models, events, contracts, world: world_contract, base: base_contract }; let mut remote: DeploymentManifest = local.clone().into(); remote.models = remote_models; + remote.events = remote_events; remote.world.inner.class_hash = 44_u32.into(); remote.models[1].inner.class_hash = 33_u32.into(); remote.contracts[0].inner.class_hash = felt!("0x1112"); let diff = WorldDiff::compute(local, Some(remote), "dojo-test").unwrap(); - assert_eq!(diff.count_diffs(), 3); + assert_eq!(diff.count_diffs(), 4); assert!(diff.models.iter().any(|m| m.tag == get_tag("dojo_mock", "model2"))); assert!(diff.contracts.iter().any(|c| c.tag == get_tag("dojo_mock", "my_contract"))); + assert!(diff.events.iter().any(|e| e.tag == get_tag("dojo_mock", "event"))); } #[test] @@ -154,6 +185,7 @@ fn updating_order_as_expected() { base: ClassDiff::default(), contracts, models: vec![], + events: vec![], }; diff.update_order("ns").unwrap(); @@ -190,6 +222,7 @@ fn updating_order_when_cyclic_dependency_fail() { base: ClassDiff::default(), contracts, models: vec![], + events: vec![], }; assert!(diff.update_order("ns").is_err_and(|e| e.to_string().contains("Cyclic"))); diff --git a/crates/sozo/ops/src/events.rs b/crates/sozo/ops/src/events.rs index 1bf378b101..8a1d5f5bbc 100644 --- a/crates/sozo/ops/src/events.rs +++ b/crates/sozo/ops/src/events.rs @@ -291,7 +291,7 @@ mod tests { let result = extract_events(&manifest, &project_dir, &target_dir).unwrap(); // we are just collecting all events from manifest file so just verifying count should work - assert_eq!(result.len(), 20); + assert_eq!(result.len(), 22); } #[test] diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index c8c4b0fbfd..d6f41f2262 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -12,9 +12,9 @@ use dojo_world::contracts::naming::{ }; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ - AbiFormat, BaseManifest, Class, DeploymentManifest, DojoContract, DojoModel, Manifest, - ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, BASE_DIR, - DEPLOYMENT_DIR, MANIFESTS_DIR, + AbiFormat, BaseManifest, Class, DeploymentManifest, DojoContract, DojoEvent, DojoModel, + Manifest, ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, + BASE_DIR, DEPLOYMENT_DIR, MANIFESTS_DIR, }; use dojo_world::metadata::{dojo_metadata_from_workspace, ResourceMetadata}; use dojo_world::migration::class::ClassMigration; @@ -201,6 +201,7 @@ where world_block_number, full: false, models: vec![], + events: vec![], contracts: vec![], }; @@ -216,11 +217,23 @@ where // TODO: rework this part when more time. if declarers.is_empty() { + match register_dojo_events(&strategy.events, world_address, &migrator, &ui, &txn_config) + .await + { + Ok(output) => { + migration_output.events = output.registered_elements; + } + Err(e) => { + ui.anyhow(&e); + return Ok(migration_output); + } + }; + match register_dojo_models(&strategy.models, world_address, &migrator, &ui, &txn_config) .await { Ok(output) => { - migration_output.models = output.registered_models; + migration_output.models = output.registered_elements; } Err(e) => { ui.anyhow(&e); @@ -246,6 +259,25 @@ where } }; } else { + match register_dojo_events_with_declarers( + &strategy.events, + world_address, + &migrator, + &ui, + &txn_config, + declarers, + ) + .await + { + Ok(output) => { + migration_output.events = output.registered_elements; + } + Err(e) => { + ui.anyhow(&e); + return Ok(migration_output); + } + }; + match register_dojo_models_with_declarers( &strategy.models, world_address, @@ -257,7 +289,7 @@ where .await { Ok(output) => { - migration_output.models = output.registered_models; + migration_output.models = output.registered_elements; } Err(e) => { ui.anyhow(&e); @@ -489,6 +521,214 @@ where Ok(()) } +async fn register_dojo_events( + events: &[ClassMigration], + world_address: Felt, + migrator: &A, + ui: &Ui, + txn_config: &TxnConfig, +) -> Result +where + A: ConnectedAccount + Send + Sync, + ::Provider: Send, +{ + if events.is_empty() { + return Ok(RegisterOutput { + transaction_hash: Felt::ZERO, + declare_output: vec![], + registered_elements: vec![], + }); + } + + ui.print_header(format!("# Events ({})", events.len())); + + let world = WorldContract::new(world_address, &migrator); + + let mut declare_output = vec![]; + let mut events_to_register = vec![]; + + for (i, m) in events.iter().enumerate() { + let tag = &m.diff.tag; + + ui.print(italic_message(tag).to_string()); + + if let Resource::Unregistered = + world.resource(&compute_selector_from_tag(tag)).call().await? + { + events_to_register.push(tag.clone()); + } else { + ui.print_sub("Already registered"); + continue; + } + + match m.declare(&migrator, txn_config).await { + Ok(output) => { + ui.print_sub(format!("Selector: {:#066x}", compute_selector_from_tag(tag))); + ui.print_hidden_sub(format!("Class hash: {:#066x}", output.class_hash)); + ui.print_hidden_sub(format!( + "Declare transaction: {:#066x}", + output.transaction_hash + )); + declare_output.push(output); + } + Err(MigrationError::ClassAlreadyDeclared) => { + ui.print_sub("Already declared"); + } + Err(MigrationError::ArtifactError(e)) => { + return Err(handle_artifact_error(ui, events[i].artifact_path(), e)); + } + Err(e) => { + ui.verbose(format!("{e:?}")); + bail!("Failed to declare event: {e}") + } + } + } + + let calls = events + .iter() + .filter(|m| events_to_register.contains(&m.diff.tag)) + .map(|c| world.register_event_getcall(&c.diff.local_class_hash.into())) + .collect::>(); + + if calls.is_empty() { + return Ok(RegisterOutput { + transaction_hash: Felt::ZERO, + declare_output: vec![], + registered_elements: vec![], + }); + } + + let InvokeTransactionResult { transaction_hash } = + world.account.execute_v1(calls).send_with_cfg(txn_config).await.map_err(|e| { + ui.verbose(format!("{e:?}")); + anyhow!("Failed to register events to World: {e}") + })?; + + TransactionWaiter::new(transaction_hash, migrator.provider()).await?; + + ui.print(format!("All events are registered at: {transaction_hash:#x}\n")); + + Ok(RegisterOutput { transaction_hash, declare_output, registered_elements: events_to_register }) +} + +// For now duplicated because the migrator account is different from the declarers account type. +async fn register_dojo_events_with_declarers( + events: &[ClassMigration], + world_address: Felt, + migrator: &A, + ui: &Ui, + txn_config: &TxnConfig, + declarers: &[SingleOwnerAccount], +) -> Result +where + A: ConnectedAccount + Send + Sync, + ::Provider: Send, +{ + if events.is_empty() { + return Ok(RegisterOutput { + transaction_hash: Felt::ZERO, + declare_output: vec![], + registered_elements: vec![], + }); + } + + ui.print_header(format!("# Events ({})", events.len())); + + let mut declare_output = vec![]; + let mut events_to_register = vec![]; + + let mut declarers_tasks = HashMap::new(); + for (i, m) in events.iter().enumerate() { + let declarer_index = i % declarers.len(); + declarers_tasks + .entry(declarer_index) + .or_insert(vec![]) + .push((m.diff.tag.clone(), m.declare(&declarers[declarer_index], txn_config))); + } + + let mut futures = Vec::new(); + + for (declarer_index, d_tasks) in declarers_tasks { + let future = async move { + let mut results = Vec::new(); + for (tag, task) in d_tasks { + let result = task.await; + results.push((declarer_index, tag, result)); + } + results + }; + + futures.push(future); + } + + let all_results = futures::future::join_all(futures).await; + + let world = WorldContract::new(world_address, &migrator); + + for results in all_results { + for (index, tag, result) in results { + ui.print(italic_message(&tag).to_string()); + + if let Resource::Unregistered = + world.resource(&compute_selector_from_tag(&tag)).call().await? + { + events_to_register.push(tag.clone()); + } else { + ui.print_sub("Already registered"); + continue; + } + + match result { + Ok(output) => { + ui.print_sub(format!("Selector: {:#066x}", compute_selector_from_tag(&tag))); + ui.print_hidden_sub(format!("Class hash: {:#066x}", output.class_hash)); + ui.print_hidden_sub(format!( + "Declare transaction: {:#066x}", + output.transaction_hash + )); + declare_output.push(output); + } + Err(MigrationError::ClassAlreadyDeclared) => { + ui.print_sub("Already declared"); + } + Err(MigrationError::ArtifactError(e)) => { + return Err(handle_artifact_error(ui, events[index].artifact_path(), e)); + } + Err(e) => { + ui.verbose(format!("{e:?}")); + bail!("Failed to declare event: {e}") + } + } + } + } + + let calls = events + .iter() + .filter(|m| events_to_register.contains(&m.diff.tag)) + .map(|c| world.register_event_getcall(&c.diff.local_class_hash.into())) + .collect::>(); + + if calls.is_empty() { + return Ok(RegisterOutput { + transaction_hash: Felt::ZERO, + declare_output: vec![], + registered_elements: vec![], + }); + } + + let InvokeTransactionResult { transaction_hash } = + world.account.execute_v1(calls).send_with_cfg(txn_config).await.map_err(|e| { + ui.verbose(format!("{e:?}")); + anyhow!("Failed to register events to World: {e}") + })?; + + TransactionWaiter::new(transaction_hash, migrator.provider()).await?; + + ui.print(format!("All events are registered at: {transaction_hash:#x}\n")); + + Ok(RegisterOutput { transaction_hash, declare_output, registered_elements: events_to_register }) +} + async fn register_dojo_models( models: &[ClassMigration], world_address: Felt, @@ -504,7 +744,7 @@ where return Ok(RegisterOutput { transaction_hash: Felt::ZERO, declare_output: vec![], - registered_models: vec![], + registered_elements: vec![], }); } @@ -562,7 +802,7 @@ where return Ok(RegisterOutput { transaction_hash: Felt::ZERO, declare_output: vec![], - registered_models: vec![], + registered_elements: vec![], }); } @@ -576,7 +816,7 @@ where ui.print(format!("All models are registered at: {transaction_hash:#x}\n")); - Ok(RegisterOutput { transaction_hash, declare_output, registered_models: models_to_register }) + Ok(RegisterOutput { transaction_hash, declare_output, registered_elements: models_to_register }) } // For now duplicated because the migrator account is different from the declarers account type. @@ -596,7 +836,7 @@ where return Ok(RegisterOutput { transaction_hash: Felt::ZERO, declare_output: vec![], - registered_models: vec![], + registered_elements: vec![], }); } @@ -680,7 +920,7 @@ where return Ok(RegisterOutput { transaction_hash: Felt::ZERO, declare_output: vec![], - registered_models: vec![], + registered_elements: vec![], }); } @@ -694,7 +934,7 @@ where ui.print(format!("All models are registered at: {transaction_hash:#x}\n")); - Ok(RegisterOutput { transaction_hash, declare_output, registered_models: models_to_register }) + Ok(RegisterOutput { transaction_hash, declare_output, registered_elements: models_to_register }) } async fn register_dojo_contracts( @@ -1103,6 +1343,16 @@ pub async fn print_strategy

( ui.print(" "); + if !&strategy.events.is_empty() { + ui.print_header(format!("# Events ({})", &strategy.events.len())); + for e in &strategy.events { + ui.print(e.diff.tag.to_string()); + ui.print_sub(format!("Class hash: {:#x}", e.diff.local_class_hash)); + } + } + + ui.print(" "); + if !&strategy.contracts.is_empty() { ui.print_header(format!("# Contracts ({})", &strategy.contracts.len())); for c in &strategy.contracts { @@ -1399,4 +1649,8 @@ async fn update_manifest_abis( for model in local_manifest.models.iter_mut() { inner_helper::(manifest_dir, profile_name, model).await; } + + for event in local_manifest.events.iter_mut() { + inner_helper::(manifest_dir, profile_name, event).await; + } } diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index a74db4799f..dc455def9e 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -45,6 +45,7 @@ pub struct MigrationOutput { pub full: bool, pub models: Vec, + pub events: Vec, pub contracts: Vec>, } diff --git a/crates/sozo/ops/src/tests/model.rs b/crates/sozo/ops/src/tests/model.rs index 4e44973261..58925962e7 100644 --- a/crates/sozo/ops/src/tests/model.rs +++ b/crates/sozo/ops/src/tests/model.rs @@ -46,7 +46,7 @@ async fn test_model_ops() { ) .await .unwrap(), - Felt::from_hex("0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44") + Felt::from_hex("0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e") .unwrap() ); @@ -58,8 +58,7 @@ async fn test_model_ops() { ) .await .unwrap(), - Felt::from_hex("0x68e3a53988f20d84c6652f25d6add070633a5d05f8c4ac68285cacb228afa14") - .unwrap() + Felt::from_hex("0xceb99997071ac4c57e30cc29d5b3f2702c541325dfe5015905f7b128704d58").unwrap() ); let layout = diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index b60ea3de36..c09dd44cc3 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -132,7 +132,7 @@ async fn test_load_from_remote() { let _block_timestamp = 1710754478_u64; let models = sqlx::query("SELECT * FROM models").fetch_all(&pool).await.unwrap(); - assert_eq!(models.len(), 10); + assert_eq!(models.len(), 8); let (id, name, namespace, packed_size, unpacked_size): (String, String, String, u8, u8) = sqlx::query_as( diff --git a/examples/spawn-and-move/dojo_dev.toml b/examples/spawn-and-move/dojo_dev.toml index b75849d8bf..633cdadeda 100644 --- a/examples/spawn-and-move/dojo_dev.toml +++ b/examples/spawn-and-move/dojo_dev.toml @@ -14,4 +14,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x5fedbace16902d9ca4cdc1522f9fe156cd8c69a5d25e1436ee4b7b9933ad997" +world_address = "0x5e0bb8882b597a0e5da4e07d91e4c9a13d290d417c8c38ef7ce47be49932976" diff --git a/examples/spawn-and-move/dojo_release.toml b/examples/spawn-and-move/dojo_release.toml index 053cc2118e..562a5bc2ca 100644 --- a/examples/spawn-and-move/dojo_release.toml +++ b/examples/spawn-and-move/dojo_release.toml @@ -14,7 +14,7 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x577ff0295103774d1bedd597a1c5673670eea0bb2cdeba6b8205d79396825b3" +world_address = "0x5e0bb8882b597a0e5da4e07d91e4c9a13d290d417c8c38ef7ce47be49932976" [migration] skip_contracts = [ diff --git a/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json index 8553809311..f04bdb08c4 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -146,6 +146,10 @@ "name": "Model", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" }, + { + "name": "Event", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, { "name": "Contract", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" @@ -246,6 +250,30 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -343,7 +371,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [ @@ -371,7 +399,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -391,7 +419,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -929,6 +957,70 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world_contract::world::StoreSetRecord", @@ -1186,6 +1278,16 @@ "type": "dojo::world::world_contract::world::ModelUpgraded", "kind": "nested" }, + { + "name": "EventRegistered", + "type": "dojo::world::world_contract::world::EventRegistered", + "kind": "nested" + }, + { + "name": "EventUpgraded", + "type": "dojo::world::world_contract::world::EventUpgraded", + "kind": "nested" + }, { "name": "StoreSetRecord", "type": "dojo::world::world_contract::world::StoreSetRecord", diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json similarity index 67% rename from examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/dev/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json index 4641430128..a26aff02f8 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json @@ -1,8 +1,8 @@ [ { "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::model::IModel", + "name": "dojo::event::event::IEvent", "items": [ { "type": "function", @@ -317,7 +317,7 @@ }, { "type": "function", - "name": "unpacked_size", + "name": "packed_size", "inputs": [], "outputs": [ { @@ -328,7 +328,7 @@ }, { "type": "function", - "name": "packed_size", + "name": "unpacked_size", "inputs": [], "outputs": [ { @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,50 +354,9 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" - }, - { - "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" + "type": "dojo::meta::introspect::Ty" } ], - "outputs": [], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/base/abis/events/dojo_examples-Moved-318ae40d.json similarity index 65% rename from examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/dev/base/abis/events/dojo_examples-Moved-318ae40d.json index bfae2f690c..fe176714ed 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/events/dojo_examples-Moved-318ae40d.json @@ -1,8 +1,8 @@ [ { "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::model::IModel", + "name": "dojo::event::event::IEvent", "items": [ { "type": "function", @@ -317,7 +317,7 @@ }, { "type": "function", - "name": "unpacked_size", + "name": "packed_size", "inputs": [], "outputs": [ { @@ -328,7 +328,7 @@ }, { "type": "function", - "name": "packed_size", + "name": "unpacked_size", "inputs": [], "outputs": [ { @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,72 +354,9 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::actions::actions::Moved", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::actions::actions::Moved" + "type": "dojo::meta::introspect::Ty" } ], - "outputs": [], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json index 5e416425e2..823381daf3 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json index 79677cca37..1c98b017ca 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json index d1fba9822d..2b90c40607 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json index 6b373d240f..212daac03a 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json index 203c340d15..51fa7d5267 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json index 58aa520a88..93e601d22f 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json index aab11e5888..9d2662e4e8 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json index 55eaa66dde..546dbce9ec 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" 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 0ae312f5c4..4106123619 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 @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" -original_class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" +class_hash = "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394" +original_class_hash = "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] 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 6385a30c6c..b226f6df2b 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 @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" -original_class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" +class_hash = "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7" +original_class_hash = "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] 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 ff32465d06..992555fe3d 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 = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" -original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" +original_class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" 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/events/dojo_examples-ContractInitialized-376b7bd6.toml similarity index 60% rename from examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml rename to examples/spawn-and-move/manifests/dev/base/events/dojo_examples-ContractInitialized-376b7bd6.toml index 9df44d0961..97185a1a87 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/dev/base/events/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,7 +1,7 @@ -kind = "DojoModel" -class_hash = "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08" -original_class_hash = "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08" -abi = "manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" +kind = "DojoEvent" +class_hash = "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479" +original_class_hash = "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479" +abi = "manifests/dev/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" qualified_path = "dojo_examples::others::others::contract_initialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/dev/base/events/dojo_examples-Moved-318ae40d.toml similarity index 51% rename from examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml rename to examples/spawn-and-move/manifests/dev/base/events/dojo_examples-Moved-318ae40d.toml index 89fe5c408f..048cefdd25 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/dev/base/events/dojo_examples-Moved-318ae40d.toml @@ -1,7 +1,7 @@ -kind = "DojoModel" -class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" -original_class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" -abi = "manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json" +kind = "DojoEvent" +class_hash = "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07" +original_class_hash = "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07" +abi = "manifests/dev/base/abis/events/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" qualified_path = "dojo_examples::actions::actions::moved" manifest_name = "dojo_examples-Moved-318ae40d" 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 07dd21e79b..fa5323e952 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" -original_class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" +class_hash = "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694" +original_class_hash = "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694" abi = "manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" qualified_path = "dojo_examples::models::message" 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 cf5e869b8c..7e4a15f133 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd" -original_class_hash = "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd" +class_hash = "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8" +original_class_hash = "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8" abi = "manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" qualified_path = "dojo_examples::models::mock_token" 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 5fa07c879b..12b1e26474 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44" -original_class_hash = "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44" +class_hash = "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e" +original_class_hash = "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e" abi = "manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" qualified_path = "dojo_examples::models::moves" 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 660fdee336..2b59bf1716 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf" -original_class_hash = "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf" +class_hash = "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c" +original_class_hash = "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c" abi = "manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" qualified_path = "dojo_examples::models::player_config" 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 ea9e123e7d..ef60402f51 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" -original_class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" +class_hash = "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d" +original_class_hash = "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d" abi = "manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" qualified_path = "dojo_examples::models::position" 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 bc286019fd..4d45b20912 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" -original_class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" +class_hash = "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea" +original_class_hash = "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea" abi = "manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" qualified_path = "dojo_examples::models::server_profile" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml index 1d8d2490c9..b90e906e35 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_foes-RiverSkale-39535c12.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7" -original_class_hash = "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7" +class_hash = "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556" +original_class_hash = "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556" abi = "manifests/dev/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json" tag = "dojo_examples_foes-RiverSkale" qualified_path = "bestiary::river_skale" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml index da82bd85b4..ebfa300cee 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad" -original_class_hash = "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad" +class_hash = "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff" +original_class_hash = "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff" abi = "manifests/dev/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json" tag = "dojo_examples_weapons-Flatbow" qualified_path = "armory::flatbow" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json index 8553809311..f04bdb08c4 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -146,6 +146,10 @@ "name": "Model", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" }, + { + "name": "Event", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, { "name": "Contract", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" @@ -246,6 +250,30 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -343,7 +371,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [ @@ -371,7 +399,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -391,7 +419,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -929,6 +957,70 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world_contract::world::StoreSetRecord", @@ -1186,6 +1278,16 @@ "type": "dojo::world::world_contract::world::ModelUpgraded", "kind": "nested" }, + { + "name": "EventRegistered", + "type": "dojo::world::world_contract::world::EventRegistered", + "kind": "nested" + }, + { + "name": "EventUpgraded", + "type": "dojo::world::world_contract::world::EventUpgraded", + "kind": "nested" + }, { "name": "StoreSetRecord", "type": "dojo::world::world_contract::world::StoreSetRecord", diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/events/dojo_examples-ContractInitialized-376b7bd6.json similarity index 67% rename from examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/events/dojo_examples-ContractInitialized-376b7bd6.json index 4641430128..a26aff02f8 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/events/dojo_examples-ContractInitialized-376b7bd6.json @@ -1,8 +1,8 @@ [ { "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::model::IModel", + "name": "dojo::event::event::IEvent", "items": [ { "type": "function", @@ -317,7 +317,7 @@ }, { "type": "function", - "name": "unpacked_size", + "name": "packed_size", "inputs": [], "outputs": [ { @@ -328,7 +328,7 @@ }, { "type": "function", - "name": "packed_size", + "name": "unpacked_size", "inputs": [], "outputs": [ { @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,50 +354,9 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" - }, - { - "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" + "type": "dojo::meta::introspect::Ty" } ], - "outputs": [], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/events/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/deployment/abis/events/dojo_examples-Moved-318ae40d.json new file mode 100644 index 0000000000..fe176714ed --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/events/dojo_examples-Moved-318ae40d.json @@ -0,0 +1,370 @@ +[ + { + "type": "impl", + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::meta::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::meta::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::meta::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::meta::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::meta::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::meta::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::event::event::IEvent", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::meta::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::meta::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json index 5e416425e2..823381daf3 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json index 79677cca37..1c98b017ca 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json deleted file mode 100644 index bfae2f690c..0000000000 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json +++ /dev/null @@ -1,433 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::layout::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::model::layout::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::model::layout::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::model::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::model::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::model::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::model::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::model::IModel", - "items": [ - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "namespace", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "tag", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "namespace_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::model::layout::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::actions::actions::Moved", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::actions::actions::Moved" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json index d1fba9822d..2b90c40607 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json index 6b373d240f..212daac03a 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json index 203c340d15..51fa7d5267 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json index 58aa520a88..93e601d22f 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json index aab11e5888..9d2662e4e8 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json index 55eaa66dde..546dbce9ec 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json index 4c9924c29e..a556748bfb 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e", - "original_class_hash": "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e", + "class_hash": "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57", + "original_class_hash": "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57", "abi": [ { "type": "impl", @@ -81,7 +81,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -89,33 +89,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -123,15 +123,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -139,7 +139,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -151,6 +151,10 @@ "name": "Model", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" }, + { + "name": "Event", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, { "name": "Contract", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" @@ -251,6 +255,30 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -348,7 +376,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [ @@ -376,7 +404,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -396,7 +424,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -934,6 +962,70 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world_contract::world::StoreSetRecord", @@ -1191,6 +1283,16 @@ "type": "dojo::world::world_contract::world::ModelUpgraded", "kind": "nested" }, + { + "name": "EventRegistered", + "type": "dojo::world::world_contract::world::EventRegistered", + "kind": "nested" + }, + { + "name": "EventUpgraded", + "type": "dojo::world::world_contract::world::EventUpgraded", + "kind": "nested" + }, { "name": "StoreSetRecord", "type": "dojo::world::world_contract::world::StoreSetRecord", @@ -1234,8 +1336,8 @@ ] } ], - "address": "0x5fedbace16902d9ca4cdc1522f9fe156cd8c69a5d25e1436ee4b7b9933ad997", - "transaction_hash": "0x506e4efa5fa9ce5808a482b7076db8ca707a013bafaebf089206f28cd5f6bb6", + "address": "0x5e0bb8882b597a0e5da4e07d91e4c9a13d290d417c8c38ef7ce47be49932976", + "transaction_hash": "0x23a1f8de4182e76456030bae0b882e3deb66905d9b8dd72b29ba5f7e961b4dc", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -1255,9 +1357,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x3287947f8080cdf20c0a6e88d50a8d824e04f035bd34550316e6768d87d35de", - "class_hash": "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d", - "original_class_hash": "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d", + "address": "0x1f85a0310ca89910dc7bab4e4730470917f93b1b0aa168b0300d1e10cc21c2b", + "class_hash": "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394", + "original_class_hash": "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -1686,7 +1788,7 @@ }, { "kind": "DojoContract", - "address": "0x6ee438f6082f930c1b874cfefa2e380b1bd8eb8d77374bf18e8224c5dd1819", + "address": "0x6046355c623e0321d351905244b313c8f15b87e001d5b99b0bbed93cccd749f", "class_hash": "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d", "original_class_hash": "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", @@ -1925,9 +2027,9 @@ }, { "kind": "DojoContract", - "address": "0xd9e080358f8bcb8ca52182623e63b4777dbf54dedd3742bd86fabb3d1991ba", - "class_hash": "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393", - "original_class_hash": "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393", + "address": "0x55d27531dd3c6f2cf0d44f464281fc09c52a6cbb9fedd585f9b124784da16bd", + "class_hash": "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7", + "original_class_hash": "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -2146,7 +2248,7 @@ }, { "kind": "DojoContract", - "address": "0x3fec924b42052f14a9c4bb48abae2068d66034e3cc6e063353b87a5659f5040", + "address": "0xc2de4d6fef04f17db683201abfbd8d56b74dfc6feffec18e172a0ad94de946", "class_hash": "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87", "original_class_hash": "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", @@ -2386,23 +2488,28 @@ "kind": "DojoModel", "members": [ { - "name": "contract_address", + "name": "identity", "type": "ContractAddress", "key": true }, { - "name": "contract_class", - "type": "ClassHash", - "key": false + "name": "channel", + "type": "felt252", + "key": true }, { - "name": "value", - "type": "u8", + "name": "message", + "type": "ByteArray", "key": false + }, + { + "name": "salt", + "type": "felt252", + "key": true } ], - "class_hash": "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08", - "original_class_hash": "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08", + "class_hash": "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694", + "original_class_hash": "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694", "abi": [ { "type": "impl", @@ -2453,7 +2560,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -2461,33 +2568,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -2495,15 +2602,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -2511,7 +2618,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -2527,7 +2634,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -2539,23 +2646,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -2567,23 +2674,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -2595,23 +2702,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -2619,19 +2726,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -2748,7 +2855,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -2759,7 +2866,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -2768,30 +2875,34 @@ }, { "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" }, { "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", + "name": "dojo_examples::models::Message", "members": [ { - "name": "contract_address", + "name": "identity", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" + "name": "channel", + "type": "core::felt252" }, { - "name": "value", - "type": "core::integer::u8" + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", + "name": "dojo_examples::models::Imessage", "items": [ { "type": "function", @@ -2799,7 +2910,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" + "type": "dojo_examples::models::Message" } ], "outputs": [], @@ -2809,41 +2920,31 @@ }, { "type": "event", - "name": "dojo_examples::others::others::contract_initialized::Event", + "name": "dojo_examples::models::message::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-ContractInitialized", - "qualified_path": "dojo_examples::others::others::contract_initialized", - "manifest_name": "dojo_examples-ContractInitialized-376b7bd6" + "tag": "dojo_examples-Message", + "qualified_path": "dojo_examples::models::message", + "manifest_name": "dojo_examples-Message-1bb1d226" }, { "kind": "DojoModel", "members": [ { - "name": "identity", + "name": "account", "type": "ContractAddress", "key": true }, { - "name": "channel", - "type": "felt252", - "key": true - }, - { - "name": "message", - "type": "ByteArray", + "name": "amount", + "type": "u128", "key": false - }, - { - "name": "salt", - "type": "felt252", - "key": true } ], - "class_hash": "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b", - "original_class_hash": "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b", + "class_hash": "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8", + "original_class_hash": "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8", "abi": [ { "type": "impl", @@ -2894,7 +2995,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -2902,33 +3003,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -2936,15 +3037,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -2952,7 +3053,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -2968,7 +3069,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -2980,23 +3081,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -3008,23 +3109,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -3036,23 +3137,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -3060,19 +3161,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3189,7 +3290,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -3200,7 +3301,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -3209,34 +3310,26 @@ }, { "type": "impl", - "name": "messageImpl", - "interface_name": "dojo_examples::models::Imessage" + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" }, { "type": "struct", - "name": "dojo_examples::models::Message", + "name": "dojo_examples::models::MockToken", "members": [ { - "name": "identity", + "name": "account", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "channel", - "type": "core::felt252" - }, - { - "name": "message", - "type": "core::byte_array::ByteArray" - }, - { - "name": "salt", - "type": "core::felt252" + "name": "amount", + "type": "core::integer::u128" } ] }, { "type": "interface", - "name": "dojo_examples::models::Imessage", + "name": "dojo_examples::models::Imock_token", "items": [ { "type": "function", @@ -3244,7 +3337,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Message" + "type": "dojo_examples::models::MockToken" } ], "outputs": [], @@ -3254,31 +3347,36 @@ }, { "type": "event", - "name": "dojo_examples::models::message::Event", + "name": "dojo_examples::models::mock_token::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-Message", - "qualified_path": "dojo_examples::models::message", - "manifest_name": "dojo_examples-Message-1bb1d226" + "tag": "dojo_examples-MockToken", + "qualified_path": "dojo_examples::models::mock_token", + "manifest_name": "dojo_examples-MockToken-38903c7c" }, { "kind": "DojoModel", "members": [ { - "name": "account", + "name": "player", "type": "ContractAddress", "key": true }, { - "name": "amount", - "type": "u128", + "name": "remaining", + "type": "u8", + "key": false + }, + { + "name": "last_direction", + "type": "Direction", "key": false } ], - "class_hash": "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd", - "original_class_hash": "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd", + "class_hash": "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e", + "original_class_hash": "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e", "abi": [ { "type": "impl", @@ -3329,7 +3427,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -3337,33 +3435,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -3371,15 +3469,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3387,7 +3485,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -3403,7 +3501,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -3415,23 +3513,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -3443,23 +3541,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -3471,23 +3569,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -3495,19 +3593,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3624,7 +3722,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -3635,7 +3733,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -3644,26 +3742,56 @@ }, { "type": "impl", - "name": "mock_tokenImpl", - "interface_name": "dojo_examples::models::Imock_token" + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] }, { "type": "struct", - "name": "dojo_examples::models::MockToken", + "name": "dojo_examples::models::Moves", "members": [ { - "name": "account", + "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "amount", - "type": "core::integer::u128" + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" } ] }, { "type": "interface", - "name": "dojo_examples::models::Imock_token", + "name": "dojo_examples::models::Imoves", "items": [ { "type": "function", @@ -3671,7 +3799,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::MockToken" + "type": "dojo_examples::models::Moves" } ], "outputs": [], @@ -3681,14 +3809,14 @@ }, { "type": "event", - "name": "dojo_examples::models::mock_token::Event", + "name": "dojo_examples::models::moves::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-MockToken", - "qualified_path": "dojo_examples::models::mock_token", - "manifest_name": "dojo_examples-MockToken-38903c7c" + "tag": "dojo_examples-Moves", + "qualified_path": "dojo_examples::models::moves", + "manifest_name": "dojo_examples-Moves-2e2accba" }, { "kind": "DojoModel", @@ -3699,16 +3827,26 @@ "key": true }, { - "name": "direction", - "type": "Direction", + "name": "name", + "type": "ByteArray", "key": false - } - ], - "class_hash": "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2", - "original_class_hash": "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2", - "abi": [ + }, { - "type": "impl", + "name": "items", + "type": "Array", + "key": false + }, + { + "name": "favorite_item", + "type": "Option", + "key": false + } + ], + "class_hash": "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c", + "original_class_hash": "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c", + "abi": [ + { + "type": "impl", "name": "DojoModelImpl", "interface_name": "dojo::model::model::IModel" }, @@ -3756,7 +3894,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -3764,33 +3902,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -3798,15 +3936,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -3814,7 +3952,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -3830,7 +3968,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -3842,23 +3980,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -3870,23 +4008,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -3898,23 +4036,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -3922,19 +4060,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4051,7 +4189,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -4062,7 +4200,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -4071,52 +4209,52 @@ }, { "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" }, { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ { - "name": "Right", - "type": "()" + "name": "item_id", + "type": "core::integer::u32" }, { - "name": "Up", - "type": "()" + "name": "quantity", + "type": "core::integer::u32" }, { - "name": "Down", - "type": "()" + "name": "score", + "type": "core::integer::i32" } ] }, { "type": "struct", - "name": "dojo_examples::actions::actions::Moved", + "name": "dojo_examples::models::PlayerConfig", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "direction", - "type": "dojo_examples::models::Direction" + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" } ] }, { "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", + "name": "dojo_examples::models::Iplayer_config", "items": [ { "type": "function", @@ -4124,7 +4262,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::actions::actions::Moved" + "type": "dojo_examples::models::PlayerConfig" } ], "outputs": [], @@ -4134,14 +4272,14 @@ }, { "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", + "name": "dojo_examples::models::player_config::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-Moved", - "qualified_path": "dojo_examples::actions::actions::moved", - "manifest_name": "dojo_examples-Moved-318ae40d" + "tag": "dojo_examples-PlayerConfig", + "qualified_path": "dojo_examples::models::player_config", + "manifest_name": "dojo_examples-PlayerConfig-3adad785" }, { "kind": "DojoModel", @@ -4152,18 +4290,13 @@ "key": true }, { - "name": "remaining", - "type": "u8", - "key": false - }, - { - "name": "last_direction", - "type": "Direction", + "name": "vec", + "type": "Vec2", "key": false } ], - "class_hash": "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44", - "original_class_hash": "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44", + "class_hash": "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d", + "original_class_hash": "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d", "abi": [ { "type": "impl", @@ -4214,7 +4347,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -4222,33 +4355,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -4256,15 +4389,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4272,7 +4405,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -4288,7 +4421,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -4300,23 +4433,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -4328,23 +4461,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -4356,23 +4489,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -4380,19 +4513,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4509,7 +4642,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -4520,7 +4653,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -4529,56 +4662,40 @@ }, { "type": "impl", - "name": "movesImpl", - "interface_name": "dojo_examples::models::Imoves" + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" }, { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ { - "name": "Up", - "type": "()" + "name": "x", + "type": "core::integer::u32" }, { - "name": "Down", - "type": "()" + "name": "y", + "type": "core::integer::u32" } ] }, { "type": "struct", - "name": "dojo_examples::models::Moves", + "name": "dojo_examples::models::Position", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "remaining", - "type": "core::integer::u8" - }, - { - "name": "last_direction", - "type": "dojo_examples::models::Direction" + "name": "vec", + "type": "dojo_examples::models::Vec2" } ] }, { "type": "interface", - "name": "dojo_examples::models::Imoves", + "name": "dojo_examples::models::Iposition", "items": [ { "type": "function", @@ -4586,7 +4703,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Moves" + "type": "dojo_examples::models::Position" } ], "outputs": [], @@ -4596,14 +4713,14 @@ }, { "type": "event", - "name": "dojo_examples::models::moves::Event", + "name": "dojo_examples::models::position::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-Moves", - "qualified_path": "dojo_examples::models::moves", - "manifest_name": "dojo_examples-Moves-2e2accba" + "tag": "dojo_examples-Position", + "qualified_path": "dojo_examples::models::position", + "manifest_name": "dojo_examples-Position-1e145e26" }, { "kind": "DojoModel", @@ -4614,23 +4731,18 @@ "key": true }, { - "name": "name", - "type": "ByteArray", - "key": false - }, - { - "name": "items", - "type": "Array", - "key": false + "name": "server_id", + "type": "u32", + "key": true }, { - "name": "favorite_item", - "type": "Option", + "name": "name", + "type": "ByteArray", "key": false } ], - "class_hash": "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf", - "original_class_hash": "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf", + "class_hash": "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea", + "original_class_hash": "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea", "abi": [ { "type": "impl", @@ -4681,7 +4793,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -4689,33 +4801,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -4723,15 +4835,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4739,7 +4851,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -4755,7 +4867,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -4767,23 +4879,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -4795,23 +4907,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -4823,23 +4935,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -4847,19 +4959,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -4976,7 +5088,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -4987,7 +5099,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -4996,52 +5108,30 @@ }, { "type": "impl", - "name": "player_configImpl", - "interface_name": "dojo_examples::models::Iplayer_config" + "name": "server_profileImpl", + "interface_name": "dojo_examples::models::Iserver_profile" }, { "type": "struct", - "name": "dojo_examples::models::PlayerItem", + "name": "dojo_examples::models::ServerProfile", "members": [ { - "name": "item_id", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "quantity", + "name": "server_id", "type": "core::integer::u32" }, - { - "name": "score", - "type": "core::integer::i32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::PlayerConfig", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, { "name": "name", "type": "core::byte_array::ByteArray" - }, - { - "name": "items", - "type": "core::array::Array::" - }, - { - "name": "favorite_item", - "type": "core::option::Option::" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iplayer_config", + "name": "dojo_examples::models::Iserver_profile", "items": [ { "type": "function", @@ -5049,7 +5139,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::PlayerConfig" + "type": "dojo_examples::models::ServerProfile" } ], "outputs": [], @@ -5059,31 +5149,41 @@ }, { "type": "event", - "name": "dojo_examples::models::player_config::Event", + "name": "dojo_examples::models::server_profile::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-PlayerConfig", - "qualified_path": "dojo_examples::models::player_config", - "manifest_name": "dojo_examples-PlayerConfig-3adad785" + "tag": "dojo_examples-ServerProfile", + "qualified_path": "dojo_examples::models::server_profile", + "manifest_name": "dojo_examples-ServerProfile-4caad1e6" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "id", + "type": "u32", "key": true }, { - "name": "vec", - "type": "Vec2", + "name": "health", + "type": "u32", + "key": false + }, + { + "name": "armor", + "type": "u32", + "key": false + }, + { + "name": "attack", + "type": "u32", "key": false } ], - "class_hash": "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea", - "original_class_hash": "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea", + "class_hash": "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556", + "original_class_hash": "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556", "abi": [ { "type": "impl", @@ -5134,7 +5234,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -5142,33 +5242,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -5176,15 +5276,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5192,7 +5292,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -5208,7 +5308,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -5220,23 +5320,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -5248,23 +5348,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -5276,23 +5376,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -5300,19 +5400,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5429,7 +5529,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -5440,7 +5540,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -5449,40 +5549,34 @@ }, { "type": "impl", - "name": "positionImpl", - "interface_name": "dojo_examples::models::Iposition" + "name": "river_skaleImpl", + "interface_name": "bestiary::Iriver_skale" }, { "type": "struct", - "name": "dojo_examples::models::Vec2", + "name": "bestiary::RiverSkale", "members": [ { - "name": "x", + "name": "id", "type": "core::integer::u32" }, { - "name": "y", + "name": "health", "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Position", - "members": [ + }, { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "armor", + "type": "core::integer::u32" }, { - "name": "vec", - "type": "dojo_examples::models::Vec2" + "name": "attack", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iposition", + "name": "bestiary::Iriver_skale", "items": [ { "type": "function", @@ -5490,7 +5584,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Position" + "type": "bestiary::RiverSkale" } ], "outputs": [], @@ -5500,36 +5594,36 @@ }, { "type": "event", - "name": "dojo_examples::models::position::Event", + "name": "bestiary::river_skale::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-Position", - "qualified_path": "dojo_examples::models::position", - "manifest_name": "dojo_examples-Position-1e145e26" + "tag": "dojo_examples_foes-RiverSkale", + "qualified_path": "bestiary::river_skale", + "manifest_name": "dojo_examples_foes-RiverSkale-39535c12" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "id", + "type": "u32", "key": true }, { - "name": "server_id", + "name": "atk_speek", "type": "u32", - "key": true + "key": false }, { - "name": "name", - "type": "ByteArray", + "name": "range", + "type": "u32", "key": false } ], - "class_hash": "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b", - "original_class_hash": "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b", + "class_hash": "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff", + "original_class_hash": "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff", "abi": [ { "type": "impl", @@ -5580,7 +5674,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -5588,33 +5682,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -5622,15 +5716,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5638,7 +5732,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -5654,7 +5748,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -5666,23 +5760,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -5694,23 +5788,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -5722,23 +5816,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -5746,19 +5840,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -5875,7 +5969,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -5886,7 +5980,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" @@ -5895,30 +5989,30 @@ }, { "type": "impl", - "name": "server_profileImpl", - "interface_name": "dojo_examples::models::Iserver_profile" + "name": "flatbowImpl", + "interface_name": "armory::Iflatbow" }, { "type": "struct", - "name": "dojo_examples::models::ServerProfile", + "name": "armory::Flatbow", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "id", + "type": "core::integer::u32" }, { - "name": "server_id", + "name": "atk_speek", "type": "core::integer::u32" }, { - "name": "name", - "type": "core::byte_array::ByteArray" + "name": "range", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iserver_profile", + "name": "armory::Iflatbow", "items": [ { "type": "function", @@ -5926,7 +6020,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::ServerProfile" + "type": "armory::Flatbow" } ], "outputs": [], @@ -5936,46 +6030,43 @@ }, { "type": "event", - "name": "dojo_examples::models::server_profile::Event", + "name": "armory::flatbow::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples-ServerProfile", - "qualified_path": "dojo_examples::models::server_profile", - "manifest_name": "dojo_examples-ServerProfile-4caad1e6" - }, + "tag": "dojo_examples_weapons-Flatbow", + "qualified_path": "armory::flatbow", + "manifest_name": "dojo_examples_weapons-Flatbow-22f5bd16" + } + ], + "events": [ { - "kind": "DojoModel", + "kind": "DojoEvent", "members": [ { - "name": "id", - "type": "u32", + "name": "contract_address", + "type": "ContractAddress", "key": true }, { - "name": "health", - "type": "u32", - "key": false - }, - { - "name": "armor", - "type": "u32", + "name": "contract_class", + "type": "ClassHash", "key": false }, { - "name": "attack", - "type": "u32", + "name": "value", + "type": "u8", "key": false } ], - "class_hash": "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7", - "original_class_hash": "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7", + "class_hash": "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479", + "original_class_hash": "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479", "abi": [ { "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" }, { "type": "struct", @@ -6021,7 +6112,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -6029,33 +6120,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -6063,15 +6154,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6079,7 +6170,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -6095,7 +6186,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -6107,23 +6198,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -6135,23 +6226,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -6163,23 +6254,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -6187,19 +6278,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6209,7 +6300,7 @@ }, { "type": "interface", - "name": "dojo::model::model::IModel", + "name": "dojo::event::event::IEvent", "items": [ { "type": "function", @@ -6290,7 +6381,7 @@ }, { "type": "function", - "name": "unpacked_size", + "name": "packed_size", "inputs": [], "outputs": [ { @@ -6301,7 +6392,7 @@ }, { "type": "function", - "name": "packed_size", + "name": "unpacked_size", "inputs": [], "outputs": [ { @@ -6316,7 +6407,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -6327,95 +6418,45 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "river_skaleImpl", - "interface_name": "bestiary::Iriver_skale" - }, - { - "type": "struct", - "name": "bestiary::RiverSkale", - "members": [ - { - "name": "id", - "type": "core::integer::u32" - }, - { - "name": "health", - "type": "core::integer::u32" - }, - { - "name": "armor", - "type": "core::integer::u32" - }, - { - "name": "attack", - "type": "core::integer::u32" - } - ] - }, - { - "type": "interface", - "name": "bestiary::Iriver_skale", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "bestiary::RiverSkale" + "type": "dojo::meta::introspect::Ty" } ], - "outputs": [], "state_mutability": "view" } ] }, { "type": "event", - "name": "bestiary::river_skale::Event", + "name": "dojo_examples::others::others::contract_initialized::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples_foes-RiverSkale", - "qualified_path": "bestiary::river_skale", - "manifest_name": "dojo_examples_foes-RiverSkale-39535c12" + "tag": "dojo_examples-ContractInitialized", + "qualified_path": "dojo_examples::others::others::contract_initialized", + "manifest_name": "dojo_examples-ContractInitialized-376b7bd6" }, { - "kind": "DojoModel", + "kind": "DojoEvent", "members": [ { - "name": "id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "atk_speek", - "type": "u32", - "key": false - }, - { - "name": "range", - "type": "u32", + "name": "direction", + "type": "Direction", "key": false } ], - "class_hash": "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad", - "original_class_hash": "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad", + "class_hash": "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07", + "original_class_hash": "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07", "abi": [ { "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" }, { "type": "struct", @@ -6461,7 +6502,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -6469,33 +6510,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -6503,15 +6544,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6519,7 +6560,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -6535,7 +6576,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -6547,23 +6588,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -6575,23 +6616,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -6603,23 +6644,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -6627,19 +6668,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -6649,7 +6690,7 @@ }, { "type": "interface", - "name": "dojo::model::model::IModel", + "name": "dojo::event::event::IEvent", "items": [ { "type": "function", @@ -6730,7 +6771,7 @@ }, { "type": "function", - "name": "unpacked_size", + "name": "packed_size", "inputs": [], "outputs": [ { @@ -6741,7 +6782,7 @@ }, { "type": "function", - "name": "packed_size", + "name": "unpacked_size", "inputs": [], "outputs": [ { @@ -6756,7 +6797,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -6767,64 +6808,23 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "flatbowImpl", - "interface_name": "armory::Iflatbow" - }, - { - "type": "struct", - "name": "armory::Flatbow", - "members": [ - { - "name": "id", - "type": "core::integer::u32" - }, - { - "name": "atk_speek", - "type": "core::integer::u32" - }, - { - "name": "range", - "type": "core::integer::u32" - } - ] - }, - { - "type": "interface", - "name": "armory::Iflatbow", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "armory::Flatbow" + "type": "dojo::meta::introspect::Ty" } ], - "outputs": [], "state_mutability": "view" } ] }, { "type": "event", - "name": "armory::flatbow::Event", + "name": "dojo_examples::actions::actions::moved::Event", "kind": "enum", "variants": [] } ], - "tag": "dojo_examples_weapons-Flatbow", - "qualified_path": "armory::flatbow", - "manifest_name": "dojo_examples_weapons-Flatbow-22f5bd16" + "tag": "dojo_examples-Moved", + "qualified_path": "dojo_examples::actions::actions::moved", + "manifest_name": "dojo_examples-Moved-318ae40d" } ] } \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml index 6c521b609f..ad84c682fc 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" -original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" +original_class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x5fedbace16902d9ca4cdc1522f9fe156cd8c69a5d25e1436ee4b7b9933ad997" -transaction_hash = "0x506e4efa5fa9ce5808a482b7076db8ca707a013bafaebf089206f28cd5f6bb6" +address = "0x5e0bb8882b597a0e5da4e07d91e4c9a13d290d417c8c38ef7ce47be49932976" +transaction_hash = "0x23a1f8de4182e76456030bae0b882e3deb66905d9b8dd72b29ba5f7e961b4dc" block_number = 3 seed = "dojo_examples" manifest_name = "dojo-world" @@ -23,9 +23,9 @@ manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x3287947f8080cdf20c0a6e88d50a8d824e04f035bd34550316e6768d87d35de" -class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" -original_class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" +address = "0x1f85a0310ca89910dc7bab4e4730470917f93b1b0aa168b0300d1e10cc21c2b" +class_hash = "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394" +original_class_hash = "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] @@ -47,7 +47,7 @@ manifest_name = "dojo_examples-actions-40b6994c" [[contracts]] kind = "DojoContract" -address = "0x6ee438f6082f930c1b874cfefa2e380b1bd8eb8d77374bf18e8224c5dd1819" +address = "0x6046355c623e0321d351905244b313c8f15b87e001d5b99b0bbed93cccd749f" class_hash = "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d" original_class_hash = "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" @@ -61,9 +61,9 @@ manifest_name = "dojo_examples-dungeon-6620e0e6" [[contracts]] kind = "DojoContract" -address = "0xd9e080358f8bcb8ca52182623e63b4777dbf54dedd3742bd86fabb3d1991ba" -class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" -original_class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" +address = "0x55d27531dd3c6f2cf0d44f464281fc09c52a6cbb9fedd585f9b124784da16bd" +class_hash = "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7" +original_class_hash = "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] @@ -75,7 +75,7 @@ manifest_name = "dojo_examples-mock_token-31599eb2" [[contracts]] kind = "DojoContract" -address = "0x3fec924b42052f14a9c4bb48abae2068d66034e3cc6e063353b87a5659f5040" +address = "0xc2de4d6fef04f17db683201abfbd8d56b74dfc6feffec18e172a0ad94de946" class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" original_class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" @@ -93,32 +93,8 @@ manifest_name = "dojo_examples-others-61de2c18" [[models]] kind = "DojoModel" -class_hash = "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08" -original_class_hash = "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08" -abi = "manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" -tag = "dojo_examples-ContractInitialized" -qualified_path = "dojo_examples::others::others::contract_initialized" -manifest_name = "dojo_examples-ContractInitialized-376b7bd6" - -[[models.members]] -name = "contract_address" -type = "ContractAddress" -key = true - -[[models.members]] -name = "contract_class" -type = "ClassHash" -key = false - -[[models.members]] -name = "value" -type = "u8" -key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" -original_class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" +class_hash = "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694" +original_class_hash = "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694" abi = "manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" qualified_path = "dojo_examples::models::message" @@ -146,8 +122,8 @@ key = true [[models]] kind = "DojoModel" -class_hash = "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd" -original_class_hash = "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd" +class_hash = "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8" +original_class_hash = "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8" abi = "manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" qualified_path = "dojo_examples::models::mock_token" @@ -165,27 +141,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" -original_class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" -abi = "manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json" -tag = "dojo_examples-Moved" -qualified_path = "dojo_examples::actions::actions::moved" -manifest_name = "dojo_examples-Moved-318ae40d" - -[[models.members]] -name = "player" -type = "ContractAddress" -key = true - -[[models.members]] -name = "direction" -type = "Direction" -key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44" -original_class_hash = "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44" +class_hash = "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e" +original_class_hash = "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" qualified_path = "dojo_examples::models::moves" @@ -208,8 +165,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf" -original_class_hash = "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf" +class_hash = "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c" +original_class_hash = "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c" abi = "manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" qualified_path = "dojo_examples::models::player_config" @@ -237,8 +194,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" -original_class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" +class_hash = "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d" +original_class_hash = "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d" abi = "manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" qualified_path = "dojo_examples::models::position" @@ -256,8 +213,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" -original_class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" +class_hash = "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea" +original_class_hash = "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea" abi = "manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" qualified_path = "dojo_examples::models::server_profile" @@ -280,8 +237,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7" -original_class_hash = "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7" +class_hash = "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556" +original_class_hash = "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556" abi = "manifests/dev/deployment/abis/models/dojo_examples_foes-RiverSkale-39535c12.json" tag = "dojo_examples_foes-RiverSkale" qualified_path = "bestiary::river_skale" @@ -309,8 +266,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad" -original_class_hash = "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad" +class_hash = "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff" +original_class_hash = "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff" abi = "manifests/dev/deployment/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json" tag = "dojo_examples_weapons-Flatbow" qualified_path = "armory::flatbow" @@ -330,3 +287,46 @@ key = false name = "range" type = "u32" key = false + +[[events]] +kind = "DojoEvent" +class_hash = "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479" +original_class_hash = "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479" +abi = "manifests/dev/deployment/abis/events/dojo_examples-ContractInitialized-376b7bd6.json" +tag = "dojo_examples-ContractInitialized" +qualified_path = "dojo_examples::others::others::contract_initialized" +manifest_name = "dojo_examples-ContractInitialized-376b7bd6" + +[[events.members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[events.members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[events.members]] +name = "value" +type = "u8" +key = false + +[[events]] +kind = "DojoEvent" +class_hash = "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07" +original_class_hash = "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07" +abi = "manifests/dev/deployment/abis/events/dojo_examples-Moved-318ae40d.json" +tag = "dojo_examples-Moved" +qualified_path = "dojo_examples::actions::actions::moved" +manifest_name = "dojo_examples-Moved-318ae40d" + +[[events.members]] +name = "player" +type = "ContractAddress" +key = true + +[[events.members]] +name = "direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json b/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json index 8553809311..f04bdb08c4 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json +++ b/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json @@ -76,7 +76,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -84,33 +84,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -118,15 +118,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -134,7 +134,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -146,6 +146,10 @@ "name": "Model", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" }, + { + "name": "Event", + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + }, { "name": "Contract", "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" @@ -246,6 +250,30 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_event", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -343,7 +371,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [ @@ -371,7 +399,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -391,7 +419,7 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "outputs": [], @@ -929,6 +957,70 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world_contract::world::EventUpgraded", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world_contract::world::StoreSetRecord", @@ -1186,6 +1278,16 @@ "type": "dojo::world::world_contract::world::ModelUpgraded", "kind": "nested" }, + { + "name": "EventRegistered", + "type": "dojo::world::world_contract::world::EventRegistered", + "kind": "nested" + }, + { + "name": "EventUpgraded", + "type": "dojo::world::world_contract::world::EventUpgraded", + "kind": "nested" + }, { "name": "StoreSetRecord", "type": "dojo::world::world_contract::world::StoreSetRecord", diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/release/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json similarity index 67% rename from examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/release/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json index 4641430128..a26aff02f8 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json +++ b/examples/spawn-and-move/manifests/release/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json @@ -1,8 +1,8 @@ [ { "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" }, { "type": "struct", @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -236,7 +236,7 @@ }, { "type": "interface", - "name": "dojo::model::model::IModel", + "name": "dojo::event::event::IEvent", "items": [ { "type": "function", @@ -317,7 +317,7 @@ }, { "type": "function", - "name": "unpacked_size", + "name": "packed_size", "inputs": [], "outputs": [ { @@ -328,7 +328,7 @@ }, { "type": "function", - "name": "packed_size", + "name": "unpacked_size", "inputs": [], "outputs": [ { @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,50 +354,9 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" - }, - { - "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" + "type": "dojo::meta::introspect::Ty" } ], - "outputs": [], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/release/base/abis/events/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/release/base/abis/events/dojo_examples-Moved-318ae40d.json new file mode 100644 index 0000000000..fe176714ed --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/abis/events/dojo_examples-Moved-318ae40d.json @@ -0,0 +1,370 @@ +[ + { + "type": "impl", + "name": "DojoEventImpl", + "interface_name": "dojo::event::event::IEvent" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::meta::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::meta::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::meta::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::meta::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::meta::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::meta::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::meta::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::event::event::IEvent", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::meta::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::meta::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json index 5e416425e2..823381daf3 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json index 79677cca37..1c98b017ca 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json deleted file mode 100644 index bfae2f690c..0000000000 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json +++ /dev/null @@ -1,433 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::layout::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::model::layout::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::model::layout::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::model::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::model::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::model::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::model::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::model::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::model::IModel", - "items": [ - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "namespace", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "tag", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "namespace_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::model::layout::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::model::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::actions::actions::Moved", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::actions::actions::Moved" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json index d1fba9822d..2b90c40607 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json index 6b373d240f..212daac03a 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json index 203c340d15..51fa7d5267 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json index 58aa520a88..93e601d22f 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json index aab11e5888..9d2662e4e8 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json index 55eaa66dde..546dbce9ec 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json @@ -48,7 +48,7 @@ }, { "type": "struct", - "name": "dojo::model::layout::FieldLayout", + "name": "dojo::meta::layout::FieldLayout", "members": [ { "name": "selector", @@ -56,33 +56,33 @@ }, { "name": "layout", - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::layout::Layout", + "name": "dojo::meta::layout::Layout", "variants": [ { "name": "Fixed", @@ -90,15 +90,15 @@ }, { "name": "Struct", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -106,7 +106,7 @@ }, { "name": "Enum", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, @@ -122,7 +122,7 @@ }, { "type": "struct", - "name": "dojo::model::introspect::Member", + "name": "dojo::meta::introspect::Member", "members": [ { "name": "name", @@ -134,23 +134,23 @@ }, { "name": "ty", - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Struct", + "name": "dojo::meta::introspect::Struct", "members": [ { "name": "name", @@ -162,23 +162,23 @@ }, { "name": "children", - "type": "core::array::Span::" + "type": "core::array::Span::" } ] }, { "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "name": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>", "members": [ { "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "@core::array::Array::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "dojo::model::introspect::Enum", + "name": "dojo::meta::introspect::Enum", "members": [ { "name": "name", @@ -190,23 +190,23 @@ }, { "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + "type": "core::array::Span::<(core::felt252, dojo::meta::introspect::Ty)>" } ] }, { "type": "struct", - "name": "core::array::Span::", + "name": "core::array::Span::", "members": [ { "name": "snapshot", - "type": "@core::array::Array::" + "type": "@core::array::Array::" } ] }, { "type": "enum", - "name": "dojo::model::introspect::Ty", + "name": "dojo::meta::introspect::Ty", "variants": [ { "name": "Primitive", @@ -214,19 +214,19 @@ }, { "name": "Struct", - "type": "dojo::model::introspect::Struct" + "type": "dojo::meta::introspect::Struct" }, { "name": "Enum", - "type": "dojo::model::introspect::Enum" + "type": "dojo::meta::introspect::Enum" }, { "name": "Tuple", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "Array", - "type": "core::array::Span::" + "type": "core::array::Span::" }, { "name": "ByteArray", @@ -343,7 +343,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::layout::Layout" + "type": "dojo::meta::layout::Layout" } ], "state_mutability": "view" @@ -354,7 +354,7 @@ "inputs": [], "outputs": [ { - "type": "dojo::model::introspect::Ty" + "type": "dojo::meta::introspect::Ty" } ], "state_mutability": "view" 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 eaf518064d..2239b1363e 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 @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" -original_class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" +class_hash = "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394" +original_class_hash = "0x7a7c4d34805182e74e52282893955868334f16bf1aaf909ae822385ce414394" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] 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 a91d6e646d..feb0d5d102 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 @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" -original_class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" +class_hash = "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7" +original_class_hash = "0x2ba2e52f9e1ffb31d0d5aa362565d1563d485e51c99613ed708393f862dded7" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] 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 796442c34f..de65aeb434 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 = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" -original_class_hash = "0x6f4515274ee23404789c3351a77107d0ec07508530119822046600ca6948d6e" +class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" +original_class_hash = "0x4743bf5aabbbbb43f658bd540ae7a0a2bb7f7ccce057a6cbb74be1ca56e3f57" 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/events/dojo_examples-ContractInitialized-376b7bd6.toml similarity index 60% rename from examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml rename to examples/spawn-and-move/manifests/release/base/events/dojo_examples-ContractInitialized-376b7bd6.toml index 3f44583131..4ef3a444e8 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/release/base/events/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,7 +1,7 @@ -kind = "DojoModel" -class_hash = "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08" -original_class_hash = "0x720bb4a3a1324dea862ac8b3ac3e30ac55490ce6ec9f7f68341db081b290c08" -abi = "manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" +kind = "DojoEvent" +class_hash = "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479" +original_class_hash = "0x7506756821cb29289c668c8a95041701ce131d446d535727615a83ec142e479" +abi = "manifests/release/base/abis/events/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" qualified_path = "dojo_examples::others::others::contract_initialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/release/base/events/dojo_examples-Moved-318ae40d.toml similarity index 51% rename from examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml rename to examples/spawn-and-move/manifests/release/base/events/dojo_examples-Moved-318ae40d.toml index dd80b1bfb6..abfc7eef14 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/release/base/events/dojo_examples-Moved-318ae40d.toml @@ -1,7 +1,7 @@ -kind = "DojoModel" -class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" -original_class_hash = "0x71f21bb9f7454ede4f4fe1482012218ef57448ca9687018dab409c4ddb790a2" -abi = "manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json" +kind = "DojoEvent" +class_hash = "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07" +original_class_hash = "0x3c194bbb3650ffbb0cb6d5220e409a6c0d4f0517ed62356b1ec1fef2dd7dc07" +abi = "manifests/release/base/abis/events/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" qualified_path = "dojo_examples::actions::actions::moved" manifest_name = "dojo_examples-Moved-318ae40d" 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 7f88709381..90fc5cd341 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" -original_class_hash = "0x3ca17c0ebb595e1d1cc01813923864316a49b91f4a725ef1371329abbc1947b" +class_hash = "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694" +original_class_hash = "0x1e1a725cce4b13e388375668532e16b7409ba1e963865e579f990f97980d694" abi = "manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" qualified_path = "dojo_examples::models::message" 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 aff0ceb11c..2f7968e902 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd" -original_class_hash = "0x244a875f2049e4ca875b631270f1203a5be374fc040a8c4bd40405eeeea07bd" +class_hash = "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8" +original_class_hash = "0x2013ee678b46dcdf844900885168c42d9c4400cefda32b9a64ae0d753d690e8" abi = "manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" qualified_path = "dojo_examples::models::mock_token" 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 b199535b66..c9066a55a9 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44" -original_class_hash = "0x4dd1c573b5cdc56561be8b28a4840048a3a008d1a4a6eed397ec4135effaf44" +class_hash = "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e" +original_class_hash = "0x3f6ca7e8349d9ca3525132c2d45debaf5ee0c19500ef1e768eddb057ff9367e" abi = "manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" qualified_path = "dojo_examples::models::moves" 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 8265fde585..3a8957ecd3 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf" -original_class_hash = "0x515f106010313c2fcd87719836e75873aa75a711a4bdcd2ea0b6e38854deebf" +class_hash = "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c" +original_class_hash = "0x5209def1430490f46512b18d6bb7572ea69a20eceb48120f77bf97ba49fef6c" abi = "manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" qualified_path = "dojo_examples::models::player_config" 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 cbd25a32b4..ee8b772a84 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" -original_class_hash = "0x5af60d63e6a1d25fc117fde1fa7e1d628adc46a52c3d007541ed6dd369e8ea" +class_hash = "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d" +original_class_hash = "0x5a49137ae8fe4e431e9a0ce7d533d91c343d707354af753bcc85c430c521b2d" abi = "manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" qualified_path = "dojo_examples::models::position" 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 73192a2b7f..603d4b25e7 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,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" -original_class_hash = "0x2fa72f20995710bef20ac3c36e2f43ec210517a787927ea3407e2b29c21bb0b" +class_hash = "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea" +original_class_hash = "0x6f59d34ddb402433883696d4c630d9e0f06dc5d8223006e6e31a59885f5b6ea" abi = "manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" qualified_path = "dojo_examples::models::server_profile" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml index ff4e9f71b9..832c6cf08a 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_foes-RiverSkale-39535c12.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7" -original_class_hash = "0x4f3cbb247febb63bf5ab34d87504fd85e7a3b4ab6ff16fa2bf23597bf3309c7" +class_hash = "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556" +original_class_hash = "0x12ae9775063f92fb29f4c1ccae86a0333b8266aebb92f9301646ea2f3d2b556" abi = "manifests/release/base/abis/models/dojo_examples_foes-RiverSkale-39535c12.json" tag = "dojo_examples_foes-RiverSkale" qualified_path = "bestiary::river_skale" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml index 3db33ef70d..1f3d7ac778 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_weapons-Flatbow-22f5bd16.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad" -original_class_hash = "0x783cecd986c0f03f8ac70318f67d57ea8072db7d4d135d54585f4de33c879ad" +class_hash = "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff" +original_class_hash = "0x9313c3a600e69de99250ec044a5ceefe1c4766bc04e5df776691aa0ce7daff" abi = "manifests/release/base/abis/models/dojo_examples_weapons-Flatbow-22f5bd16.json" tag = "dojo_examples_weapons-Flatbow" qualified_path = "armory::flatbow" diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 70c6c5c16e..e0104314fb 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -35,9 +35,8 @@ pub mod actions { #[cfg(feature: 'dungeon')] use bestiary::RiverSkale; - #[derive(Copy, Drop, Serde)] + #[derive(IntrospectPacked, Copy, Drop, Serde)] #[dojo::event] - #[dojo::model] pub struct Moved { #[key] pub player: ContractAddress, diff --git a/examples/spawn-and-move/src/others.cairo b/examples/spawn-and-move/src/others.cairo index 8b9c1a9c67..81fa23a08c 100644 --- a/examples/spawn-and-move/src/others.cairo +++ b/examples/spawn-and-move/src/others.cairo @@ -4,9 +4,8 @@ pub mod others { use dojo_examples::models::{Position, Moves, Direction, Vec2}; use dojo_examples::utils::next_position; - #[derive(Copy, Drop, Serde)] + #[derive(IntrospectPacked, Copy, Drop, Serde)] #[dojo::event] - #[dojo::model] struct ContractInitialized { #[key] contract_address: ContractAddress, diff --git a/spawn-and-move-db.tar.gz b/spawn-and-move-db.tar.gz index ac6788ec41..be5af2a968 100644 Binary files a/spawn-and-move-db.tar.gz and b/spawn-and-move-db.tar.gz differ diff --git a/types-test-db.tar.gz b/types-test-db.tar.gz index b5a45bd0d7..b382c52224 100644 Binary files a/types-test-db.tar.gz and b/types-test-db.tar.gz differ