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
aca588a8
Commit
aca588a8
authored
6 years ago
by
Jeremy Schlatter
Committed by
Péter Szilágyi
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts/keystore: small code simplification (#18394)
parent
fe03b76f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
wallet.go
accounts/keystore/wallet.go
+4
-16
No files found.
accounts/keystore/wallet.go
View file @
aca588a8
...
...
@@ -84,10 +84,7 @@ func (w *keystoreWallet) SelfDerive(base accounts.DerivationPath, chain ethereum
// able to sign via our shared keystore backend).
func
(
w
*
keystoreWallet
)
SignHash
(
account
accounts
.
Account
,
hash
[]
byte
)
([]
byte
,
error
)
{
// Make sure the requested account is contained within
if
account
.
Address
!=
w
.
account
.
Address
{
return
nil
,
accounts
.
ErrUnknownAccount
}
if
account
.
URL
!=
(
accounts
.
URL
{})
&&
account
.
URL
!=
w
.
account
.
URL
{
if
!
w
.
Contains
(
account
)
{
return
nil
,
accounts
.
ErrUnknownAccount
}
// Account seems valid, request the keystore to sign
...
...
@@ -100,10 +97,7 @@ func (w *keystoreWallet) SignHash(account accounts.Account, hash []byte) ([]byte
// be able to sign via our shared keystore backend).
func
(
w
*
keystoreWallet
)
SignTx
(
account
accounts
.
Account
,
tx
*
types
.
Transaction
,
chainID
*
big
.
Int
)
(
*
types
.
Transaction
,
error
)
{
// Make sure the requested account is contained within
if
account
.
Address
!=
w
.
account
.
Address
{
return
nil
,
accounts
.
ErrUnknownAccount
}
if
account
.
URL
!=
(
accounts
.
URL
{})
&&
account
.
URL
!=
w
.
account
.
URL
{
if
!
w
.
Contains
(
account
)
{
return
nil
,
accounts
.
ErrUnknownAccount
}
// Account seems valid, request the keystore to sign
...
...
@@ -114,10 +108,7 @@ func (w *keystoreWallet) SignTx(account accounts.Account, tx *types.Transaction,
// given hash with the given account using passphrase as extra authentication.
func
(
w
*
keystoreWallet
)
SignHashWithPassphrase
(
account
accounts
.
Account
,
passphrase
string
,
hash
[]
byte
)
([]
byte
,
error
)
{
// Make sure the requested account is contained within
if
account
.
Address
!=
w
.
account
.
Address
{
return
nil
,
accounts
.
ErrUnknownAccount
}
if
account
.
URL
!=
(
accounts
.
URL
{})
&&
account
.
URL
!=
w
.
account
.
URL
{
if
!
w
.
Contains
(
account
)
{
return
nil
,
accounts
.
ErrUnknownAccount
}
// Account seems valid, request the keystore to sign
...
...
@@ -128,10 +119,7 @@ func (w *keystoreWallet) SignHashWithPassphrase(account accounts.Account, passph
// transaction with the given account using passphrase as extra authentication.
func
(
w
*
keystoreWallet
)
SignTxWithPassphrase
(
account
accounts
.
Account
,
passphrase
string
,
tx
*
types
.
Transaction
,
chainID
*
big
.
Int
)
(
*
types
.
Transaction
,
error
)
{
// Make sure the requested account is contained within
if
account
.
Address
!=
w
.
account
.
Address
{
return
nil
,
accounts
.
ErrUnknownAccount
}
if
account
.
URL
!=
(
accounts
.
URL
{})
&&
account
.
URL
!=
w
.
account
.
URL
{
if
!
w
.
Contains
(
account
)
{
return
nil
,
accounts
.
ErrUnknownAccount
}
// Account seems valid, request the keystore to sign
...
...
This diff is collapsed.
Click to expand it.
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