Skip to content

Commit

Permalink
don't need that anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Mar 20, 2024
1 parent 7ecd462 commit 0d0bdb1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { fetchAndStoreLogs } from "../fetchAndStoreLogs";
import { testClient } from "../../test/common";
import { getBlockNumber } from "viem/actions";
import { Address } from "viem";
import { getTables } from "./getTables";

describe("createStorageAdapter", async () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand All @@ -17,7 +16,7 @@ describe("createStorageAdapter", async () => {
});

it("sets component values from logs", async () => {
const useStore = createStore({ tables: getTables(config) });
const useStore = createStore({ tables: config.tables });
const storageAdapter = createStorageAdapter({ store: useStore });

console.log("fetching blocks");
Expand Down
28 changes: 0 additions & 28 deletions packages/store-sync/src/query-cache/getTables.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/store-sync/src/query-cache/syncToQueryCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Address } from "viem";
import { Store } from "@latticexyz/store/config/v2";
import { createStore } from "./createStore";
import { createStorageAdapter } from "./createStorageAdapter";
import { getTables } from "./getTables";

type SyncToQueryCacheOptions<config extends Store> = Omit<SyncOptions, "config"> & {
// require address for now to keep the data model + retrieval simpler
Expand All @@ -22,7 +21,7 @@ export async function syncToQueryCache<config extends Store>({
startSync = true,
...syncOptions
}: SyncToQueryCacheOptions<config>): Promise<SyncToQueryCacheResult> {
const useStore = createStore({ tables: getTables(config) });
const useStore = createStore({ tables: config.tables });
const storageAdapter = createStorageAdapter({ store: useStore });

const storeSync = await createStoreSync({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import { Address } from "viem";
import { getBlock, getBlockNumber } from "viem/actions";
import { QueryCacheStore, createStore } from "../createStore";
import { createStorageAdapter } from "../createStorageAdapter";
import { getTables } from "../getTables";

export { config };

export async function createHydratedStore(worldAddress: Address): Promise<{
store: QueryCacheStore<(typeof config)["tables"]>;
fetchLatestLogs: () => Promise<bigint>;
}> {
const store = createStore({ tables: getTables(config) });
const store = createStore({ tables: config.tables });
const storageAdapter = createStorageAdapter({ store });

let lastBlockProcessed = (await getBlock(testClient, { blockTag: "earliest" })).number - 1n;
Expand Down

0 comments on commit 0d0bdb1

Please sign in to comment.