@@ -56,7 +56,7 @@ func (a *Accounts) Size() int {
56
56
}
57
57
58
58
// Get returns the account at the given index from the slice.
59
- func (a * Accounts ) Get (index int ) (* Account , error ) {
59
+ func (a * Accounts ) Get (index int ) (account * Account , _ error ) {
60
60
if index < 0 || index >= len (a .accounts ) {
61
61
return nil , errors .New ("index out of bounds" )
62
62
}
@@ -91,8 +91,8 @@ func NewAccountManager(keydir string, scryptN, scryptP int) *AccountManager {
91
91
}
92
92
93
93
// HasAddress reports whether a key with the given address is present.
94
- func (am * AccountManager ) HasAddress (addr * Address ) bool {
95
- return am .manager .HasAddress (addr .address )
94
+ func (am * AccountManager ) HasAddress (address * Address ) bool {
95
+ return am .manager .HasAddress (address .address )
96
96
}
97
97
98
98
// GetAccounts returns all key files present in the directory.
@@ -102,32 +102,32 @@ func (am *AccountManager) GetAccounts() *Accounts {
102
102
103
103
// DeleteAccount deletes the key matched by account if the passphrase is correct.
104
104
// If a contains no filename, the address must match a unique key.
105
- func (am * AccountManager ) DeleteAccount (a * Account , passphrase string ) error {
105
+ func (am * AccountManager ) DeleteAccount (account * Account , passphrase string ) error {
106
106
return am .manager .DeleteAccount (accounts.Account {
107
- Address : a .account .Address ,
108
- File : a .account .File ,
107
+ Address : account .account .Address ,
108
+ File : account .account .File ,
109
109
}, passphrase )
110
110
}
111
111
112
112
// Sign signs hash with an unlocked private key matching the given address.
113
- func (am * AccountManager ) Sign (addr * Address , hash []byte ) ([]byte , error ) {
114
- return am .manager .Sign (addr .address , hash )
113
+ func (am * AccountManager ) Sign (address * Address , hash []byte ) (signature []byte , _ error ) {
114
+ return am .manager .Sign (address .address , hash )
115
115
}
116
116
117
117
// SignWithPassphrase signs hash if the private key matching the given address can be
118
118
// decrypted with the given passphrase.
119
- func (am * AccountManager ) SignWithPassphrase (addr * Address , passphrase string , hash []byte ) ([]byte , error ) {
120
- return am .manager .SignWithPassphrase (addr .address , passphrase , hash )
119
+ func (am * AccountManager ) SignWithPassphrase (address * Address , passphrase string , hash []byte ) (signature []byte , _ error ) {
120
+ return am .manager .SignWithPassphrase (address .address , passphrase , hash )
121
121
}
122
122
123
123
// Unlock unlocks the given account indefinitely.
124
- func (am * AccountManager ) Unlock (a * Account , passphrase string ) error {
125
- return am .manager .TimedUnlock (a .account , passphrase , 0 )
124
+ func (am * AccountManager ) Unlock (account * Account , passphrase string ) error {
125
+ return am .manager .TimedUnlock (account .account , passphrase , 0 )
126
126
}
127
127
128
128
// Lock removes the private key with the given address from memory.
129
- func (am * AccountManager ) Lock (addr * Address ) error {
130
- return am .manager .Lock (addr .address )
129
+ func (am * AccountManager ) Lock (address * Address ) error {
130
+ return am .manager .Lock (address .address )
131
131
}
132
132
133
133
// TimedUnlock unlocks the given account with the passphrase. The account
@@ -152,27 +152,27 @@ func (am *AccountManager) NewAccount(passphrase string) (*Account, error) {
152
152
}
153
153
154
154
// ExportKey exports as a JSON key, encrypted with newPassphrase.
155
- func (am * AccountManager ) ExportKey (a * Account , passphrase , newPassphrase string ) ([]byte , error ) {
156
- return am .manager .Export (a .account , passphrase , newPassphrase )
155
+ func (am * AccountManager ) ExportKey (account * Account , passphrase , newPassphrase string ) (key []byte , _ error ) {
156
+ return am .manager .Export (account .account , passphrase , newPassphrase )
157
157
}
158
158
159
159
// ImportKey stores the given encrypted JSON key into the key directory.
160
- func (am * AccountManager ) ImportKey (keyJSON []byte , passphrase , newPassphrase string ) (* Account , error ) {
161
- account , err := am .manager .Import (keyJSON , passphrase , newPassphrase )
160
+ func (am * AccountManager ) ImportKey (keyJSON []byte , passphrase , newPassphrase string ) (account * Account , _ error ) {
161
+ acc , err := am .manager .Import (keyJSON , passphrase , newPassphrase )
162
162
if err != nil {
163
163
return nil , err
164
164
}
165
- return & Account {account }, nil
165
+ return & Account {acc }, nil
166
166
}
167
167
168
168
// Update changes the passphrase of an existing account.
169
- func (am * AccountManager ) Update (a * Account , passphrase , newPassphrase string ) error {
170
- return am .manager .Update (a .account , passphrase , newPassphrase )
169
+ func (am * AccountManager ) Update (account * Account , passphrase , newPassphrase string ) error {
170
+ return am .manager .Update (account .account , passphrase , newPassphrase )
171
171
}
172
172
173
173
// ImportPreSaleKey decrypts the given Ethereum presale wallet and stores
174
174
// a key file in the key directory. The key file is encrypted with the same passphrase.
175
- func (am * AccountManager ) ImportPreSaleKey (keyJSON []byte , passphrase string ) (* Account , error ) {
175
+ func (am * AccountManager ) ImportPreSaleKey (keyJSON []byte , passphrase string ) (ccount * Account , _ error ) {
176
176
account , err := am .manager .ImportPreSaleKey (keyJSON , passphrase )
177
177
if err != nil {
178
178
return nil , err
0 commit comments