stores

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2020 License: GPL-3.0 Imports: 16 Imported by: 0

README

Blox Eth Key Manager - Stores

blox.io

Store is a place that saves and fetches data used by a portfolio,wallet and accounts. It also stores sensitive information like a seed.

Currently there are the following implementations:

  • In memory storage (mostly used for testing as a quick storage setup)
  • (Hashicorp's Vault)[https://www.vaultproject.io]
Develop you own store

You could develop you own store, for example saving it to an S3, local file system and so on. To implement a store, simple override the methods below from here

// Implements methods to store and retrieve data
// Any encryption is done on the implementation level but is not obligatory
type Storage interface {
	Name() string
	///*
	//	Wallet specific
	// */
	SaveWallet(wallet Wallet) error
	// will return nil,err if no wallet was found
	OpenWallet() (Wallet, error)
	// will return an empty array for no accounts
	ListAccounts() ([]ValidatorAccount, error)

	///*
	//	Account specific
	// */
	SaveAccount(account ValidatorAccount) error
	// will return nil,nil if no account was found
	OpenAccount(accountId uuid.UUID) (ValidatorAccount, error)

	// could also bee set to nil
	SetEncryptor(encryptor types.Encryptor, password []byte)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestingFetchingNonExistingAccount

func TestingFetchingNonExistingAccount(storage core.Storage, t *testing.T)

func TestingListingAccounts

func TestingListingAccounts(storage core.Storage, t *testing.T)

func TestingNonExistingWallet

func TestingNonExistingWallet(storage core.Storage, t *testing.T)

func TestingOpenAccounts

func TestingOpenAccounts(storage core.Storage, t *testing.T)

func TestingOpeningAccount

func TestingOpeningAccount(storage core.Storage, account core.ValidatorAccount, t *testing.T)

func TestingSaveAttestation

func TestingSaveAttestation(storage core.SlashingStore, t *testing.T)

func TestingSaveHighestAttestation

func TestingSaveHighestAttestation(storage core.SlashingStore, t *testing.T)

func TestingSaveProposal

func TestingSaveProposal(storage core.SlashingStore, t *testing.T)

func TestingSavingAccounts

func TestingSavingAccounts(storage core.Storage, accounts []core.ValidatorAccount, t *testing.T)

func TestingWalletStorage

func TestingWalletStorage(storage core.Storage, t *testing.T)

func TestingWalletStorageWithEncryption

func TestingWalletStorageWithEncryption(storage core.Storage, t *testing.T)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL