Skip to content

Commit

Permalink
update after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
frolic committed Aug 14, 2024
1 parent 3cc5820 commit cfc13fb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/cli/src/deploy/ensureResourceLabels.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Hex, Client, Transport, Chain, Account, stringToHex, parseAbi, BaseError } from "viem";
import { Hex, Client, Transport, Chain, Account, stringToHex, BaseError } from "viem";
import { WorldDeploy } from "./common";
import { debug } from "./debug";
import { hexToResource, writeContract } from "@latticexyz/common";
import { isDefined } from "@latticexyz/common/utils";
import metadataAbi from "@latticexyz/world-module-metadata/out/IMetadataSystem.sol/IMetadataSystem.abi.json" assert { type: "json" };

type LabeledResource = {
readonly resourceId: Hex;
readonly label: string;
};

// TODO: import from metadata module (forge output is currently mangled)
const metadataAbi = parseAbi(["function metadata__setResource(bytes32,bytes32,string)"]);

export async function ensureResourceLabels({
client,
worldDeploy,
Expand All @@ -38,8 +36,8 @@ export async function ensureResourceLabels({
address: worldDeploy.address,
abi: metadataAbi,
// TODO: replace with batchCall (https://github.com/latticexyz/mud/issues/1645)
functionName: "metadata__setResource",
args: [resourceId, stringToHex("label", { size: 32 }), label],
functionName: "metadata__setResourceTag",
args: [resourceId, stringToHex("label", { size: 32 }), stringToHex(label)],
});
} catch (error) {
debug(
Expand Down

0 comments on commit cfc13fb

Please sign in to comment.