Skip to content

Commit d97075f

Browse files
fix: add safeguard messages (#1241)
1 parent 5f6f3b5 commit d97075f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

utils/keys/sequencer.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ func generateRaSequencerKeys(home string, rollerData roller.RollappConfig) ([]Ke
107107
return nil, err
108108
}
109109

110+
if rollerData.KeyringBackend == consts.SupportedKeyringBackends.OS {
111+
pterm.Info.Printfln(
112+
"use the os keyring password from %s",
113+
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
114+
Sprint(filepath.Join(rollerData.Home, string(consts.OsKeyringPwdFileNames.RollApp))),
115+
)
116+
}
117+
110118
ki, err := kc.Create(home)
111119
if err != nil {
112120
return nil, err

utils/sequencer/sequencer.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sequencer
22

33
import (
44
"encoding/json"
5+
"errors"
56
"fmt"
67
"io"
78
"os"
@@ -90,6 +91,24 @@ func Register(raCfg roller.RollappConfig, desiredBond cosmossdktypes.Coin) error
9091
return err
9192
}
9293

94+
newHeader := pterm.HeaderPrinter{
95+
TextStyle: pterm.NewStyle(pterm.FgBlack),
96+
BackgroundStyle: pterm.NewStyle(pterm.BgRed),
97+
Margin: 20,
98+
}
99+
100+
// Print the custom header using the new HeaderPrinter.
101+
newHeader.WithFullWidth().
102+
Println("The moment you bond the sequencer, you have to ensure it’s uptime, otherwise you will get slashed.")
103+
104+
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultText(
105+
"would you like to proceed with bonding the sequencer?",
106+
).Show()
107+
108+
if !proceed {
109+
return errors.New("user declined to bond the sequencer")
110+
}
111+
93112
automaticPrompts := map[string]string{
94113
"Enter keyring passphrase": psw,
95114
"Re-enter keyring passphrase": psw,

0 commit comments

Comments
 (0)