From 0bdab66be7395c8ca3793c1e05e4fc1145a07547 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Tue, 30 Jan 2024 10:17:29 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Use=20OptionType=20enum=20from?= =?UTF-8?q?=20monorepo=20(#303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ryan Goulding --- .changeset/long-flies-melt.md | 5 +++++ packages/build-lz-options/src/config.ts | 21 +++++++++------------ packages/build-lz-options/src/index.tsx | 12 ++++++++---- packages/build-lz-options/src/types.ts | 8 +++++--- 4 files changed, 27 insertions(+), 19 deletions(-) create mode 100644 .changeset/long-flies-melt.md diff --git a/.changeset/long-flies-melt.md b/.changeset/long-flies-melt.md new file mode 100644 index 000000000..ae270e5bf --- /dev/null +++ b/.changeset/long-flies-melt.md @@ -0,0 +1,5 @@ +--- +"build-lz-options": patch +--- + +Reference OptionType types from monorepo diff --git a/packages/build-lz-options/src/config.ts b/packages/build-lz-options/src/config.ts index 2a85af4fd..b7fcd0d30 100644 --- a/packages/build-lz-options/src/config.ts +++ b/packages/build-lz-options/src/config.ts @@ -1,24 +1,21 @@ -import type { OptionType } from '@/types' -import { ExecutorOptionType, WorkerId } from '@layerzerolabs/lz-v2-utilities' +import type { OptionTypeOption } from '@/types' +import { ExecutorOptionType, OptionType, WorkerId } from '@layerzerolabs/lz-v2-utilities' /** * Supported Option Types. */ -export const OPTION_TYPES: OptionType[] = [ +export const OPTION_TYPES: OptionTypeOption[] = [ { - // TODO: use OptionType.TYPE_1 once exported from lz-v2-utility - id: '1', - label: '1: gas for remote execution', + id: OptionType.TYPE_1, + label: `${OptionType.TYPE_1}: gas for remote execution`, }, { - // TODO: use OptionType.TYPE_2 once exported from lz-v2-utility - id: '2', - label: '2: gas for remote execution and native drop', + id: OptionType.TYPE_2, + label: `${OptionType.TYPE_2}: gas for remote execution and native drop`, }, { - // TODO: use OptionType.TYPE_3 once exported from lz-v2-utility - id: '3', - label: '3: options builder (EndpointV2 only)', + id: OptionType.TYPE_3, + label: `${OptionType.TYPE_3}: options builder (EndpointV2 only)`, }, ] diff --git a/packages/build-lz-options/src/index.tsx b/packages/build-lz-options/src/index.tsx index 3d8d9a93a..56225efe9 100644 --- a/packages/build-lz-options/src/index.tsx +++ b/packages/build-lz-options/src/index.tsx @@ -1,5 +1,9 @@ import { makeBytes32 } from "@layerzerolabs/devtools"; -import { optionsType1, optionsType2 } from "@layerzerolabs/lz-v2-utilities"; +import { + optionsType1, + optionsType2, + OptionType, +} from "@layerzerolabs/lz-v2-utilities"; import React from "react"; import { render } from "ink"; import { Command } from "commander"; @@ -30,7 +34,7 @@ new Command("build-lz-options") let output: string = ""; switch (config.type.id) { - case "1": { + case OptionType.TYPE_1: { const options = await promptForOptionType1(); render(