utils

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExtendedCommitInfo

func BuildExtendedCommitInfo(ec *types.ExtendedCommit, valSet *types.ValidatorSet, initialHeight int64, ap types.ABCIParams) abci.ExtendedCommitInfo

mostly copy-pasted/adjusted from https://github.com/p-offtermatt/cometbft/blob/ph/make-public/state/execution.go#L486 BuildExtendedCommitInfo populates an ABCI extended commit from the corresponding CometBFT extended commit ec, using the stored validator set from ec. It requires ec to include the original precommit votes along with the vote extensions from the last commit.

For heights below the initial height, for which we do not have the required data, it returns an empty record.

Assumes that the commit signatures are sorted according to validator index.

func BuildLastCommitInfo

func BuildLastCommitInfo(block *types.Block, lastValSet *types.ValidatorSet, initialHeight int64) abci.CommitInfo

func GetBlockIdFromBlock

func GetBlockIdFromBlock(block *types.Block) (*types.BlockID, error)

func MakeVote

func MakeVote(
	val types.PrivValidator,
	chainID string,
	valIndex int32,
	height int64,
	round int32,
	step int,
	blockID types.BlockID,
	time time.Time,
) (*types.Vote, error)

MakeVote creates a signed vote. Adapted from https://github.com/cometbft/cometbft/blob/9267594e0a17c01cc4a97b399ada5eaa8a734db5/internal/test/vote.go#L10.

Types

This section is empty.

Jump to

Keyboard shortcuts

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