Skip to content

Commit

Permalink
fix: avoid model classhash conflicts when some models have a same name (
Browse files Browse the repository at this point in the history
  • Loading branch information
remybar authored Sep 22, 2024
1 parent 0d08411 commit 892cd03
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 149 deletions.
14 changes: 7 additions & 7 deletions crates/dojo-lang/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,31 +712,31 @@ pub mod $contract_name$ {
#[abi(embed_v0)]
impl DojoModelImpl of dojo::model::IModel<ContractState>{
fn name(self: @ContractState) -> ByteArray {
dojo::model::Model::<$type_name$>::name()
\"$type_name$\"
}
fn namespace(self: @ContractState) -> ByteArray {
dojo::model::Model::<$type_name$>::namespace()
\"$model_namespace$\"
}
fn tag(self: @ContractState) -> ByteArray {
dojo::model::Model::<$type_name$>::tag()
\"$model_tag$\"
}
fn version(self: @ContractState) -> u8 {
dojo::model::Model::<$type_name$>::version()
$model_version$
}
fn selector(self: @ContractState) -> felt252 {
dojo::model::Model::<$type_name$>::selector()
$model_selector$
}
fn name_hash(self: @ContractState) -> felt252 {
dojo::model::Model::<$type_name$>::name_hash()
$model_name_hash$
}
fn namespace_hash(self: @ContractState) -> felt252 {
dojo::model::Model::<$type_name$>::namespace_hash()
$model_namespace_hash$
}
fn unpacked_size(self: @ContractState) -> Option<usize> {
Expand Down
Loading

0 comments on commit 892cd03

Please sign in to comment.