Update neo_client.go

This commit is contained in:
P4vlushaaa 2025-01-23 13:20:12 +03:00 committed by GitHub
parent 474679f042
commit 36938f47db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,18 +22,15 @@ func NewNeoClient(rpcEndpoint, walletPath, walletPass string) (*NeoClient, error
if err != nil {
return nil, fmt.Errorf("rpcclient new: %w", err)
}
w, err := wallet.NewWalletFromFile(walletPath)
if err != nil {
return nil, fmt.Errorf("wallet load: %w", err)
}
acc := w.GetAccount(w.GetChangeAddress())
err = acc.Decrypt(walletPass, w.Scrypt)
if err != nil {
return nil, fmt.Errorf("wallet decrypt: %w", err)
}
act, err := actor.NewSimple(rpcCli, acc)
if err != nil {
return nil, fmt.Errorf("actor new: %w", err)