Skip to content

Commit

Permalink
fix(dojo): dont assign ownership to ResourceMetadata on world creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Feb 20, 2024
1 parent 716520e commit 7d5123b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 4 additions & 2 deletions crates/dojo-core/src/base_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ fn test_upgrade_from_world() {

#[test]
#[available_gas(6000000)]
#[should_panic(expected: ('class_hash not world provider', 'ENTRYPOINT_FAILED', 'ENTRYPOINT_FAILED'))]
#[should_panic(
expected: ('class_hash not world provider', 'ENTRYPOINT_FAILED', 'ENTRYPOINT_FAILED')
)]
fn test_upgrade_from_world_not_world_provider() {
let world = deploy_world();

Expand Down Expand Up @@ -105,7 +107,7 @@ mod invalid_model {
impl InvalidModelName of super::INameOnly<ContractState> {
fn name(self: @ContractState) -> felt252 {
// Pre-computed address of a contract deployed through the world.
0x34534b116332dd9459bfde65280822d84c130e3f1faeb63af8455f83e733f4f
0x742c3d09472a40914dedcbd609788fd547bde613d6c4d4c2f15d41f4e241f25
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions crates/dojo-core/src/test_utils.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ fn spawn_test_world(models: Array<felt252>) -> IWorldDispatcher {

let world = IWorldDispatcher { contract_address: world_address };

// Register the resource metadata.
world.register_model(resource_metadata::TEST_CLASS_HASH.try_into().unwrap());

// register models
let mut index = 0;
loop {
Expand Down
3 changes: 0 additions & 3 deletions crates/dojo-core/src/world.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ mod world {
let creator = starknet::get_tx_info().unbox().account_contract_address;
self.contract_base.write(contract_base);
self.owners.write((WORLD, creator), true);

// Ensure the creator of the world is the owner of the resource metadata model.
self.owners.write((RESOURCE_METADATA_MODEL, creator), true);
self.models.write(
RESOURCE_METADATA_MODEL,
(resource_metadata::initial_class_hash(), resource_metadata::initial_address())
Expand Down

0 comments on commit 7d5123b

Please sign in to comment.