Skip to content

Commit

Permalink
refactor(world): registerSystem takes a System argument [n-08] (#2152)
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaa committed Jan 18, 2024
1 parent 0e0e964 commit 736ef73
Showing 3 changed files with 6 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/world/src/modules/core/CoreModule.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.21;

import { WorldContextProviderLib, WorldContextConsumer } from "../../WorldContext.sol";
import { System } from "../../System.sol";
import { WorldContextProviderLib } from "../../WorldContext.sol";
import { ROOT_NAMESPACE_ID, STORE_NAMESPACE_ID, WORLD_NAMESPACE_ID } from "../../constants.sol";
import { Module } from "../../Module.sol";

@@ -131,7 +132,7 @@ contract CoreModule is Module {
msgSender: _msgSender(),
msgValue: 0,
target: coreRegistrationSystem,
callData: abi.encodeCall(WorldRegistrationSystem.registerSystem, (systemId, WorldContextConsumer(target), true))
callData: abi.encodeCall(WorldRegistrationSystem.registerSystem, (systemId, System(target), true))
});
}

Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ contract WorldRegistrationSystem is System, IWorldErrors {
* @param system The system being registered
* @param publicAccess Flag indicating if access control check is bypassed
*/
function registerSystem(ResourceId systemId, WorldContextConsumer system, bool publicAccess) public virtual {
function registerSystem(ResourceId systemId, System system, bool publicAccess) public virtual {
// Require the provided system ID to have type RESOURCE_SYSTEM
if (systemId.getType() != RESOURCE_SYSTEM) {
revert World_InvalidResourceType(RESOURCE_SYSTEM, systemId, systemId.toString());

0 comments on commit 736ef73

Please sign in to comment.