Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
566cb4c5
Unverified
Commit
566cb4c5
authored
Nov 30, 2020
by
Pascal Dierich
Committed by
GitHub
Nov 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts/keystore: add missing function doc for SignText (#21914)
Co-authored-by:
Pascal Dierich
<
pascal@pascaldierich.com
>
parent
b71334ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
wallet.go
accounts/keystore/wallet.go
+6
-4
No files found.
accounts/keystore/wallet.go
View file @
566cb4c5
...
@@ -58,7 +58,7 @@ func (w *keystoreWallet) Open(passphrase string) error { return nil }
...
@@ -58,7 +58,7 @@ func (w *keystoreWallet) Open(passphrase string) error { return nil }
func
(
w
*
keystoreWallet
)
Close
()
error
{
return
nil
}
func
(
w
*
keystoreWallet
)
Close
()
error
{
return
nil
}
// Accounts implements accounts.Wallet, returning an account list consisting of
// Accounts implements accounts.Wallet, returning an account list consisting of
// a single account that the plain kestore wallet contains.
// a single account that the plain ke
y
store wallet contains.
func
(
w
*
keystoreWallet
)
Accounts
()
[]
accounts
.
Account
{
func
(
w
*
keystoreWallet
)
Accounts
()
[]
accounts
.
Account
{
return
[]
accounts
.
Account
{
w
.
account
}
return
[]
accounts
.
Account
{
w
.
account
}
}
}
...
@@ -93,12 +93,12 @@ func (w *keystoreWallet) signHash(account accounts.Account, hash []byte) ([]byte
...
@@ -93,12 +93,12 @@ func (w *keystoreWallet) signHash(account accounts.Account, hash []byte) ([]byte
return
w
.
keystore
.
SignHash
(
account
,
hash
)
return
w
.
keystore
.
SignHash
(
account
,
hash
)
}
}
// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed
// SignData signs keccak256(data). The mimetype parameter describes the type of data being signed
.
func
(
w
*
keystoreWallet
)
SignData
(
account
accounts
.
Account
,
mimeType
string
,
data
[]
byte
)
([]
byte
,
error
)
{
func
(
w
*
keystoreWallet
)
SignData
(
account
accounts
.
Account
,
mimeType
string
,
data
[]
byte
)
([]
byte
,
error
)
{
return
w
.
signHash
(
account
,
crypto
.
Keccak256
(
data
))
return
w
.
signHash
(
account
,
crypto
.
Keccak256
(
data
))
}
}
// SignDataWithPassphrase signs keccak256(data). The mimetype parameter describes the type of data being signed
// SignDataWithPassphrase signs keccak256(data). The mimetype parameter describes the type of data being signed
.
func
(
w
*
keystoreWallet
)
SignDataWithPassphrase
(
account
accounts
.
Account
,
passphrase
,
mimeType
string
,
data
[]
byte
)
([]
byte
,
error
)
{
func
(
w
*
keystoreWallet
)
SignDataWithPassphrase
(
account
accounts
.
Account
,
passphrase
,
mimeType
string
,
data
[]
byte
)
([]
byte
,
error
)
{
// Make sure the requested account is contained within
// Make sure the requested account is contained within
if
!
w
.
Contains
(
account
)
{
if
!
w
.
Contains
(
account
)
{
...
@@ -108,12 +108,14 @@ func (w *keystoreWallet) SignDataWithPassphrase(account accounts.Account, passph
...
@@ -108,12 +108,14 @@ func (w *keystoreWallet) SignDataWithPassphrase(account accounts.Account, passph
return
w
.
keystore
.
SignHashWithPassphrase
(
account
,
passphrase
,
crypto
.
Keccak256
(
data
))
return
w
.
keystore
.
SignHashWithPassphrase
(
account
,
passphrase
,
crypto
.
Keccak256
(
data
))
}
}
// SignText implements accounts.Wallet, attempting to sign the hash of
// the given text with the given account.
func
(
w
*
keystoreWallet
)
SignText
(
account
accounts
.
Account
,
text
[]
byte
)
([]
byte
,
error
)
{
func
(
w
*
keystoreWallet
)
SignText
(
account
accounts
.
Account
,
text
[]
byte
)
([]
byte
,
error
)
{
return
w
.
signHash
(
account
,
accounts
.
TextHash
(
text
))
return
w
.
signHash
(
account
,
accounts
.
TextHash
(
text
))
}
}
// SignTextWithPassphrase implements accounts.Wallet, attempting to sign the
// SignTextWithPassphrase implements accounts.Wallet, attempting to sign the
//
given hash
with the given account using passphrase as extra authentication.
//
hash of the given text
with the given account using passphrase as extra authentication.
func
(
w
*
keystoreWallet
)
SignTextWithPassphrase
(
account
accounts
.
Account
,
passphrase
string
,
text
[]
byte
)
([]
byte
,
error
)
{
func
(
w
*
keystoreWallet
)
SignTextWithPassphrase
(
account
accounts
.
Account
,
passphrase
string
,
text
[]
byte
)
([]
byte
,
error
)
{
// Make sure the requested account is contained within
// Make sure the requested account is contained within
if
!
w
.
Contains
(
account
)
{
if
!
w
.
Contains
(
account
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment