future_rights

package
v0.0.0-...-80b2b3e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const BlocksRangeSize = 256

Variables

This section is empty.

Functions

func SaveFutureEndorsementRightsForBlockRange

func SaveFutureEndorsementRightsForBlockRange(ctx context.Context, blockFrom, blockTo, headLevel int64, unit UnitOfWork, provider RightsProvider) (int, error)

func SaveFutureRightsForBlockRange

func SaveFutureRightsForBlockRange(ctx context.Context, blockFrom, blockTo, headLevel int64, unit UnitOfWork, provider RightsProvider) (int, error)

func SaveNewBakingRights

func SaveNewBakingRights(ctx context.Context, unit UnitOfWork, provider RightsProvider) (count int, err error)

func SaveNewEndorsementRights

func SaveNewEndorsementRights(ctx context.Context, unit UnitOfWork, provider RightsProvider) (count int, err error)

Types

type BlocksRepo

type BlocksRepo interface {
	Last() (block models.Block, err error)
}

type RightsProvider

type RightsProvider interface {
	RightsFor(ctx context.Context, blockFrom, blockTo, currentHead int64) ([]models.FutureBakingRight, error)
	EndorsementRightsFor(ctx context.Context, blockFrom, blockTo, currentHead int64) ([]models.EndorsementRight, error)
	CyclesBlocksCount(cycle int64) int64
}

type RightsRepo

type RightsRepo interface {
	List(limit, offset uint, filter models.RightFilter) (rights []models.FutureBakingRight, err error)
	Create(right models.FutureBakingRight) error
}

type UnitOfWork

type UnitOfWork interface {
	Start(ctx context.Context)
	RollbackUnlessCommitted()
	Commit() error
	GetBlock() block.Repo
	GetFutureBakingRight() future_baking_rights.Repo
	GetFutureEndorsementRight() future_endorsement_rights.Repo
}

Jump to

Keyboard shortcuts

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