Update neo_client.go
This commit is contained in:
parent
474679f042
commit
36938f47db
1 changed files with 31 additions and 34 deletions
|
@ -22,18 +22,15 @@ func NewNeoClient(rpcEndpoint, walletPath, walletPass string) (*NeoClient, error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("rpcclient new: %w", err)
|
return nil, fmt.Errorf("rpcclient new: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
w, err := wallet.NewWalletFromFile(walletPath)
|
w, err := wallet.NewWalletFromFile(walletPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("wallet load: %w", err)
|
return nil, fmt.Errorf("wallet load: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
acc := w.GetAccount(w.GetChangeAddress())
|
acc := w.GetAccount(w.GetChangeAddress())
|
||||||
err = acc.Decrypt(walletPass, w.Scrypt)
|
err = acc.Decrypt(walletPass, w.Scrypt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("wallet decrypt: %w", err)
|
return nil, fmt.Errorf("wallet decrypt: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
act, err := actor.NewSimple(rpcCli, acc)
|
act, err := actor.NewSimple(rpcCli, acc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("actor new: %w", err)
|
return nil, fmt.Errorf("actor new: %w", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue