From 5dde34d94dd44ae1fc165ab1c2fd42fb2be811ab Mon Sep 17 00:00:00 2001 From: svolence Date: Wed, 8 May 2019 13:14:08 +0800 Subject: [PATCH] delete an account should not require password #1114 (#1138) * delete an account should not require password --- cli/ioctl/cmd/account/accountdelete.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cli/ioctl/cmd/account/accountdelete.go b/cli/ioctl/cmd/account/accountdelete.go index 769f3a320f..e42eaa94aa 100644 --- a/cli/ioctl/cmd/account/accountdelete.go +++ b/cli/ioctl/cmd/account/accountdelete.go @@ -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" @@ -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 }