diff options
author | zelig <viktor.tron@gmail.com> | 2015-07-03 05:58:00 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-07-03 10:19:32 +0800 |
commit | fc17a527bc2bd07fc30e16d161059a441042d5f1 (patch) | |
tree | 9a3c5b52c16043f61c1ddf73311ae50a2061a039 /accounts | |
parent | a4df9d74eabb3bef8449744c4fe966572586dc39 (diff) | |
download | dexon-fc17a527bc2bd07fc30e16d161059a441042d5f1.tar.gz dexon-fc17a527bc2bd07fc30e16d161059a441042d5f1.tar.zst dexon-fc17a527bc2bd07fc30e16d161059a441042d5f1.zip |
fix account ordering
* chronological order of creation
* new naming scheme keystore/UTC--<created_at UTC ISO8601>-<address hex>
* KeyStore2 -> KeyStore
* backward compatibility
* refactor keyStore methods
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/account_manager.go | 6 | ||||
-rw-r--r-- | accounts/accounts_test.go | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/accounts/account_manager.go b/accounts/account_manager.go index 4519c8420..eb2672a7d 100644 --- a/accounts/account_manager.go +++ b/accounts/account_manager.go @@ -26,7 +26,7 @@ This abstracts part of a user's interaction with an account she controls. It's not an abstraction of core Ethereum accounts data type / logic - for that see the core processing code of blocks / txs. -Currently this is pretty much a passthrough to the KeyStore2 interface, +Currently this is pretty much a passthrough to the KeyStore interface, and accounts persistence is derived from stored keys' addresses */ @@ -54,7 +54,7 @@ type Account struct { } type Manager struct { - keyStore crypto.KeyStore2 + keyStore crypto.KeyStore unlocked map[common.Address]*unlocked mutex sync.RWMutex } @@ -64,7 +64,7 @@ type unlocked struct { abort chan struct{} } -func NewManager(keyStore crypto.KeyStore2) *Manager { +func NewManager(keyStore crypto.KeyStore) *Manager { return &Manager{ keyStore: keyStore, unlocked: make(map[common.Address]*unlocked), diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index 8bd70880c..4b94b78fd 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -98,10 +98,11 @@ func TestOverrideUnlock(t *testing.T) { if err != ErrLocked { t.Fatal("Signing should've failed with ErrLocked timeout expired, got ", err) } - } -func tmpKeyStore(t *testing.T, new func(string) crypto.KeyStore2) (string, crypto.KeyStore2) { +// + +func tmpKeyStore(t *testing.T, new func(string) crypto.KeyStore) (string, crypto.KeyStore) { d, err := ioutil.TempDir("", "eth-keystore-test") if err != nil { t.Fatal(err) |