Skip to content

Commit

Permalink
test: do not hardcode world address
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaa committed Feb 16, 2024
1 parent 7399844 commit d9b04ea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions e2e/packages/sync-test/syncToRecs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ import { createWorld, getComponentValueStrict } from "@latticexyz/recs";
import { singletonEntity, syncToRecs } from "@latticexyz/store-sync/recs";
import mudConfig from "../contracts/mud.config";
import { transportObserver } from "@latticexyz/common";
import { ClientConfig, createPublicClient, http } from "viem";
import { ClientConfig, createPublicClient, http, isHex } from "viem";
import { getNetworkConfig } from "../client-vanilla/src/mud/getNetworkConfig";

const address = "0xad97505a508daf984fe60302109e0115e544b267";

describe("syncToRecs", () => {
const asyncErrorHandler = createAsyncErrorHandler();

it("has the correct sync progress percentage", async () => {
asyncErrorHandler.resetErrors();

await deployContracts(rpcHttpUrl);
const { stdout } = await deployContracts(rpcHttpUrl);

const [, worldAddress] = stdout.match(/worldAddress: '(0x[0-9a-f]+)'/i) ?? [];
if (!isHex(worldAddress)) {
throw new Error("world address not found in output, did the deploy fail?");
}

const networkConfig = await getNetworkConfig();
const clientOptions = {
Expand All @@ -33,7 +36,7 @@ describe("syncToRecs", () => {
const { components } = await syncToRecs({
world,
config: mudConfig,
address,
address: worldAddress,
publicClient,
});

Expand Down

0 comments on commit d9b04ea

Please sign in to comment.