diff options
Diffstat (limited to 'accounts/keystore/key.go')
-rw-r--r-- | accounts/keystore/key.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 292b47b44..ecc955d74 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -124,14 +124,13 @@ func (k *Key) UnmarshalJSON(j []byte) (err error) { if err != nil { return err } - - privkey, err := hex.DecodeString(keyJSON.PrivateKey) + privkey, err := crypto.HexToECDSA(keyJSON.PrivateKey) if err != nil { return err } k.Address = common.BytesToAddress(addr) - k.PrivateKey = crypto.ToECDSA(privkey) + k.PrivateKey = privkey return nil } |