Skip to content

Commit

Permalink
refactor: more explicit voluntary exit process (#5863)
Browse files Browse the repository at this point in the history
* Default confirm to exit prompt to No

* Add warning that this operation is irreversible
  • Loading branch information
nflaig authored Aug 8, 2023
1 parent a8ad567 commit e690ac6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/cli/src/cmds/validator/voluntaryExit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ If no `pubkeys` are provided, it will exit all validators that have been importe
const validatorsToExit = await resolveValidatorIndexes(client, signersToExit);

if (!args.yes) {
console.log("\nWARNING: THIS IS AN IRREVERSIBLE OPERATION\n");
const confirmation = await inquirer.prompt<{yes: boolean}>([
{
name: "yes",
type: "confirm",
default: false,
message: `Confirm to exit pubkeys at epoch ${exitEpoch} from network ${network}?
${validatorsToExit.map((v) => `${v.pubkey} ${v.index} ${v.status}`).join("\n")}`,
},
Expand Down

0 comments on commit e690ac6

Please sign in to comment.