Skip to content

Commit

Permalink
Small fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Schwartz10 committed Apr 12, 2024
1 parent d35eab8 commit 4f3da34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/wallet_import_account_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import (
func validateImportKeyParams(name string, overwrite bool) (string, string, string, error) {
as := util.AccountsStore()

var passphrase string
addrToOverwrite, err := as.Get(name)

rename := fmt.Sprintf("%s-replaced-%s", name, time.Now().Format(time.RFC3339))

var e *util.ErrKeyNotFound
if !errors.As(err, &e) && !overwrite {
logFatalf("Account %s already exists", name)
return passphrase, addrToOverwrite, rename, errors.New("Account already exists")
} else if !errors.As(err, &e) {
log.Printf("Warning: account '%s' already exists, renaming to '%s' and overriding with new '%s' key\n", name, rename, name)
} else if overwrite {
Expand All @@ -39,7 +40,6 @@ func validateImportKeyParams(name string, overwrite bool) (string, string, strin
log.Printf("Importing account: %s\n", name)
}

var passphrase string
var message = "Passphrase for account (or hit enter for no passphrase)"
prompt := &survey.Password{Message: message}
survey.AskOne(prompt, &passphrase)
Expand Down
2 changes: 2 additions & 0 deletions cmd/wallet_rm_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ var rmAccountCmd = &cobra.Command{
if err := viper.WriteConfig(); err != nil {
logFatal(err)
}

log.Printf("Account %s removed successfully\n", name)
},
}

Expand Down

0 comments on commit 4f3da34

Please sign in to comment.