aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/accounts_test.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-02-25 01:03:10 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-02-25 01:05:10 +0800
commit923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37 (patch)
tree8b268fcfcf2585c38db00d57b5bf5da4c2040473 /accounts/accounts_test.go
parent91a8c08f037c1ec737d15ce00c6720015347e0d6 (diff)
downloaddexon-923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37.tar.gz
dexon-923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37.tar.zst
dexon-923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37.zip
Fix key store address hex decoding and accounts test
Thanks to https://github.com/jaekwon for original fix!
Diffstat (limited to 'accounts/accounts_test.go')
-rw-r--r--accounts/accounts_test.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go
index 127334404..4e97de545 100644
--- a/accounts/accounts_test.go
+++ b/accounts/accounts_test.go
@@ -9,7 +9,7 @@ import (
)
func TestAccountManager(t *testing.T) {
- ks := crypto.NewKeyStorePlain(ethutil.DefaultDataDir())
+ ks := crypto.NewKeyStorePlain(ethutil.DefaultDataDir() + "/testaccounts")
am := NewAccountManager(ks)
pass := "" // not used but required by API
a1, err := am.NewAccount(pass)
@@ -18,4 +18,16 @@ func TestAccountManager(t *testing.T) {
if err != nil {
t.Fatal(err)
}
+
+ // Cleanup
+ accounts, err := am.Accounts()
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, account := range accounts {
+ err := am.DeleteAccount(account.Address, pass)
+ if err != nil {
+ t.Fatal(err)
+ }
+ }
}