MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetPasswd

Function GetPasswd

cmd/common/common.go:35–47  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

33)
34
35func GetPasswd(ctx *cli.Context) ([]byte, error) {
36 var passwd []byte
37 var err error
38 if ctx.IsSet(utils.GetFlagName(utils.AccountPassFlag)) {
39 passwd = []byte(ctx.String(utils.GetFlagName(utils.AccountPassFlag)))
40 } else {
41 passwd, err = password.GetAccountPassword()
42 if err != nil {
43 return nil, fmt.Errorf("input password error: %s", err)
44 }
45 }
46 return passwd, nil
47}
48
49func OpenWallet(ctx *cli.Context) (account.Client, error) {
50 walletFile := ctx.String(utils.GetFlagName(utils.WalletFileFlag))

Callers 3

accountSetFunction · 0.92
accountDeleteFunction · 0.92
GetAccountFunction · 0.85

Calls 4

GetFlagNameFunction · 0.92
GetAccountPasswordFunction · 0.92
ErrorfMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected