-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store,world): combine schema and metadata registration, rename g…
…etSchema to getValueSchema, change Schema table id (#1182) Co-authored-by: Kevin Ingersoll <[email protected]>
- Loading branch information
Showing
120 changed files
with
4,069 additions
and
4,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
"@latticexyz/cli": major | ||
"@latticexyz/store": major | ||
"@latticexyz/world": major | ||
"@latticexyz/store-sync": major | ||
"create-mud": patch | ||
--- | ||
|
||
- `Store`'s internal schema table is now a normal table instead of using special code paths. It is renamed to Tables, and the table ID changed from `mudstore:schema` to `mudstore:Tables` | ||
- `Store`'s `registerSchema` and `setMetadata` are combined into a single `registerTable` method. This means metadata (key names, field names) is immutable and indexers can create tables with this metadata when a new table is registered on-chain. | ||
|
||
```diff | ||
- function registerSchema(bytes32 table, Schema schema, Schema keySchema) external; | ||
- | ||
- function setMetadata(bytes32 table, string calldata tableName, string[] calldata fieldNames) external; | ||
|
||
+ function registerTable( | ||
+ bytes32 table, | ||
+ Schema keySchema, | ||
+ Schema valueSchema, | ||
+ string[] calldata keyNames, | ||
+ string[] calldata fieldNames | ||
+ ) external; | ||
``` | ||
|
||
- `World`'s `registerTable` method is updated to match the `Store` interface, `setMetadata` is removed | ||
- The `getSchema` method is renamed to `getValueSchema` on all interfaces | ||
```diff | ||
- function getSchema(bytes32 table) external view returns (Schema schema); | ||
+ function getValueSchema(bytes32 table) external view returns (Schema valueSchema); | ||
``` | ||
- The `store-sync` and `cli` packages are updated to integrate the breaking protocol changes. Downstream projects only need to manually integrate these changes if they access low level `Store` or `World` functions. Otherwise, a fresh deploy with the latest MUD will get you these changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.