ve_testutils

package
v0.0.0-...-13dda56 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateExtendedCommitInfo

func CreateExtendedCommitInfo(
	commitInfo []cometabci.ExtendedVoteInfo,
) (cometabci.ExtendedCommitInfo, []byte, error)

CreateExtendedCommitInfo creates an extended commit info with the given commit info.

func CreateNilVoteExtensionInfo

func CreateNilVoteExtensionInfo(consAddress sdk.ConsAddress, power int64) (cometabci.ExtendedVoteInfo, error)

func CreateSignedExtendedCommitInfo

func CreateSignedExtendedCommitInfo(
	veInfo []SignedVEInfo,
) (cometabci.ExtendedCommitInfo, []byte, error)

func CreateSignedExtendedVoteInfo

func CreateSignedExtendedVoteInfo(veInfo SignedVEInfo) (cometabci.ExtendedVoteInfo, error)

CreateExtendedVoteInfoWithPower CreateExtendedVoteInfo creates an extended vote info with the given power, prices, timestamp and height.

func CreateSingleValidatorExtendedCommitInfo

func CreateSingleValidatorExtendedCommitInfo(
	consAddr sdk.ConsAddress,
	prices []vetypes.PricePair,
	sdaiConversionRate string,
) (cometabci.ExtendedCommitInfo, []byte, error)

func CreateVoteExtension

func CreateVoteExtension(
	prices []vetypes.PricePair,
	sdaiConversionRate string,
) vetypes.DaemonVoteExtension

CreateVoteExtension creates a vote extension with the given prices, timestamp and height.

func CreateVoteExtensionBytes

func CreateVoteExtensionBytes(
	prices []vetypes.PricePair,
	sdaiConversionRate string,
) ([]byte, error)

CreateVoteExtensionBytes creates a vote extension bytes with the given prices, timestamp and height.

func GetEmptyLocalLastCommit

func GetEmptyLocalLastCommit(
	validators []stakingtypes.Validator,
	height int64,
	round int64,
	chainId string,
) cometabci.ExtendedCommitInfo

func GetEmptyProposedLastCommit

func GetEmptyProposedLastCommit() cometabci.CommitInfo

func GetInjectedExtendedCommitInfoForTestApp

func GetInjectedExtendedCommitInfoForTestApp(
	stakingKeeper *stakingkeeper.Keeper,
	ctx sdk.Context,
	prices map[uint32]ve.VEPricePair,
	sdaiConversionRate string,
	height int64,
) (cometabci.ExtendedCommitInfo, []byte, error)

func GetVECacheEncodedPrice

func GetVECacheEncodedPrice(price *big.Int) ([]byte, error)

func GetVeEnabledCtx

func GetVeEnabledCtx(ctx sdk.Context, blockHeight int64) sdk.Context

func NewBlockInfo

func NewBlockInfo(
	misbehavior []abci.Misbehavior,
	validatorsHash []byte,
	proposerAddress []byte,
	lastCommit abci.CommitInfo,
) comet.BlockInfo

NewBlockInfo returns a new BlockInfo instance This function should be only used in tests

Types

type SignedVEInfo

type SignedVEInfo struct {
	Val                sdk.ConsAddress
	Power              int64
	Prices             []vetypes.PricePair
	SDaiConversionRate string
	Height             int64
	Round              int64
	ChainId            string
}

func NewDefaultSignedVeInfo

func NewDefaultSignedVeInfo(
	val sdk.ConsAddress,
	prices []vetypes.PricePair,
	sdaiConversionRate string,
) SignedVEInfo

Jump to

Keyboard shortcuts

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