2020-10-15 22:31:52 +00:00
|
|
|
package accounts
|
2020-07-16 05:08:16 +00:00
|
|
|
|
|
|
|
import (
|
2022-08-03 19:44:37 +00:00
|
|
|
"context"
|
2020-07-16 05:08:16 +00:00
|
|
|
|
|
|
|
"github.com/pkg/errors"
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/validator/keymanager/remote"
|
2020-07-16 05:08:16 +00:00
|
|
|
)
|
|
|
|
|
2022-08-03 19:44:37 +00:00
|
|
|
// WalletEdit changes a user's on-disk wallet configuration: remote gRPC
|
|
|
|
// credentials for remote signing, derivation paths for HD wallets, etc.
|
|
|
|
func (acm *AccountsCLIManager) WalletEdit(ctx context.Context) error {
|
|
|
|
encodedCfg, err := remote.MarshalOptionsFile(ctx, acm.keymanagerOpts)
|
2022-03-22 03:04:09 +00:00
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "could not marshal config file")
|
|
|
|
}
|
2022-08-03 19:44:37 +00:00
|
|
|
if err := acm.wallet.WriteKeymanagerConfigToDisk(ctx, encodedCfg); err != nil {
|
2022-03-22 03:04:09 +00:00
|
|
|
return errors.Wrap(err, "could not write config to disk")
|
2020-07-16 05:08:16 +00:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|