store

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractEventStore

type ContractEventStore interface {
	SaveContractEvent(ctx context.Context, contractEvent structs.ContractEvent) error
	GetContractEvents(ctx context.Context, params structs.EventParams) (contractEvents []structs.ContractEvent, err error)
}

type DBDriver

type DBDriver interface {
	ContractEventStore
	SystemEventStore
	SkaleStore
}

type DataStore

type DataStore interface {
	ContractEventStore
	SystemEventStore
	SkaleStore
}

type SkaleStore

type SkaleStore interface {
	SaveNodes(ctx context.Context, nodes []structs.Node, removedNodeAddress common.Address) error
	GetNodes(ctx context.Context, params structs.NodeParams) (nodes []structs.Node, err error)

	SaveValidator(ctx context.Context, validator structs.Validator) error
	GetValidators(ctx context.Context, params structs.ValidatorParams) (validators []structs.Validator, err error)

	SaveDelegation(ctx context.Context, delegation structs.Delegation) error
	GetDelegations(ctx context.Context, params structs.DelegationParams) (delegations []structs.Delegation, err error)
	GetDelegationTimeline(ctx context.Context, params structs.DelegationParams) (delegations []structs.Delegation, err error)

	SaveAccount(ctx context.Context, account structs.Account) error
	GetAccounts(ctx context.Context, params structs.AccountParams) (accounts []structs.Account, err error)

	SaveValidatorStatistic(ctx context.Context, validatorID *big.Int, blockHeight uint64, blockTime time.Time, statisticsType structs.StatisticTypeVS, amount *big.Int) (err error)
	GetValidatorStatistics(ctx context.Context, params structs.ValidatorStatisticsParams) (validatorStatistics []structs.ValidatorStatistics, err error)
	GetValidatorStatisticsTimeline(ctx context.Context, params structs.ValidatorStatisticsParams) (validatorStatistics []structs.ValidatorStatistics, err error)

	GetTypesSummaryDelegations(ctx context.Context, params structs.DelegationParams) (delegations []structs.DelegationSummary, err error)

	UpdateCountsOfValidator(ctx context.Context, validatorID *big.Int) error
}

type Store

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

func New

func New(driver DBDriver) *Store

func (*Store) GetAccounts

func (s *Store) GetAccounts(ctx context.Context, params structs.AccountParams) (accounts []structs.Account, err error)

func (*Store) GetContractEvents

func (s *Store) GetContractEvents(ctx context.Context, params structs.EventParams) (contractEvents []structs.ContractEvent, err error)

func (*Store) GetDelegationTimeline

func (s *Store) GetDelegationTimeline(ctx context.Context, params structs.DelegationParams) (delegations []structs.Delegation, err error)

func (*Store) GetDelegations

func (s *Store) GetDelegations(ctx context.Context, params structs.DelegationParams) (delegations []structs.Delegation, err error)

func (*Store) GetNodes

func (s *Store) GetNodes(ctx context.Context, params structs.NodeParams) (nodes []structs.Node, err error)

func (*Store) GetSystemEvents

func (s *Store) GetSystemEvents(ctx context.Context, params structs.SystemEventParams) (event []structs.SystemEvent, err error)

func (*Store) GetTypesSummaryDelegations added in v0.0.4

func (s *Store) GetTypesSummaryDelegations(ctx context.Context, params structs.DelegationParams) (delegations []structs.DelegationSummary, err error)

func (*Store) GetValidatorStatistics

func (s *Store) GetValidatorStatistics(ctx context.Context, params structs.ValidatorStatisticsParams) (validatorStatistics []structs.ValidatorStatistics, err error)

func (*Store) GetValidatorStatisticsTimeline

func (s *Store) GetValidatorStatisticsTimeline(ctx context.Context, params structs.ValidatorStatisticsParams) (validatorStatistics []structs.ValidatorStatistics, err error)

func (*Store) GetValidators

func (s *Store) GetValidators(ctx context.Context, params structs.ValidatorParams) (validators []structs.Validator, err error)

func (*Store) SaveAccount

func (s *Store) SaveAccount(ctx context.Context, account structs.Account) error

func (*Store) SaveContractEvent

func (s *Store) SaveContractEvent(ctx context.Context, contractEvent structs.ContractEvent) error

func (*Store) SaveDelegation

func (s *Store) SaveDelegation(ctx context.Context, delegation structs.Delegation) error

func (*Store) SaveNodes

func (s *Store) SaveNodes(ctx context.Context, nodes []structs.Node, removedNodeAddress common.Address) error

func (*Store) SaveSystemEvent

func (s *Store) SaveSystemEvent(ctx context.Context, event structs.SystemEvent) error

func (*Store) SaveValidator

func (s *Store) SaveValidator(ctx context.Context, validator structs.Validator) error

func (*Store) SaveValidatorStatistic

func (s *Store) SaveValidatorStatistic(ctx context.Context, validatorID *big.Int, blockHeight uint64, blockTime time.Time, statisticsType structs.StatisticTypeVS, amount *big.Int) (err error)

func (*Store) UpdateCountsOfValidator

func (s *Store) UpdateCountsOfValidator(ctx context.Context, validatorID *big.Int) error

Update Params

type SystemEventStore

type SystemEventStore interface {
	SaveSystemEvent(ctx context.Context, event structs.SystemEvent) error
	GetSystemEvents(ctx context.Context, params structs.SystemEventParams) (events []structs.SystemEvent, err error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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