diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-14 19:55:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-14 19:55:08 +0800 |
commit | f18ec51cb3959cc662bfc7b84314cd1d3b1541b5 (patch) | |
tree | 1c3d99407624dc791db0cb6c135bd2bd1dfc56cf /ethereal/ui/library.go | |
parent | e8147cf7c6f508910698e6743ad347c78010ffe3 (diff) | |
download | go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.gz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.bz2 go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.lz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.xz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.zst go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.zip |
Switched to new keyring methods
Diffstat (limited to 'ethereal/ui/library.go')
-rw-r--r-- | ethereal/ui/library.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ethereal/ui/library.go b/ethereal/ui/library.go index c889efb45..267108195 100644 --- a/ethereal/ui/library.go +++ b/ethereal/ui/library.go @@ -34,10 +34,13 @@ func (lib *EthLib) ImportAndSetPrivKey(privKey string) bool { } func (lib *EthLib) CreateAndSetPrivKey() (string, string, string, string) { - pub, prv := secp256k1.GenerateKeyPair() - pair := ðutil.Key{PrivateKey: prv, PublicKey: pub} - ethutil.Config.Db.Put([]byte("KeyRing"), pair.RlpEncode()) - mne := ethutil.MnemonicEncode(ethutil.Hex(prv)) + _, prv := secp256k1.GenerateKeyPair() + keyPair, err := ethutil.GetKeyRing().NewKeyPair(prv) + if err != nil { + panic(err) + } + + mne := ethutil.MnemonicEncode(ethutil.Hex(keyPair.PrivateKey)) mnemonicString := strings.Join(mne, " ") - return mnemonicString, fmt.Sprintf("%x", pair.Address()), fmt.Sprintf("%x", prv), fmt.Sprintf("%x", pub) + return mnemonicString, fmt.Sprintf("%x", keyPair.Address()), ethutil.Hex(keyPair.PrivateKey), ethutil.Hex(keyPair.PublicKey) } |