mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Reopenning fix for keystore field name change to align with EIP2335 (#12530)
* adding changes * fixing deepsource
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
// ExtractKeystores retrieves the secret keys for specified public keys
|
||||
// in the function input, encrypts them using the specified password,
|
||||
// and returns their respective EIP-2335 keystores.
|
||||
func (_ *Keymanager) ExtractKeystores(
|
||||
func (*Keymanager) ExtractKeystores(
|
||||
_ context.Context, publicKeys []bls.PublicKey, password string,
|
||||
) ([]*keymanager.Keystore, error) {
|
||||
lock.Lock()
|
||||
@@ -44,11 +44,11 @@ func (_ *Keymanager) ExtractKeystores(
|
||||
return nil, err
|
||||
}
|
||||
keystores[i] = &keymanager.Keystore{
|
||||
Crypto: cryptoFields,
|
||||
ID: id.String(),
|
||||
Pubkey: fmt.Sprintf("%x", pubKeyBytes),
|
||||
Version: encryptor.Version(),
|
||||
Name: encryptor.Name(),
|
||||
Crypto: cryptoFields,
|
||||
ID: id.String(),
|
||||
Pubkey: fmt.Sprintf("%x", pubKeyBytes),
|
||||
Version: encryptor.Version(),
|
||||
Description: encryptor.Name(),
|
||||
}
|
||||
}
|
||||
return keystores, nil
|
||||
|
||||
@@ -31,11 +31,11 @@ func createRandomKeystore(t testing.TB, password string) *keymanager.Keystore {
|
||||
cryptoFields, err := encryptor.Encrypt(validatingKey.Marshal(), password)
|
||||
require.NoError(t, err)
|
||||
return &keymanager.Keystore{
|
||||
Crypto: cryptoFields,
|
||||
Pubkey: fmt.Sprintf("%x", pubKey),
|
||||
ID: id.String(),
|
||||
Version: encryptor.Version(),
|
||||
Name: encryptor.Name(),
|
||||
Crypto: cryptoFields,
|
||||
Pubkey: fmt.Sprintf("%x", pubKey),
|
||||
ID: id.String(),
|
||||
Version: encryptor.Version(),
|
||||
Description: encryptor.Name(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,12 +83,13 @@ type AccountLister interface {
|
||||
|
||||
// Keystore json file representation as a Go struct.
|
||||
type Keystore struct {
|
||||
Crypto map[string]interface{} `json:"crypto"`
|
||||
ID string `json:"uuid"`
|
||||
Pubkey string `json:"pubkey"`
|
||||
Version uint `json:"version"`
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Crypto map[string]interface{} `json:"crypto"`
|
||||
ID string `json:"uuid"`
|
||||
Pubkey string `json:"pubkey"`
|
||||
Version uint `json:"version"`
|
||||
Description string `json:"description"`
|
||||
Name string `json:"name,omitempty"` // field deprecated in favor of description, EIP2335
|
||||
Path string `json:"path"`
|
||||
}
|
||||
|
||||
// Kind defines an enum for either local, derived, or remote-signing
|
||||
|
||||
Reference in New Issue
Block a user