mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
Fix duplicated selectV1Keymanager (#6604)
* Fix duplicated selectV1Keymanager
This commit is contained in:
parent
d7bcea7906
commit
fe14c5086a
@ -178,6 +178,7 @@ contract in order to activate the validator client`,
|
||||
if cliCtx.String(flags.KeyManager.Name) != "" {
|
||||
pubKeysBytes48, success := node.ExtractPublicKeysFromKeymanager(
|
||||
cliCtx,
|
||||
nil, /* nil v1 keymanager */
|
||||
nil, /* nil v2 keymanager */
|
||||
)
|
||||
pubKeys, err = bytesutil.FromBytes48Array(pubKeysBytes48), success
|
||||
|
@ -112,7 +112,7 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) {
|
||||
}
|
||||
}
|
||||
|
||||
pubKeys, err := ExtractPublicKeysFromKeymanager(cliCtx, keyManagerV2)
|
||||
pubKeys, err := ExtractPublicKeysFromKeymanager(cliCtx, keyManagerV1, keyManagerV2)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -373,7 +373,7 @@ func clearDB(dataDir string, pubkeys [][48]byte, force bool) error {
|
||||
}
|
||||
|
||||
// ExtractPublicKeysFromKeymanager extracts only the public keys from the specified key manager.
|
||||
func ExtractPublicKeysFromKeymanager(cliCtx *cli.Context, keyManagerV2 v2.IKeymanager) ([][48]byte, error) {
|
||||
func ExtractPublicKeysFromKeymanager(cliCtx *cli.Context, keyManagerV1 v1.KeyManager, keyManagerV2 v2.IKeymanager) ([][48]byte, error) {
|
||||
var pubKeys [][48]byte
|
||||
var err error
|
||||
if featureconfig.Get().EnableAccountsV2 {
|
||||
@ -383,9 +383,5 @@ func ExtractPublicKeysFromKeymanager(cliCtx *cli.Context, keyManagerV2 v2.IKeyma
|
||||
}
|
||||
return pubKeys, nil
|
||||
}
|
||||
km, err := selectV1Keymanager(cliCtx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return km.FetchValidatingKeys()
|
||||
return keyManagerV1.FetchValidatingKeys()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user