From fc17a527bc2bd07fc30e16d161059a441042d5f1 Mon Sep 17 00:00:00 2001 From: zelig Date: Thu, 2 Jul 2015 22:58:00 +0100 Subject: fix account ordering * chronological order of creation * new naming scheme keystore/UTC---
* KeyStore2 -> KeyStore * backward compatibility * refactor keyStore methods --- accounts/account_manager.go | 6 +++--- accounts/accounts_test.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'accounts') 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) -- cgit v1.2.3