mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Ensure Slashing Protection Exports and Keymanager API Work According to Spec (#9938)
* password compliance * delete keys tests * changes to slashing protection exports * export tests pass * fix up failures * gaz * table driven tests for delete keystores * comment * rem deletion logic * look ma, no db * fix up tests * ineff * gaz * broken test fix * Update validator/keymanager/imported/delete.go * rem
This commit is contained in:
@@ -239,10 +239,14 @@ func ImportAccountsCli(cliCtx *cli.Context) error {
|
||||
// ImportAccounts can import external, EIP-2335 compliant keystore.json files as
|
||||
// new accounts into the Prysm validator wallet.
|
||||
func ImportAccounts(ctx context.Context, cfg *ImportAccountsConfig) ([]*ethpbservice.ImportedKeystoreStatus, error) {
|
||||
passwords := make([]string, len(cfg.Keystores))
|
||||
for i := 0; i < len(cfg.Keystores); i++ {
|
||||
passwords[i] = cfg.AccountPassword
|
||||
}
|
||||
return cfg.Importer.ImportKeystores(
|
||||
ctx,
|
||||
cfg.Keystores,
|
||||
[]string{cfg.AccountPassword},
|
||||
passwords,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -93,10 +93,12 @@ func TestListAccounts_ImportedKeymanager(t *testing.T) {
|
||||
|
||||
numAccounts := 5
|
||||
keystores := make([]*keymanager.Keystore, numAccounts)
|
||||
passwords := make([]string, numAccounts)
|
||||
for i := 0; i < numAccounts; i++ {
|
||||
keystores[i] = createRandomKeystore(t, password)
|
||||
passwords[i] = password
|
||||
}
|
||||
_, err = km.ImportKeystores(cliCtx.Context, keystores, []string{password})
|
||||
_, err = km.ImportKeystores(cliCtx.Context, keystores, passwords)
|
||||
require.NoError(t, err)
|
||||
|
||||
rescueStdout := os.Stdout
|
||||
|
||||
Reference in New Issue
Block a user