Skip to content

Commit

Permalink
🪲 ensure valid address in options builder CLI (#364)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Goulding <[email protected]>
  • Loading branch information
ryandgoulding authored Feb 7, 2024
1 parent 398f7cd commit efbcfdf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-bikes-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"build-lz-options": patch
---

Ensure address is valid
8 changes: 8 additions & 0 deletions packages/build-lz-options/src/utilities/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ const promptForNativeDropAddress: PromptObject<'nativeDropAddress'> = {
name: 'nativeDropAddress',
message: 'What native gas drop address (bytes32) do you want to set?',
initial: makeBytes32(),
validate: (str: string) => {
try {
makeBytes32(str)
return true
} catch (_e) {
return false
}
},
}

const promptForWorkerType = () =>
Expand Down

0 comments on commit efbcfdf

Please sign in to comment.