storage

package
v0.5.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: GPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByClusterID added in v0.4.7

func ByClusterID(clusterID []byte) func(share *types.SSVShare) bool

ByClusterID filters by cluster id.

func ByOperatorID added in v0.4.7

func ByOperatorID(operatorID spectypes.OperatorID) func(share *types.SSVShare) bool

ByOperatorID filters by operator ID.

func ByOperatorIDAndActive added in v0.4.7

func ByOperatorIDAndActive(operatorID spectypes.OperatorID) func(share *types.SSVShare) bool

ByOperatorIDAndActive filters not liquidated by operator ID and has beacon metadata.

func ByOperatorIDAndNotLiquidated added in v0.4.7

func ByOperatorIDAndNotLiquidated(operatorID spectypes.OperatorID) func(share *types.SSVShare) bool

ByOperatorIDAndNotLiquidated filters not liquidated and by operator ID.

func NotLiquidated added in v0.4.7

func NotLiquidated() func(share *types.SSVShare) bool

NotLiquidated filters not liquidated and by operator public key.

Types

type FilteredSharesFunc added in v0.4.7

type FilteredSharesFunc = func(logger *zap.Logger, f func(share *types.SSVShare) bool) ([]*types.SSVShare, error)

FilteredSharesFunc is a function that returns filtered shares

type GetOperatorData added in v0.2.0

type GetOperatorData = func(index uint64) (*OperatorData, bool, error)

GetOperatorData is a function that returns the operator data

type OperatorData added in v0.2.0

type OperatorData struct {
	ID           spectypes.OperatorID `json:"id"`
	PublicKey    []byte               `json:"publicKey"`
	OwnerAddress common.Address       `json:"ownerAddress"`
}

OperatorData the public data of an operator

type Operators added in v0.4.7

type Operators interface {
	GetOperatorDataByPubKey(logger *zap.Logger, operatorPubKey []byte) (*OperatorData, bool, error)
	GetOperatorData(id spectypes.OperatorID) (*OperatorData, bool, error)
	SaveOperatorData(logger *zap.Logger, operatorData *OperatorData) (bool, error)
	DeleteOperatorData(id spectypes.OperatorID) error
	ListOperators(logger *zap.Logger, from uint64, to uint64) ([]OperatorData, error)
	GetOperatorsPrefix() []byte
}

Operators is the interface for managing operators data

func NewOperatorsStorage

func NewOperatorsStorage(db basedb.IDb, prefix []byte) Operators

NewOperatorsStorage creates a new instance of Storage

type RecipientData added in v0.4.7

type RecipientData struct {
	Owner        common.Address             `json:"ownerAddress"`
	FeeRecipient bellatrix.ExecutionAddress `json:"feeRecipientAddress"`
}

RecipientData the public data of a recipient

type Recipients added in v0.4.7

type Recipients interface {
	GetRecipientData(owner common.Address) (*RecipientData, bool, error)
	GetRecipientDataMany(logger *zap.Logger, owners []common.Address) (map[common.Address]bellatrix.ExecutionAddress, error)
	SaveRecipientData(recipientData *RecipientData) (*RecipientData, error)
	DeleteRecipientData(owner common.Address) error
	GetRecipientsPrefix() []byte
}

Recipients is the interface for managing recipients data

func NewRecipientsStorage added in v0.4.7

func NewRecipientsStorage(db basedb.IDb, prefix []byte) Recipients

NewRecipientsStorage creates a new instance of Storage

type Shares added in v0.4.7

type Shares interface {
	eth1.RegistryStore

	SaveShare(logger *zap.Logger, share *types.SSVShare) error
	SaveShareMany(logger *zap.Logger, shares []*types.SSVShare) error
	GetShare(key []byte) (*types.SSVShare, bool, error)
	GetAllShares(logger *zap.Logger) ([]*types.SSVShare, error)
	GetFilteredShares(logger *zap.Logger, f func(share *types.SSVShare) bool) ([]*types.SSVShare, error)
	DeleteShare(key []byte) error
}

Shares is the interface for managing shares

func NewSharesStorage added in v0.4.7

func NewSharesStorage(db basedb.IDb, prefix []byte) Shares

NewSharesStorage creates new share storage

Jump to

Keyboard shortcuts

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