Skip to content

Commit 5de9cce

Browse files
committed
install as a default module
1 parent cd069f1 commit 5de9cce

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@latticexyz/store-sync": "workspace:*",
5353
"@latticexyz/utils": "workspace:*",
5454
"@latticexyz/world": "workspace:*",
55+
"@latticexyz/world-module-batchstore": "workspace:*",
5556
"@latticexyz/world-module-callwithsignature": "workspace:*",
5657
"@latticexyz/world-module-metadata": "workspace:*",
5758
"abitype": "1.0.9",

packages/cli/src/deploy/configToModules.ts

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,48 @@ import { World } from "@latticexyz/world";
88
import { importContractArtifact } from "../utils/importContractArtifact";
99
import { resolveWithContext } from "@latticexyz/world/internal";
1010
import callWithSignatureModule from "@latticexyz/world-module-callwithsignature/out/CallWithSignatureModule.sol/CallWithSignatureModule.json" with { type: "json" };
11+
import batchStoreModule from "@latticexyz/world-module-batchstore/out/BatchStoreModule.sol/BatchStoreModule.json" with { type: "json" };
1112
import { getContractArtifact } from "../utils/getContractArtifact";
1213
import { excludeCallWithSignatureModule } from "./compat/excludeUnstableCallWithSignatureModule";
1314
import { moduleArtifactPathFromName } from "./compat/moduleArtifactPathFromName";
1415

1516
const callWithSignatureModuleArtifact = getContractArtifact(callWithSignatureModule);
17+
const batchStoreModuleArtifact = getContractArtifact(batchStoreModule);
18+
19+
// metadata module is installed inside `ensureResourceTags`
20+
const defaultModules: Module[] = [
21+
{
22+
// optional for now
23+
// TODO: figure out approach to install on existing worlds where deployer may not own root namespace
24+
optional: true,
25+
name: "CallWithSignatureModule",
26+
installStrategy: "root",
27+
installData: "0x",
28+
prepareDeploy: createPrepareDeploy(
29+
callWithSignatureModuleArtifact.bytecode,
30+
callWithSignatureModuleArtifact.placeholders,
31+
),
32+
deployedBytecodeSize: callWithSignatureModuleArtifact.deployedBytecodeSize,
33+
abi: callWithSignatureModuleArtifact.abi,
34+
},
35+
{
36+
// optional for now
37+
// TODO: figure out approach to install on existing worlds where deployer may not own root namespace
38+
optional: true,
39+
name: "BatchStoreModule",
40+
installStrategy: "root",
41+
installData: "0x",
42+
prepareDeploy: createPrepareDeploy(batchStoreModuleArtifact.bytecode, batchStoreModuleArtifact.placeholders),
43+
deployedBytecodeSize: batchStoreModuleArtifact.deployedBytecodeSize,
44+
abi: batchStoreModuleArtifact.abi,
45+
},
46+
];
1647

1748
export async function configToModules<config extends World>(
1849
config: config,
1950
// TODO: remove/replace `forgeOutDir`
2051
forgeOutDir: string,
2152
): Promise<readonly Module[]> {
22-
// metadata module is installed inside `ensureResourceTags`
23-
const defaultModules: Module[] = [
24-
{
25-
// optional for now
26-
// TODO: figure out approach to install on existing worlds where deployer may not own root namespace
27-
optional: true,
28-
name: "CallWithSignatureModule",
29-
installStrategy: "root",
30-
installData: "0x",
31-
prepareDeploy: createPrepareDeploy(
32-
callWithSignatureModuleArtifact.bytecode,
33-
callWithSignatureModuleArtifact.placeholders,
34-
),
35-
deployedBytecodeSize: callWithSignatureModuleArtifact.deployedBytecodeSize,
36-
abi: callWithSignatureModuleArtifact.abi,
37-
},
38-
];
39-
4053
const modules = await Promise.all(
4154
config.modules
4255
.filter(excludeCallWithSignatureModule)

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)