Documentation ¶
Index ¶
- type Repository
- func (r Repository) DeleteStakesByValidatorIds(idList []uint64) error
- func (r Repository) DeleteStakesNotInListIds(idList []uint64) error
- func (r *Repository) FindAllByPK(validators []*models.Validator) ([]*models.Validator, error)
- func (r *Repository) FindIdByPk(pk string) (uint64, error)
- func (r *Repository) FindIdByPkOrCreate(pk string) (uint64, error)
- func (r Repository) ResetAllStatuses() error
- func (r *Repository) SaveAllIfNotExist(validators []*models.Validator) error
- func (r *Repository) SaveAllStakes(stakes []*models.Stake) error
- func (r *Repository) Update(validator *models.Validator) error
- func (r *Repository) UpdateAll(validators []*models.Validator) error
- type Service
- func (s *Service) GetStakesFromCandidateResponse(response *responses.CandidateResponse) ([]*models.Stake, error)
- func (s *Service) GetUpdateStakesJobChannel() chan uint64
- func (s *Service) GetUpdateValidatorsJobChannel() chan uint64
- func (s *Service) HandleBlockResponse(response *responses.BlockResponse) ([]*models.Validator, error)
- func (s *Service) HandleCandidateResponse(response *responses.CandidateResponse) (*models.Validator, []*models.Stake, error)
- func (s *Service) UpdateStakesWorker(jobs <-chan uint64)
- func (s *Service) UpdateValidatorsWorker(jobs <-chan uint64)
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) DeleteStakesByValidatorIds ¶
func (r Repository) DeleteStakesByValidatorIds(idList []uint64) error
func (Repository) DeleteStakesNotInListIds ¶
func (r Repository) DeleteStakesNotInListIds(idList []uint64) error
func (*Repository) FindAllByPK ¶
Find validators by PK Update cache Return slice of validators
func (*Repository) FindIdByPk ¶
func (r *Repository) FindIdByPk(pk string) (uint64, error)
Find validator with public key. Return Validator ID
func (*Repository) FindIdByPkOrCreate ¶
func (r *Repository) FindIdByPkOrCreate(pk string) (uint64, error)
Find validator with public key or create if not exist. Return Validator ID
func (Repository) ResetAllStatuses ¶
func (r Repository) ResetAllStatuses() error
func (*Repository) SaveAllIfNotExist ¶
func (r *Repository) SaveAllIfNotExist(validators []*models.Validator) error
Save list of validators if not exist
func (*Repository) SaveAllStakes ¶
func (r *Repository) SaveAllStakes(stakes []*models.Stake) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env *models.ExtenderEnvironment, nodeApi *minter_node_go_api.MinterNodeApi, repository *Repository, addressRepository *address.Repository, coinRepository *coin.Repository, logger *logrus.Entry) *Service
func (*Service) GetStakesFromCandidateResponse ¶
func (*Service) GetUpdateStakesJobChannel ¶
func (*Service) GetUpdateValidatorsJobChannel ¶
func (*Service) HandleBlockResponse ¶
func (s *Service) HandleBlockResponse(response *responses.BlockResponse) ([]*models.Validator, error)
Get validators PK from response and store it to validators table if not exist
func (*Service) HandleCandidateResponse ¶
func (*Service) UpdateStakesWorker ¶
func (*Service) UpdateValidatorsWorker ¶
Click to show internal directories.
Click to hide internal directories.