mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
Rename Accounts-V2 to Accounts (#7545)
* rename accounts v2 * rename keymanager and fix imports * rename accounts-v2 instances * imports * build * build fix * deepsource * fix up broken aliases * imports * gaz * Update validator/accounts/accounts_import_test.go Co-authored-by: Ivan Martinez <ivanthegreatdev@gmail.com> * fmt Co-authored-by: Ivan Martinez <ivanthegreatdev@gmail.com>
This commit is contained in:
12
validator/accounts/iface/BUILD.bazel
Normal file
12
validator/accounts/iface/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@prysm//tools/go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["wallet.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/validator/accounts/iface",
|
||||
visibility = [
|
||||
"//validator:__pkg__",
|
||||
"//validator:__subpackages__",
|
||||
],
|
||||
deps = ["//validator/keymanager:go_default_library"],
|
||||
)
|
||||
26
validator/accounts/iface/wallet.go
Normal file
26
validator/accounts/iface/wallet.go
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
SetPassword(newPass 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, skipMnemonicConfirm bool) (keymanager.IKeymanager, error)
|
||||
}
|
||||
Reference in New Issue
Block a user