Documentation ¶
Index ¶
- type Fixture
- func (f *Fixture) CommitInitialHeight(ctx context.Context, initialAppStateHash []byte, initialProposerIndex int, ...)
- func (f *Fixture) NewMirror() *tmmirror.Mirror
- func (f *Fixture) Precommitter(m *tmmirror.Mirror) Voter
- func (f *Fixture) Prevoter(m *tmmirror.Mirror) Voter
- func (f *Fixture) Store() *tmmemstore.MirrorStore
- func (f *Fixture) UseMetrics(t *testing.T, ctx context.Context) <-chan tmemetrics.Metrics
- func (f *Fixture) ValidatorStore() tmstore.ValidatorStore
- type Voter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
type Fixture struct { Log *slog.Logger Fx *tmconsensustest.StandardFixture // These channels are bidirectional in the fixture, // because they are write-only in the config. StateMachineRoundViewOut chan tmeil.StateMachineRoundView GossipStrategyOut chan tmelink.NetworkViewUpdate LagStateOut chan tmelink.LagState StateMachineRoundEntranceIn chan tmeil.StateMachineRoundEntrance ReplayedHeadersIn chan tmelink.ReplayedHeaderRequest Cfg tmmirror.MirrorConfig WatchdogCtx context.Context }
Fixture is a helper type to create a tmmirror.Mirror and its required inputs for tests involving a Mirror.
func (*Fixture) CommitInitialHeight ¶
func (f *Fixture) CommitInitialHeight( ctx context.Context, initialAppStateHash []byte, initialProposerIndex int, committerIdxs []int, )
CommitInitialHeight updates the round store, the network store, and the consensus fixture to have a commit at the initial height at round zero.
If the mirror is started after this call, / it is as though the mirror handled the expected sequence of messages to advance past the initial height and round.
func (*Fixture) Precommitter ¶
Precommitter returns a Voter for precommits.
func (*Fixture) Store ¶
func (f *Fixture) Store() *tmmemstore.MirrorStore
func (*Fixture) UseMetrics ¶
func (*Fixture) ValidatorStore ¶
func (f *Fixture) ValidatorStore() tmstore.ValidatorStore
type Voter ¶
type Voter interface { HandleProofs( ctx context.Context, height uint64, round uint32, votes map[string][]int, ) tmconsensus.HandleVoteProofsResult ProofsFromView(tmconsensus.RoundView) map[string]gcrypto.CommonMessageSignatureProof FullProofsFromRoundStateMaps( height uint64, round uint32, valSet tmconsensus.ValidatorSet, prevotes, precommits tmconsensus.SparseSignatureCollection, ) map[string]gcrypto.CommonMessageSignatureProof }
Voter is the interface returned from *Fixture.Prevoter and *Fixture.Precommitter to offer a consistent interface to handle prevote and precommit proofs, respectively.
This simplifies sets of mirror tests where the only difference is whether we are applying prevotes or precommits.