prysm-pulse/validator/accounts/iface/wallet.go
Raul Jordan 8c2fff3a75
Allow for 25th Word Passphrases in Mnemonics (#7645)
* advanced functionality, enable 25th word mnemonic passphrase

* 25th word passphrase

* add test

* added test to ensure differences when using the mnemonic 25th word

* better message

* passing tests

* fix up logic
2020-10-27 20:51:29 +00:00

31 lines
1.1 KiB
Go

package iface
import (
"context"
"io"
"github.com/prysmaticlabs/prysm/validator/keymanager"
)
// Wallet defines a struct which has capabilities and knowledge of how
// to read and write important accounts-related files to the filesystem.
// Useful for keymanagers to have persistent capabilities for accounts on-disk.
type Wallet interface {
// Methods to retrieve wallet and accounts metadata.
AccountsDir() string
Password() string
// Read methods for important wallet and accounts-related files.
ReadEncryptedSeedFromDisk(ctx context.Context) (io.ReadCloser, error)
ReadFileAtPath(ctx context.Context, filePath string, fileName string) ([]byte, error)
// Write methods to persist important wallet and accounts-related files to disk.
WriteFileAtPath(ctx context.Context, pathName string, fileName string, data []byte) error
WriteEncryptedSeedToDisk(ctx context.Context, encoded []byte) error
// Method for initializing a new keymanager.
InitializeKeymanager(ctx context.Context, cfg *InitializeKeymanagerConfig) (keymanager.IKeymanager, error)
}
type InitializeKeymanagerConfig struct {
SkipMnemonicConfirm bool
Mnemonic25thWord string
}