cli: implement ethereum presale wallet import via cli

This commit is contained in:
zelig
2015-03-24 16:19:11 +00:00
parent 34d5a6c156
commit d1b52efdb5
2 changed files with 59 additions and 27 deletions

View File

@ -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
}