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

Function OpenWallet

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

Source from the content-addressed store, hash-verified

47}
48
49func OpenWallet(ctx *cli.Context) (account.Client, error) {
50 walletFile := ctx.String(utils.GetFlagName(utils.WalletFileFlag))
51 if walletFile == "" {
52 walletFile = config.DEFAULT_WALLET_FILE_NAME
53 }
54 if !common.FileExisted(walletFile) {
55 return nil, fmt.Errorf("cannot find wallet file: %s", walletFile)
56 }
57 wallet, err := account.Open(walletFile)
58 if err != nil {
59 return nil, err
60 }
61 return wallet, nil
62}
63
64func GetAccountMulti(wallet account.Client, passwd []byte, accAddr string) (*account.Account, error) {
65 //Address maybe address in base58, label or index

Callers 6

accountSetFunction · 0.92
accountDeleteFunction · 0.92
accountImportFunction · 0.92
accountExportFunction · 0.92
GetAccountFunction · 0.85
ParseAddressFunction · 0.85

Calls 5

GetFlagNameFunction · 0.92
FileExistedFunction · 0.92
OpenFunction · 0.92
ErrorfMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected