aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-05 19:57:12 +0800
committerGitHub <noreply@github.com>2017-01-05 19:57:12 +0800
commitbb2e99dfc213c4abda1e851802d4fd0194d800e5 (patch)
tree9b41ad6c9b5d965f10669b3e9e7967b3052e31a1 /accounts
parentf087633efdf42f23ada99a5750af30320a7905a8 (diff)
parentb37d175e59cda8c6afd6b4b1d6b7ed921dc59279 (diff)
downloadgo-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.tar
go-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.tar.gz
go-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.tar.bz2
go-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.tar.lz
go-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.tar.xz
go-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.tar.zst
go-tangerine-bb2e99dfc213c4abda1e851802d4fd0194d800e5.zip
Merge pull request #3417 from karalabe/mobile-polishes
Account management API polishes
Diffstat (limited to 'accounts')
-rw-r--r--accounts/account_manager.go4
-rw-r--r--accounts/accounts_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/accounts/account_manager.go b/accounts/account_manager.go
index 12ff30bca..6460b6e85 100644
--- a/accounts/account_manager.go
+++ b/accounts/account_manager.go
@@ -152,8 +152,8 @@ func (am *Manager) Sign(addr common.Address, hash []byte) ([]byte, error) {
// SignWithPassphrase signs hash if the private key matching the given address
// can be decrypted with the given passphrase. The produced signature is in the
// [R || S || V] format where V is 0 or 1.
-func (am *Manager) SignWithPassphrase(addr common.Address, passphrase string, hash []byte) (signature []byte, err error) {
- _, key, err := am.getDecryptedKey(Account{Address: addr}, passphrase)
+func (am *Manager) SignWithPassphrase(a Account, passphrase string, hash []byte) (signature []byte, err error) {
+ _, key, err := am.getDecryptedKey(a, passphrase)
if err != nil {
return nil, err
}
diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go
index 2e5f2b44a..51ca6c256 100644
--- a/accounts/accounts_test.go
+++ b/accounts/accounts_test.go
@@ -95,7 +95,7 @@ func TestSignWithPassphrase(t *testing.T) {
t.Fatal("expected account to be locked")
}
- _, err = am.SignWithPassphrase(acc.Address, pass, testSigData)
+ _, err = am.SignWithPassphrase(acc, pass, testSigData)
if err != nil {
t.Fatal(err)
}
@@ -104,7 +104,7 @@ func TestSignWithPassphrase(t *testing.T) {
t.Fatal("expected account to be locked")
}
- if _, err = am.SignWithPassphrase(acc.Address, "invalid passwd", testSigData); err == nil {
+ if _, err = am.SignWithPassphrase(acc, "invalid passwd", testSigData); err == nil {
t.Fatal("expected SignHash to fail with invalid password")
}
}