We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c2d89a commit fb9ebedCopy full SHA for fb9ebed
1 file changed
internal/prompt/prompt.go
@@ -207,6 +207,25 @@ func secureNetworkKeyPrompt() string {
207
return networkKey
208
}
209
210
+func addressPrompt(label, errorMessage string) string {
211
+ addressPrompt := promptui.Prompt{
212
+ Label: label,
213
+ Validate: func(s string) error {
214
+ if flow.HexToAddress(s) == flow.EmptyAddress {
215
+ return errors.New(errorMessage)
216
+ }
217
+ return nil
218
+ },
219
220
+
221
+ address, err := addressPrompt.Run()
222
+ if err == promptui.ErrInterrupt {
223
+ os.Exit(-1)
224
225
226
+ return address
227
+}
228
229
func AddressPromptOrEmpty(label, errorMessage string) string {
230
addressPrompt := promptui.Prompt{
231
Label: label,
0 commit comments