-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store-indexer,store-sync): allow filtering by table IDs (#1572)
- Loading branch information
Showing
8 changed files
with
47 additions
and
15 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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./common"; | ||
export * from "./createStoreSync"; | ||
export * from "./internalTableIds"; | ||
export * from "./SyncStep"; |
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,23 @@ | ||
import { resourceIdToHex } from "@latticexyz/common"; | ||
import storeConfig from "@latticexyz/store/mud.config"; | ||
import worldConfig from "@latticexyz/world/mud.config"; | ||
|
||
// TODO: refactor config to include table IDs (https://github.com/latticexyz/mud/pull/1561) | ||
|
||
export const storeTableIds = Object.keys(storeConfig.tables).map((name) => | ||
resourceIdToHex({ | ||
type: storeConfig.tables[name as keyof typeof storeConfig.tables].offchainOnly ? "offchainTable" : "table", | ||
namespace: storeConfig.namespace, | ||
name, | ||
}) | ||
); | ||
|
||
const worldTableIds = Object.keys(worldConfig.tables).map((name) => | ||
resourceIdToHex({ | ||
type: worldConfig.tables[name as keyof typeof worldConfig.tables].offchainOnly ? "offchainTable" : "table", | ||
namespace: worldConfig.namespace, | ||
name, | ||
}) | ||
); | ||
|
||
export const internalTableIds = [...storeTableIds, ...worldTableIds]; |
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