block

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: 8 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) DeleteLastBlockData

func (r *Repository) DeleteLastBlockData() error

func (*Repository) GetById added in v2.12.0

func (r *Repository) GetById(id uint64) (*models.Block, error)

func (*Repository) GetLastFromDB

func (r *Repository) GetLastFromDB() (*models.Block, error)

func (*Repository) LinkWithValidators

func (r *Repository) LinkWithValidators(links []*models.BlockValidator) error

func (*Repository) Save

func (r *Repository) Save(block *models.Block) error

type Service

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

func NewBlockService

func NewBlockService(blockRepository *Repository, validatorRepository *validator.Repository, broadcastService *broadcast.Service) *Service

func (*Service) GetBlockCache

func (s *Service) GetBlockCache() (b *models.Block)

func (*Service) HandleBlockResponse

func (s *Service) HandleBlockResponse(response *api_pb.BlockResponse) error

Handle response and save block to DB

func (*Service) SetBlockCache

func (s *Service) SetBlockCache(b *models.Block)

Jump to

Keyboard shortcuts

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