mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
8aa6057b60
* Wallet edit CLI Manager migration * TODO for code deduplication * s/walletEdit/remoteWalletEdit/g * s/walletEdit/remoteWalletEdit/g * remove unused struct field Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
22 lines
654 B
Go
22 lines
654 B
Go
package accounts
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/pkg/errors"
|
|
"github.com/prysmaticlabs/prysm/validator/keymanager/remote"
|
|
)
|
|
|
|
// 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)
|
|
if err != nil {
|
|
return errors.Wrap(err, "could not marshal config file")
|
|
}
|
|
if err := acm.wallet.WriteKeymanagerConfigToDisk(ctx, encodedCfg); err != nil {
|
|
return errors.Wrap(err, "could not write config to disk")
|
|
}
|
|
return nil
|
|
}
|