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

Function NewClientImpl

account/client.go:106–121  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

104}
105
106func NewClientImpl(path string) (*ClientImpl, error) {
107 cli := &ClientImpl{
108 path: path,
109 accAddrs: make(map[string]*AccountData),
110 accLabels: make(map[string]*AccountData),
111 unlockAccs: make(map[string]*unlockAccountInfo),
112 walletData: NewWalletData(),
113 }
114 if common.FileExisted(path) {
115 err := cli.load()
116 if err != nil {
117 return nil, err
118 }
119 }
120 return cli, nil
121}
122
123func (this *ClientImpl) load() error {
124 err := this.walletData.Load(this.path)

Callers 3

TestImportAccountFunction · 0.85
TestCheckSigSchemeFunction · 0.85
OpenFunction · 0.85

Calls 3

loadMethod · 0.95
FileExistedFunction · 0.92
NewWalletDataFunction · 0.85

Tested by 2

TestImportAccountFunction · 0.68
TestCheckSigSchemeFunction · 0.68