Skip to content

Commit

Permalink
refactor: default in createStoreSync
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaaa committed Apr 30, 2024
1 parent 3bb7659 commit 5ae4a48
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion e2e/packages/client-vanilla/src/mud/getNetworkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function getNetworkConfig() {
faucetServiceUrl: params.get("faucet") ?? chain.faucetUrl,
worldAddress,
initialBlockNumber,
indexerUrl: params.get("indexerUrl") ?? chain.indexerUrl,
indexerUrl: params.get("indexerUrl"),
rpcHttpUrl: params.get("rpcHttpUrl"),
};
}
2 changes: 1 addition & 1 deletion e2e/packages/client-vanilla/src/mud/setupNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function setupNetwork() {
address: networkConfig.worldAddress as Hex,
publicClient,
startBlock: BigInt(networkConfig.initialBlockNumber),
indexerUrl: networkConfig.indexerUrl,
indexerUrl: networkConfig.indexerUrl ?? undefined,
filters: Object.entries(mudConfig.tables).map(([, table]) => {
const tableId = table.tableId;
if (table.name === mudConfig.tables.Position.name) {
Expand Down
3 changes: 2 additions & 1 deletion packages/store-sync/src/createStoreSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { bigIntMax, chunk, isDefined, waitForIdle } from "@latticexyz/common/uti
import { getSnapshot } from "./getSnapshot";
import { fetchAndStoreLogs } from "./fetchAndStoreLogs";
import { Store as StoreConfig } from "@latticexyz/store";
import { MUDChain } from "@latticexyz/common/chains";

const debug = parentDebug.extend("createStoreSync");

Expand Down Expand Up @@ -96,7 +97,7 @@ export async function createStoreSync<config extends StoreConfig = StoreConfig>(
filters,
initialState,
initialBlockLogs,
indexerUrl,
indexerUrl: indexerUrl ?? (publicClient.chain as MUDChain).indexerUrl,
});

onProgress?.({
Expand Down

0 comments on commit 5ae4a48

Please sign in to comment.