Versions in this module Expand all Collapse all v0 v0.1.1 Oct 1, 2023 v0.1.0 Sep 29, 2023 Changes in this version + var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { ... }) + func WithAccepted(accepted bool) options.Option[Block] + func WithConfirmed(confirmed bool) options.Option[Block] + func WithQueued(queued bool) options.Option[Block] + type Block struct + func NewBlock(virtualVotingBlock *booker.Block, opts ...options.Option[Block]) (newBlock *Block) + func NewRootBlock(blockID models.BlockID, slotTimeProvider *slot.TimeProvider) *Block + func (b *Block) IsAcceptanceQueued() bool + func (b *Block) IsAccepted() bool + func (b *Block) IsConfirmationQueued() bool + func (b *Block) IsConfirmed() bool + func (b *Block) IsStronglyAccepted() bool + func (b *Block) IsStronglyConfirmed() bool + func (b *Block) SetAcceptanceQueued() (wasUpdated bool) + func (b *Block) SetAccepted(weakly bool) (wasUpdated bool) + func (b *Block) SetConfirmationQueued() (wasUpdated bool) + func (b *Block) SetConfirmed(weakly bool) (wasUpdated bool) + type Events struct + BlockAccepted *event.Event1[*Block] + BlockConfirmed *event.Event1[*Block] + Error *event.Event1[error] + SlotClosed *event.Event1[*shrinkingmap.ShrinkingMap[models.BlockID, *Block]] + type Gadget interface + Events func() *Events + FirstUnacceptedIndex func(sequenceID markers.SequenceID) (firstUnacceptedIndex markers.Index) + IsBlockAccepted func(blockID models.BlockID) (accepted bool) + IsBlockConfirmed func(blockID models.BlockID) bool + IsMarkerAccepted func(marker markers.Marker) (accepted bool) + type MockBlockGadget struct + AcceptedBlocks models.BlockIDs + AcceptedMarkers *markers.Markers + func NewMockAcceptanceGadget() *MockBlockGadget + func (m *MockBlockGadget) AcceptedBlocksInSlot(index slot.Index) (blocks models.BlockIDs) + func (m *MockBlockGadget) Events() *Events + func (m *MockBlockGadget) FirstUnacceptedIndex(sequenceID markers.SequenceID) (firstUnacceptedIndex markers.Index) + func (m *MockBlockGadget) IsBlockAccepted(blockID models.BlockID) bool + func (m *MockBlockGadget) IsBlockConfirmed(blockID models.BlockID) bool + func (m *MockBlockGadget) IsMarkerAccepted(marker markers.Marker) (accepted bool) + func (m *MockBlockGadget) SetBlockAccepted(block *Block) + func (m *MockBlockGadget) SetMarkersAccepted(markers ...markers.Marker) + type TestFramework struct + BlockDAG *blockdag.TestFramework + Gadget Gadget + MemPool *mempool.TestFramework + Mesh *mesh.TestFramework + VirtualVoting *booker.VirtualVotingTestFramework + Votes *votes.TestFramework + func NewTestFramework(test *testing.T, gadget Gadget, meshTF *mesh.TestFramework) *TestFramework + func (t *TestFramework) AssertBlockAccepted(blocksAccepted uint32) + func (t *TestFramework) AssertBlockConfirmed(blocksConfirmed uint32) + func (t *TestFramework) AssertConflictsAccepted(conflictsAccepted uint32) + func (t *TestFramework) AssertConflictsRejected(conflictsRejected uint32) + func (t *TestFramework) ValidateAcceptedBlocks(expectedAcceptedBlocks map[string]bool) + func (t *TestFramework) ValidateAcceptedMarker(expectedConflictIDs map[markers.Marker]bool) + func (t *TestFramework) ValidateConfirmedBlocks(expectedConfirmedBlocks map[string]bool) + func (t *TestFramework) ValidateConflictAcceptance(expectedConflictIDs map[string]confirmation.State)