inmemory

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemStore

type InMemStore struct {
	// contains filtered or unexported fields
}

InMemStore implements core.Storage using in-memory store.

func NewInMemStore

func NewInMemStore(network core.Network) *InMemStore

NewInMemStore is the constructor of InMemStore.

func NewInMemStoreWithEncryptor

func NewInMemStoreWithEncryptor(network core.Network, encryptor encryptor2.Encryptor, password []byte) *InMemStore

NewInMemStoreWithEncryptor is the constructor of InMemStore.

func (*InMemStore) DeleteAccount

func (store *InMemStore) DeleteAccount(accountID uuid.UUID) error

DeleteAccount deletes account by its ID

func (*InMemStore) ListAccounts

func (store *InMemStore) ListAccounts() ([]core.ValidatorAccount, error)

ListAccounts returns an empty array for no accounts

func (*InMemStore) MarshalJSON

func (store *InMemStore) MarshalJSON() ([]byte, error)

MarshalJSON is the custom JSON marshaler

func (*InMemStore) Name

func (store *InMemStore) Name() string

Name provides the name of the store.

func (*InMemStore) Network

func (store *InMemStore) Network() core.Network

Network returns the network.

func (*InMemStore) OpenAccount

func (store *InMemStore) OpenAccount(accountID uuid.UUID) (core.ValidatorAccount, error)

OpenAccount returns nil,nil if no account was found

func (*InMemStore) OpenWallet

func (store *InMemStore) OpenWallet() (core.Wallet, error)

OpenWallet returns nil,nil if no wallet was found

func (*InMemStore) RetrieveHighestAttestation

func (store *InMemStore) RetrieveHighestAttestation(pubKey []byte) (*phase0.AttestationData, bool, error)

RetrieveHighestAttestation retrieves highest attestation

func (*InMemStore) RetrieveHighestProposal

func (store *InMemStore) RetrieveHighestProposal(pubKey []byte) (phase0.Slot, bool, error)

RetrieveHighestProposal returns highest proposal

func (*InMemStore) SaveAccount

func (store *InMemStore) SaveAccount(account core.ValidatorAccount) error

SaveAccount saves the given account

func (*InMemStore) SaveHighestAttestation

func (store *InMemStore) SaveHighestAttestation(pubKey []byte, attestation *phase0.AttestationData) error

SaveHighestAttestation saves the given highest attestation

func (*InMemStore) SaveHighestProposal

func (store *InMemStore) SaveHighestProposal(pubKey []byte, slot phase0.Slot) error

SaveHighestProposal saves the given highest attestation

func (*InMemStore) SaveWallet

func (store *InMemStore) SaveWallet(wallet core.Wallet) error

SaveWallet implements core.Storage interface.

func (*InMemStore) SetEncryptor

func (store *InMemStore) SetEncryptor(encryptor encryptor2.Encryptor, password []byte)

SetEncryptor is the encryptor setter

func (*InMemStore) UnmarshalJSON

func (store *InMemStore) UnmarshalJSON(data []byte) error

UnmarshalJSON is the custom JSON unmarshaler

Jump to

Keyboard shortcuts

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