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:
Raul Jordan
2021-12-02 09:58:49 -05:00
committed by GitHub
parent 1d216a8737
commit d3c97da4e1
12 changed files with 249 additions and 86 deletions

View File

@@ -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,
)
}

View File

@@ -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