diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-04-12 22:51:09 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-04-12 22:51:09 +0800 |
commit | 1e9b504ee7c7ebfd4b2658c66fad53fe6d440811 (patch) | |
tree | 66d229bcfb3381fe0964faf573fc6cf6b0073c75 /cmd/gethrpctest | |
parent | 33e4f51749cdfcb9125159aae8481a8130e50062 (diff) | |
parent | 6498df7b0290139df57629568d824dfa242900cc (diff) | |
download | go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.gz go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.bz2 go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.lz go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.xz go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.tar.zst go-tangerine-1e9b504ee7c7ebfd4b2658c66fad53fe6d440811.zip |
Merge pull request #2284 from fjl/accounts-addr-cache
accounts: cache key addresses
Diffstat (limited to 'cmd/gethrpctest')
-rw-r--r-- | cmd/gethrpctest/main.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/gethrpctest/main.go b/cmd/gethrpctest/main.go index 4843f8658..2e07e9426 100644 --- a/cmd/gethrpctest/main.go +++ b/cmd/gethrpctest/main.go @@ -108,24 +108,23 @@ func MakeSystemNode(keydir string, privkey string, test *tests.BlockTest) (*node return nil, err } // Create the keystore and inject an unlocked account if requested - keystore := crypto.NewKeyStorePassphrase(keydir, crypto.StandardScryptN, crypto.StandardScryptP) - accman := accounts.NewManager(keystore) - + accman := accounts.NewPlaintextManager(keydir) if len(privkey) > 0 { key, err := crypto.HexToECDSA(privkey) if err != nil { return nil, err } - if err := keystore.StoreKey(crypto.NewKeyFromECDSA(key), ""); err != nil { + a, err := accman.ImportECDSA(key, "") + if err != nil { return nil, err } - if err := accman.Unlock(crypto.NewKeyFromECDSA(key).Address, ""); err != nil { + if err := accman.Unlock(a, ""); err != nil { return nil, err } } // Initialize and register the Ethereum protocol db, _ := ethdb.NewMemDatabase() - if _, err := test.InsertPreState(db, accman); err != nil { + if _, err := test.InsertPreState(db); err != nil { return nil, err } ethConf := ð.Config{ |