Change address in keystore

This commit is contained in:
AnilChinchawale 2019-03-17 16:13:27 +05:30
parent 9b13f2279e
commit 239f9702ce
2 changed files with 4 additions and 2 deletions

View file

@ -205,7 +205,8 @@ func writeKeyFile(file string, content []byte) error {
// UTC--<created_at UTC ISO8601>-<address hex>
func keyFileName(keyAddr common.Address) string {
ts := time.Now().UTC()
return fmt.Sprintf("UTC--%s--%s", toISO8601(ts), hex.EncodeToString(keyAddr[:]))
// return fmt.Sprintf("UTC--%s--%s", toISO8601(ts), hex.EncodeToString(keyAddr[:]))
return fmt.Sprintf("UTC--%s--%s", toISO8601(ts), keyAddr.String())
}
func toISO8601(t time.Time) string {

View file

@ -152,7 +152,8 @@ func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) {
MAC: hex.EncodeToString(mac),
}
encryptedKeyJSONV3 := encryptedKeyJSONV3{
hex.EncodeToString(key.Address[:]),
// hex.EncodeToString(key.Address[:]),
key.Address.String(),
cryptoStruct,
key.Id.String(),
version,