blocks

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValidityNotDecided = errors.New("block validity undecided")

Functions

func Add

func Add(db sql.Executor, block *types.Block) error

Add block to the database.

func ContextualValidity

func ContextualValidity(db sql.Executor, lid types.LayerID) ([]types.BlockContextualValidity, error)

ContextualValidity returns tuples with block id and contextual validity for all blocks in the layer.

func Get

func Get(db sql.Executor, id types.BlockID) (rst *types.Block, err error)

Get block with id from database.

func GetLayer

func GetLayer(db sql.Executor, id types.BlockID) (types.LayerID, error)

GetLayer returns the layer of a block.

func Has

func Has(db sql.Executor, id types.BlockID) (bool, error)

Has a block in the database.

func IDsInLayer

func IDsInLayer(db sql.Executor, lid types.LayerID) ([]types.BlockID, error)

IDsInLayer returns list of block ids in the layer.

func IsValid

func IsValid(db sql.Executor, id types.BlockID) (rst bool, err error)

IsValid returns true if block is verified.

func Layer

func Layer(db sql.Executor, lid types.LayerID) ([]*types.Block, error)

Layer returns full body blocks for layer.

func SetInvalid

func SetInvalid(db sql.Executor, id types.BlockID) error

SetInvalid updates blocks to an invalid status.

func SetValid

func SetValid(db sql.Executor, id types.BlockID) error

SetValid updates verified status for a block.

func UpdateValid

func UpdateValid(db sql.Executor, id types.BlockID, valid bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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