ballots

package
v1.7.17 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(db sql.Executor, ballot *types.Ballot) error

Add ballot to the database.

func AllFirstInEpoch

func AllFirstInEpoch(db sql.Executor, epoch types.EpochID) ([]*types.Ballot, error)

func FirstInEpoch

func FirstInEpoch(db sql.Executor, atx types.ATXID, epoch types.EpochID) (*types.Ballot, error)

FirstInEpoch returns the first ballot referencing the specified ATX in the epoch. NOTE: it does not mark the ballot as malicious, if the smesher that published the ATX is!

func Get

func Get(db sql.Executor, id types.BallotID) (rst *types.Ballot, err error)

Get ballot with id from database.

func GetBlobSizes added in v1.4.1

func GetBlobSizes(db sql.Executor, ids [][]byte) (sizes []int, err error)

GetBlobSizes returns the sizes of the blobs corresponding to ballots with specified ids. For non-existent ballots, the corresponding items are set to -1.

func Has

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

Has a ballot in the database.

func IDsInLayer

func IDsInLayer(db sql.Executor, lid types.LayerID) (rst []types.BallotID, err error)

IDsInLayer returns ballots ids in the layer.

func LastInEpoch added in v1.2.2

func LastInEpoch(db sql.Executor, atx types.ATXID, epoch types.EpochID) (*types.Ballot, error)

LastInEpoch returns the last ballot referencing the specified ATX in the epoch. NOTE: it does not mark the ballot as malicious, if the smesher that published the ATX is!

func LatestLayer

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

LatestLayer gets the highest layer with ballots.

func Layer

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

Layer returns full body ballot for layer. NOTE: this function does not mark the ballot as malicious, if the smesher that published the ATX is!

func LayerBallotByNodeID

func LayerBallotByNodeID(db sql.Executor, lid types.LayerID, nodeID types.NodeID) (*types.Ballot, error)

LayerBallotByNodeID returns any ballot by the specified NodeID in a given layer.

func LoadBlob added in v1.4.1

func LoadBlob(ctx context.Context, db sql.Executor, id []byte, b *sql.Blob) error

LoadBlob loads ballot as an encoded blob, ready to be sent over the wire.

Types

This section is empty.

Jump to

Keyboard shortcuts

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