Skip to content

Commit 566cb4c

Browse files
accounts/keystore: add missing function doc for SignText (#21914)
Co-authored-by: Pascal Dierich <[email protected]>
1 parent b71334a commit 566cb4c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

accounts/keystore/wallet.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (w *keystoreWallet) Open(passphrase string) error { return nil }
5858
func (w *keystoreWallet) Close() error { return nil }
5959

6060
// Accounts implements accounts.Wallet, returning an account list consisting of
61-
// a single account that the plain kestore wallet contains.
61+
// a single account that the plain keystore wallet contains.
6262
func (w *keystoreWallet) Accounts() []accounts.Account {
6363
return []accounts.Account{w.account}
6464
}
@@ -93,12 +93,12 @@ func (w *keystoreWallet) signHash(account accounts.Account, hash []byte) ([]byte
9393
return w.keystore.SignHash(account, hash)
9494
}
9595

96-
// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed
96+
// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed.
9797
func (w *keystoreWallet) SignData(account accounts.Account, mimeType string, data []byte) ([]byte, error) {
9898
return w.signHash(account, crypto.Keccak256(data))
9999
}
100100

101-
// SignDataWithPassphrase signs keccak256(data). The mimetype parameter describes the type of data being signed
101+
// SignDataWithPassphrase signs keccak256(data). The mimetype parameter describes the type of data being signed.
102102
func (w *keystoreWallet) SignDataWithPassphrase(account accounts.Account, passphrase, mimeType string, data []byte) ([]byte, error) {
103103
// Make sure the requested account is contained within
104104
if !w.Contains(account) {
@@ -108,12 +108,14 @@ func (w *keystoreWallet) SignDataWithPassphrase(account accounts.Account, passph
108108
return w.keystore.SignHashWithPassphrase(account, passphrase, crypto.Keccak256(data))
109109
}
110110

111+
// SignText implements accounts.Wallet, attempting to sign the hash of
112+
// the given text with the given account.
111113
func (w *keystoreWallet) SignText(account accounts.Account, text []byte) ([]byte, error) {
112114
return w.signHash(account, accounts.TextHash(text))
113115
}
114116

115117
// SignTextWithPassphrase implements accounts.Wallet, attempting to sign the
116-
// given hash with the given account using passphrase as extra authentication.
118+
// hash of the given text with the given account using passphrase as extra authentication.
117119
func (w *keystoreWallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
118120
// Make sure the requested account is contained within
119121
if !w.Contains(account) {

0 commit comments

Comments
 (0)