From 1d403962283c5b5f62410867be01f6adff277f41 Mon Sep 17 00:00:00 2001 From: alvarius Date: Tue, 26 Sep 2023 21:45:17 +0100 Subject: [PATCH] fix(cli): register namespace with namespaceId (#1619) --- .changeset/real-crews-hide.md | 5 +++++ packages/cli/src/utils/deploy.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/real-crews-hide.md diff --git a/.changeset/real-crews-hide.md b/.changeset/real-crews-hide.md new file mode 100644 index 0000000000..11aecc8d70 --- /dev/null +++ b/.changeset/real-crews-hide.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/cli": patch +--- + +We fixed a bug in the deploy script that would cause the deployment to fail if a non-root namespace was used in the config. diff --git a/packages/cli/src/utils/deploy.ts b/packages/cli/src/utils/deploy.ts index b3eb22ab02..68f725b8ad 100644 --- a/packages/cli/src/utils/deploy.ts +++ b/packages/cli/src/utils/deploy.ts @@ -23,6 +23,7 @@ import { postDeploy } from "./utils/postDeploy"; import { setInternalFeePerGas } from "./utils/setInternalFeePerGas"; import { toBytes16 } from "./utils/toBytes16"; import { ContractCode } from "./utils/types"; +import { resourceIdToHex } from "@latticexyz/common"; export interface DeployConfig { profile?: string; @@ -151,7 +152,7 @@ export async function deploy( nonce: nonce++, contract: worldContract, func: "registerNamespace", - args: [toBytes16(mudConfig.namespace)], + args: [resourceIdToHex({ type: "namespace", namespace: mudConfig.namespace, name: "" })], }); console.log(chalk.green("Namespace registered")); }