events

package
v2.14.14 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

func NewRepository

func NewRepository(db *pg.DB) *Repository

func (*Repository) GetRewardsByDay added in v2.12.0

func (r *Repository) GetRewardsByDay(date time.Time) ([]*models.AggregatedReward, error)

func (*Repository) SaveAggregatedRewards added in v2.12.0

func (r *Repository) SaveAggregatedRewards(rewards []*models.AggregatedReward) error

func (*Repository) SaveSlashes

func (r *Repository) SaveSlashes(slashes []*models.Slash) error

type Service

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

func NewService

func NewService(env *env.ExtenderEnvironment, repository *Repository, validatorRepository *validator.Repository,
	addressRepository *address.Repository, coinRepository *coin.Repository, coinService *coin.Service,
	blockRepository *block.Repository, balanceRepository *balance.Repository, broadcastService *broadcast.Service,
	logger *logrus.Entry, startBlock uint64) *Service

func (*Service) GetSaveRewardsJobChannel

func (s *Service) GetSaveRewardsJobChannel() chan []*models.Reward

func (*Service) GetSaveSlashesJobChannel

func (s *Service) GetSaveSlashesJobChannel() chan []*models.Slash

func (*Service) HandleEventResponse

func (s *Service) HandleEventResponse(blockHeight uint64, responseEvents *api_pb.EventsResponse) error

HandleEventResponse Handle response and save block to DB

func (*Service) SaveRewardsWorker

func (s *Service) SaveRewardsWorker(jobs <-chan []*models.Reward)

func (*Service) SaveSlashesWorker

func (s *Service) SaveSlashesWorker(jobs <-chan []*models.Slash)

Jump to

Keyboard shortcuts

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