diff --git a/.changeset/three-pigs-give.md b/.changeset/three-pigs-give.md new file mode 100644 index 000000000..008bc485a --- /dev/null +++ b/.changeset/three-pigs-give.md @@ -0,0 +1,5 @@ +--- +"build-lz-options": patch +--- + +Warn users if lzReceive gas is not set. diff --git a/packages/build-lz-options/src/components/outputOptions.tsx b/packages/build-lz-options/src/components/outputOptions.tsx index ea5b69700..13f85b7a7 100644 --- a/packages/build-lz-options/src/components/outputOptions.tsx +++ b/packages/build-lz-options/src/components/outputOptions.tsx @@ -15,8 +15,13 @@ export const OutputOptions: React.FC = ({ }: OptionOutputProps) => { return ( + {props.warning.map((warning) => ( + + Warning: {warning} + + ))} - Result: {props.hex} + Result: {props.hex} ); diff --git a/packages/build-lz-options/src/index.tsx b/packages/build-lz-options/src/index.tsx index 56225efe9..39e208977 100644 --- a/packages/build-lz-options/src/index.tsx +++ b/packages/build-lz-options/src/index.tsx @@ -32,6 +32,7 @@ new Command("build-lz-options") render().unmount(); let output: string = ""; + const warning: string[] = []; switch (config.type.id) { case OptionType.TYPE_1: { @@ -66,10 +67,14 @@ new Command("build-lz-options") } case OptionType.TYPE_3: { const options = await promptForOptionType3(); + const lzReceiveOption = options.decodeExecutorLzReceiveOption(); + if (!lzReceiveOption || lzReceiveOption.gas < 1) { + warning.push("Options do not specify any lzReceive gas."); + } output = options.toHex(); break; } } - render(); + render(); }) .parseAsync(); diff --git a/packages/build-lz-options/src/types.ts b/packages/build-lz-options/src/types.ts index 16e189866..ec59b9cdb 100644 --- a/packages/build-lz-options/src/types.ts +++ b/packages/build-lz-options/src/types.ts @@ -20,6 +20,7 @@ export interface OptionTypeInput { */ export interface OptionOutput { hex: string + warning: string[] } /**