common

package
v0.0.0-...-89de7d0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultOptions = []SetupOption{partition}
)

Functions

func ChangeVoteToNil

func ChangeVoteToNil() testlib.Action

func ChangeVoteToProposalMessage

func ChangeVoteToProposalMessage(proposalMessageLabel string) testlib.Action

func DiffCommits

func DiffCommits() testlib.Condition

func GetCommitBlockID

func GetCommitBlockID(ctx *testlib.Context) (string, bool)

func GetCurRound

func GetCurRound(ctx *testlib.Context) (int, bool)

func GetRandomReplica

func GetRandomReplica(_ *types.Event, c *testlib.Context) (types.ReplicaID, bool)

func HeightReached

func HeightReached(h int) testlib.Condition

func IsCommit

func IsCommit() testlib.Condition

func IsCommitForProposal

func IsCommitForProposal(prop string) testlib.Condition

func IsConsensusMessage

func IsConsensusMessage() testlib.Condition

func IsEventNewRound

func IsEventNewRound(r int) testlib.Condition

func IsFromHeight

func IsFromHeight(height int) testlib.Condition

func IsMessageFromCurRound

func IsMessageFromCurRound() testlib.Condition

func IsMessageFromPart

func IsMessageFromPart(partS string) testlib.Condition

func IsMessageFromRound

func IsMessageFromRound(round int) testlib.Condition

func IsMessageToPart

func IsMessageToPart(partS string) testlib.Condition

func IsMessageType

func IsMessageType(t util.MessageType) testlib.Condition

func IsNewHeightRound

func IsNewHeightRound(h int, r int) testlib.Condition

func IsNewHeightRoundFromPart

func IsNewHeightRoundFromPart(p string, h, r int) testlib.Condition

func IsNilCommit

func IsNilCommit() testlib.Condition

func IsNilVote

func IsNilVote() testlib.Condition

func IsNotNilVote

func IsNotNilVote() testlib.Condition

func IsProposalEq

func IsProposalEq(proposalLabel string) testlib.Condition

func IsVoteForProposal

func IsVoteForProposal(proposalLabel string) testlib.Condition

func IsVoteFromFaulty

func IsVoteFromFaulty() testlib.Condition

func IsVoteFromPart

func IsVoteFromPart(partS string) testlib.Condition

func MessageCurRoundGt

func MessageCurRoundGt(m int) testlib.Condition

func RandomReplicaFromPart

func RandomReplicaFromPart(partS string) testlib.ReplicaFunc

func RecordProposal

func RecordProposal(key string) testlib.Action

func RoundReached

func RoundReached(r int) testlib.Condition

RoundReached returns true if all replicas have reached the specified round Should be used with TrackRound handler!

func Setup

func Setup(sysParams *SystemParams, options ...SetupOption) func(*testlib.Context) error

func TrackRoundAll

func TrackRoundAll(e *types.Event, c *testlib.Context) (messages []*types.Message, handled bool)

func TrackRoundTwoThirds

func TrackRoundTwoThirds(e *types.Event, c *testlib.Context) (messages []*types.Message, handled bool)

func TwoFMinus1

func TwoFMinus1() func(*types.Event, *testlib.Context) (int, bool)

Types

type SetupOption

type SetupOption func(*testlib.Context)

func PickRandomReplica

func PickRandomReplica() SetupOption

type SystemParams

type SystemParams struct {
	N int
	F int
}

func NewSystemParams

func NewSystemParams(n int) *SystemParams

Jump to

Keyboard shortcuts

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