Skip to content

Commit

Permalink
delete an account should not require password #1114 (#1138)
Browse files Browse the repository at this point in the history
* delete an account should not require password
  • Loading branch information
svolence authored and zjshen14 committed May 16, 2019
1 parent 2a1b53a commit 5dde34d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cli/ioctl/cmd/account/accountdelete.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import (
"bytes"
"fmt"
"io/ioutil"
"syscall"
"os"

"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/spf13/cobra"
"go.uber.org/zap"
"golang.org/x/crypto/ssh/terminal"
"gopkg.in/yaml.v2"

"github.com/iotexproject/iotex-address/address"
Expand Down Expand Up @@ -62,14 +61,7 @@ func accountDelete(args []string) (string, error) {
return "Quit", nil
}

fmt.Printf("Enter password #%s:\n", addr)
bytePassword, err := terminal.ReadPassword(int(syscall.Stdin))
if err != nil {
log.L().Error("failed to get password", zap.Error(err))
return "", err
}
password := string(bytePassword)
if err := ks.Delete(v, password); err != nil {
if err := os.Remove(v.URL.Path); err != nil {
return "", err
}

Expand Down

0 comments on commit 5dde34d

Please sign in to comment.