layers

package
v0.2.15-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAggregatedHash

func GetAggregatedHash(db sql.Executor, lid types.LayerID) (types.Hash32, error)

GetAggregatedHash for layer.

func GetApplied

func GetApplied(db sql.Executor, lid types.LayerID) (rst types.BlockID, err error)

GetApplied for the applied block for layer.

func GetByStatus

func GetByStatus(db sql.Executor, status Status) (rst types.LayerID, err error)

GetByStatus return latest layer with the status.

func GetHareOutput

func GetHareOutput(db sql.Executor, lid types.LayerID) (rst types.BlockID, err error)

GetHareOutput for layer.

func GetHash

func GetHash(db sql.Executor, lid types.LayerID) (types.Hash32, error)

GetHash for layer.

func GetLastApplied

func GetLastApplied(db sql.Executor) (types.LayerID, error)

GetLastApplied for the applied block for layer.

func GetLatestStateHash

func GetLatestStateHash(db sql.Executor) (rst types.Hash32, err error)

GetLatestStateHash loads latest state hash.

func GetStateHash

func GetStateHash(db sql.Executor, lid types.LayerID) (rst types.Hash32, err error)

GetStateHash loads state hash for the layer.

func SetAggregatedHash

func SetAggregatedHash(db sql.Executor, lid types.LayerID, hash types.Hash32) error

SetAggregatedHash updates aggregated hash for layer.

func SetApplied

func SetApplied(db sql.Executor, lid types.LayerID, applied types.BlockID) error

SetApplied for the layer to a block id.

func SetHareOutput

func SetHareOutput(db sql.Executor, lid types.LayerID, output types.BlockID) error

SetHareOutput for the layer to a block id.

func SetHash

func SetHash(db sql.Executor, lid types.LayerID, hash types.Hash32) error

SetHash updates hash for layer.

func SetStatus

func SetStatus(db sql.Executor, lid types.LayerID, status Status) error

SetStatus updates status of the layer.

func UnsetAppliedFrom

func UnsetAppliedFrom(db sql.Executor, lid types.LayerID) error

UnsetAppliedFrom updates the applied block to nil for layer >= `lid`.

func UpdateStateHash

func UpdateStateHash(db sql.Executor, lid types.LayerID, hash types.Hash32) error

UpdateStateHash for the layer.

Types

type Status

type Status int8

Status of the layer.

const (
	// Latest layer that was added to db.
	Latest Status = iota
	// Processed layer is either synced from peers or updated by hare.
	Processed
	// Applied layer to the state.
	Applied
)

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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