diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-25 00:19:11 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-27 03:00:18 +0800 |
commit | d1b52efdb581ca90613d2047b974d3a128f9bc58 (patch) | |
tree | 39148dfa9bf43062ec44bccd69d790218172725e /accounts/account_manager.go | |
parent | 34d5a6c156a014ce000b4f850f2b0f11533387f0 (diff) | |
download | go-tangerine-d1b52efdb581ca90613d2047b974d3a128f9bc58.tar.gz go-tangerine-d1b52efdb581ca90613d2047b974d3a128f9bc58.tar.zst go-tangerine-d1b52efdb581ca90613d2047b974d3a128f9bc58.zip |
cli: implement ethereum presale wallet import via cli
Diffstat (limited to 'accounts/account_manager.go')
-rw-r--r-- | accounts/account_manager.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/accounts/account_manager.go b/accounts/account_manager.go index 21ef46991..f063f8ca5 100644 --- a/accounts/account_manager.go +++ b/accounts/account_manager.go @@ -239,3 +239,15 @@ func (am *Manager) Import(path string, keyAuth string) (Account, error) { } return Account{Address: key.Address}, nil } + +func (am *Manager) ImportPreSaleKey(keyJSON []byte, password string) (acc Account, err error) { + var key *crypto.Key + key, err = crypto.ImportPreSaleKey(am.keyStore, keyJSON, password) + if err != nil { + return + } + if err = am.keyStore.StoreKey(key, password); err != nil { + return + } + return Account{Address: key.Address}, nil +} |