Skip to content

Commit

Permalink
fix: add safeguard messages (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Jan 29, 2025
1 parent 5f6f3b5 commit d97075f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils/keys/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ func generateRaSequencerKeys(home string, rollerData roller.RollappConfig) ([]Ke
return nil, err
}

if rollerData.KeyringBackend == consts.SupportedKeyringBackends.OS {
pterm.Info.Printfln(
"use the os keyring password from %s",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprint(filepath.Join(rollerData.Home, string(consts.OsKeyringPwdFileNames.RollApp))),
)
}

ki, err := kc.Create(home)
if err != nil {
return nil, err
Expand Down
19 changes: 19 additions & 0 deletions utils/sequencer/sequencer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sequencer

import (
"encoding/json"
"errors"
"fmt"
"io"
"os"
Expand Down Expand Up @@ -90,6 +91,24 @@ func Register(raCfg roller.RollappConfig, desiredBond cosmossdktypes.Coin) error
return err
}

newHeader := pterm.HeaderPrinter{
TextStyle: pterm.NewStyle(pterm.FgBlack),
BackgroundStyle: pterm.NewStyle(pterm.BgRed),
Margin: 20,
}

// Print the custom header using the new HeaderPrinter.
newHeader.WithFullWidth().
Println("The moment you bond the sequencer, you have to ensure it’s uptime, otherwise you will get slashed.")

proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultText(
"would you like to proceed with bonding the sequencer?",
).Show()

if !proceed {
return errors.New("user declined to bond the sequencer")
}

automaticPrompts := map[string]string{
"Enter keyring passphrase": psw,
"Re-enter keyring passphrase": psw,
Expand Down

0 comments on commit d97075f

Please sign in to comment.