factory

package
v0.8.14 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTestChainID = "test-chain"
)

Variables

View Source
var (
	DefaultTestTime = time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)
)

Functions

func MakeBlockID

func MakeBlockID() types.BlockID

func MakeBlockIDWithHash

func MakeBlockIDWithHash(hash []byte) types.BlockID

func MakeCommit

func MakeCommit(blockID types.BlockID, height int64, round int32,
	voteSet *types.VoteSet, validators []types.PrivValidator, now time.Time) (*types.Commit, error)

func MakeHeader

func MakeHeader(h *types.Header) (*types.Header, error)

MakeHeader fills the rest of the contents of the header such that it passes validate basic

func MakeRandomHeader

func MakeRandomHeader() *types.Header

func MakeTenTxs

func MakeTenTxs(height int64) (txs []types.Tx)

func MakeTxs

func MakeTxs(height int64, num int) (txs []types.Tx)

MakeTxs is a helper function to generate mock transactions by given the block height and the transaction numbers.

func MakeVersion

func MakeVersion() version.Consensus

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)

func RandGenesisDoc

func RandGenesisDoc(
	config *cfg.Config,
	numValidators int,
	randPower bool,
	minPower int64) (*types.GenesisDoc, []types.PrivValidator)

func RandValidator

func RandValidator(randPower bool, minPower int64) (*types.Validator, types.PrivValidator)

func RandValidatorSet

func RandValidatorSet(numValidators int, votingPower int64) (*types.ValidatorSet, []types.PrivValidator)

func RandomAddress

func RandomAddress() []byte

func RandomHash

func RandomHash() []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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