diff --git a/.changeset/twelve-terms-lay.md b/.changeset/twelve-terms-lay.md new file mode 100644 index 0000000000..9846e51637 --- /dev/null +++ b/.changeset/twelve-terms-lay.md @@ -0,0 +1,6 @@ +--- +"@latticexyz/store": major +"@latticexyz/world": patch +--- + +Renamed `StoreCore`'s `registerCoreTables` method to `registerInternalTables`. diff --git a/docs/pages/store/reference/store-core.mdx b/docs/pages/store/reference/store-core.mdx index 421cbdc3dd..c717e5f2b0 100644 --- a/docs/pages/store/reference/store-core.mdx +++ b/docs/pages/store/reference/store-core.mdx @@ -21,15 +21,15 @@ StoreSwitch uses internal methods to write data instead of external calls._ function initialize() internal; ``` -### registerCoreTables +### registerInternalTables -Register core tables in the store. +Register Store protocol's internal tables in the store. _Consumers must call this function in their constructor before setting any table data to allow indexers to decode table events._ ```solidity -function registerCoreTables() internal; +function registerInternalTables() internal; ``` ### getFieldLayout diff --git a/packages/store/src/StoreCore.sol b/packages/store/src/StoreCore.sol index 177073f501..ab79c2ce9e 100644 --- a/packages/store/src/StoreCore.sol +++ b/packages/store/src/StoreCore.sol @@ -88,11 +88,11 @@ library StoreCore { } /** - * @notice Register core tables in the store. + * @notice Register Store protocol's internal tables in the store. * @dev Consumers must call this function in their constructor before setting * any table data to allow indexers to decode table events. */ - function registerCoreTables() internal { + function registerInternalTables() internal { // Because `registerTable` writes to both `Tables` and `ResourceIds`, we can't use it // directly here without creating a race condition, where we'd write to one or the other // before they exist (depending on the order of registration). diff --git a/packages/store/test/StoreMock.sol b/packages/store/test/StoreMock.sol index fc5ea9d611..78785f559b 100644 --- a/packages/store/test/StoreMock.sol +++ b/packages/store/test/StoreMock.sol @@ -18,7 +18,7 @@ import { ResourceId } from "../src/ResourceId.sol"; contract StoreMock is IStore, StoreData { constructor() { StoreCore.initialize(); - StoreCore.registerCoreTables(); + StoreCore.registerInternalTables(); StoreSwitch.setStoreAddress(address(this)); } diff --git a/packages/world/src/modules/core/CoreModule.sol b/packages/world/src/modules/core/CoreModule.sol index 8f4d81ba48..580a562de9 100644 --- a/packages/world/src/modules/core/CoreModule.sol +++ b/packages/world/src/modules/core/CoreModule.sol @@ -62,8 +62,8 @@ contract CoreModule is Module { * @dev Registers core tables, systems, and function selectors in the World. */ function installRoot(bytes memory) public override { - _registerCoreTables(); - _registerCoreSystems(); + _registerTables(); + _registerSystems(); _registerFunctionSelectors(); } @@ -76,11 +76,11 @@ contract CoreModule is Module { } /** - * @notice Register core tables in the World. + * @notice Register World's tables. * @dev This internal function registers various tables and sets initial permissions. */ - function _registerCoreTables() internal { - StoreCore.registerCoreTables(); + function _registerTables() internal { + StoreCore.registerInternalTables(); NamespaceOwner.register(); Balances.register(); InstalledModules.register(); @@ -108,9 +108,9 @@ contract CoreModule is Module { } /** - * @notice Register the core systems in the World. + * @notice Register the systems in the World. */ - function _registerCoreSystems() internal { + function _registerSystems() internal { _registerSystem(accessManagementSystem, ACCESS_MANAGEMENT_SYSTEM_ID); _registerSystem(balanceTransferSystem, BALANCE_TRANSFER_SYSTEM_ID); _registerSystem(batchCallSystem, BATCH_CALL_SYSTEM_ID); @@ -118,8 +118,8 @@ contract CoreModule is Module { } /** - * @notice Register the core system in the World. - * @dev Uses the CoreRegistrationSystem's `registerSystem` implementation to register the system on the World. + * @notice Register the internal system in the World. + * @dev Uses the WorldRegistrationSystem's `registerSystem` implementation to register the system on the World. */ function _registerSystem(address target, ResourceId systemId) internal { WorldContextProviderLib.delegatecallWithContextOrRevert({