aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-01-17 20:09:29 +0800
committerGitHub <noreply@github.com>2017-01-17 20:09:29 +0800
commit2eefed84c9fc005eec1cb5e7d1a3593aab3e0537 (patch)
treee59b30ade99b2ffdb4b422b1c89c25621dcfc137 /accounts
parent17d92233d9e64b642fed9a992556f7ff7d6fda18 (diff)
parent230530f5ea71f45c5d89f62126e60d24635136d5 (diff)
downloadgo-tangerine-2eefed84c9fc005eec1cb5e7d1a3593aab3e0537.tar.gz
go-tangerine-2eefed84c9fc005eec1cb5e7d1a3593aab3e0537.tar.zst
go-tangerine-2eefed84c9fc005eec1cb5e7d1a3593aab3e0537.zip
Merge pull request #3581 from karalabe/accounts-polish
accounts, mobile: make account manager API a bit more uniform
Diffstat (limited to 'accounts')
-rw-r--r--accounts/account_manager.go6
-rw-r--r--accounts/accounts_test.go8
2 files changed, 7 insertions, 7 deletions
diff --git a/accounts/account_manager.go b/accounts/account_manager.go
index 6460b6e85..01dd62e25 100644
--- a/accounts/account_manager.go
+++ b/accounts/account_manager.go
@@ -113,9 +113,9 @@ func (am *Manager) Accounts() []Account {
return am.cache.accounts()
}
-// DeleteAccount deletes the key matched by account if the passphrase is correct.
-// If a contains no filename, the address must match a unique key.
-func (am *Manager) DeleteAccount(a Account, passphrase string) error {
+// Delete deletes the key matched by account if the passphrase is correct.
+// If the account contains no filename, the address must match a unique key.
+func (am *Manager) Delete(a Account, passphrase string) error {
// Decrypting the key isn't really necessary, but we do
// it anyway to check the password and zero out the key
// immediately afterwards.
diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go
index f276059e2..b3ab87d50 100644
--- a/accounts/accounts_test.go
+++ b/accounts/accounts_test.go
@@ -53,14 +53,14 @@ func TestManager(t *testing.T) {
if err := am.Update(a, "foo", "bar"); err != nil {
t.Errorf("Update error: %v", err)
}
- if err := am.DeleteAccount(a, "bar"); err != nil {
- t.Errorf("DeleteAccount error: %v", err)
+ if err := am.Delete(a, "bar"); err != nil {
+ t.Errorf("Delete error: %v", err)
}
if common.FileExist(a.File) {
- t.Errorf("account file %s should be gone after DeleteAccount", a.File)
+ t.Errorf("account file %s should be gone after Delete", a.File)
}
if am.HasAddress(a.Address) {
- t.Errorf("HasAccount(%x) should've returned true after DeleteAccount", a.Address)
+ t.Errorf("HasAccount(%x) should've returned true after Delete", a.Address)
}
}