future_rights

package
v0.0.0-...-71505b4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const BlocksRangeSize = 256

Variables

This section is empty.

Functions

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)

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)
	BlocksInCycle() int64
}

type RightsRepo

type RightsRepo interface {
	List(limit, offset uint, filter models.BakingRightFilter) (rights []models.FutureBakingRight, err error)
	Find(filter models.BakingRightFilter) (found bool, right 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
}

Jump to

Keyboard shortcuts

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