Clef: USB hw wallet support (#17756)
* signer: implement USB interaction with hw wallets * signer: fix failing testcases
This commit is contained in:
committed by
GitHub
parent
2c110c81ee
commit
dcaabfe7f6
@ -83,6 +83,22 @@ func (ui *CommandlineUI) readPasswordText(inputstring string) string {
|
||||
return string(text)
|
||||
}
|
||||
|
||||
func (ui *CommandlineUI) OnInputRequired(info UserInputRequest) (UserInputResponse, error) {
|
||||
fmt.Println(info.Title)
|
||||
fmt.Println(info.Prompt)
|
||||
if info.IsPassword {
|
||||
text, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
if err != nil {
|
||||
log.Error("Failed to read password", "err", err)
|
||||
}
|
||||
fmt.Println("-----------------------")
|
||||
return UserInputResponse{string(text)}, err
|
||||
}
|
||||
text := ui.readString()
|
||||
fmt.Println("-----------------------")
|
||||
return UserInputResponse{text}, nil
|
||||
}
|
||||
|
||||
// confirm returns true if user enters 'Yes', otherwise false
|
||||
func (ui *CommandlineUI) confirm() bool {
|
||||
fmt.Printf("Approve? [y/N]:\n")
|
||||
|
Reference in New Issue
Block a user