Documentation ¶
Index ¶
- type Repository
- type Service
- func (s *Service) GetSaveRewardsJobChannel() chan []*models.Reward
- func (s *Service) GetSaveSlashesJobChannel() chan []*models.Slash
- func (s *Service) HandleEventResponse(blockHeight uint64, responseEvents *api_pb.EventsResponse) error
- func (s *Service) SaveRewardsWorker(jobs <-chan []*models.Reward)
- func (s *Service) SaveSlashesWorker(jobs <-chan []*models.Slash)
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 (*Service) GetSaveSlashesJobChannel ¶
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 (*Service) SaveSlashesWorker ¶
Click to show internal directories.
Click to hide internal directories.