Skip to content

Commit

Permalink
fix(cli): register namespace with namespaceId (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Sep 26, 2023
1 parent 5ff325d commit 1d40396
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .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.
3 changes: 2 additions & 1 deletion packages/cli/src/utils/deploy.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
}
Expand Down

0 comments on commit 1d40396

Please sign in to comment.