Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validator exiting ux improvement, add a log and update size for promptui #13542

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions validator/accounts/accounts_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ func selectAccounts(selectionPrompt string, pubKeys [][fieldparams.BLSPubkeyLeng
exit := "Done selecting"
results := make([]int, 0)
au := aurora.NewAurora(true)
if len(pubKeyStrings) > 5 {
log.Warnf("there are more than %d potential public keys to exit, please consider using the --%s or --%s flags", 5, flags.VoluntaryExitPublicKeysFlag.Name, flags.ExitAllFlag.Name)
Comment on lines +45 to +46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 feels like a bit of a magic number, is there a constant we can use for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a magic number in that library we are using if you look in that promptui not sure if it changes on updates

}
for result != exit {
p := promptui.Select{
Label: selectionPrompt,
HideSelected: true,
Size: len(pubKeyStrings),
Items: append([]string{exit, allAccountsText}, pubKeyStrings...),
Templates: templates,
}
Expand Down
Loading