Documentation ¶
Index ¶
- Variables
- func WithAccepted(accepted bool) options.Option[Block]
- func WithConfirmed(confirmed bool) options.Option[Block]
- func WithQueued(queued bool) options.Option[Block]
- type 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
- type Gadget
- type 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
- 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)
Constants ¶
This section is empty.
Variables ¶
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ BlockAccepted: event.New1[*Block](), BlockConfirmed: event.New1[*Block](), SlotClosed: event.New1[*shrinkingmap.ShrinkingMap[models.BlockID, *Block]](), Error: event.New1[error](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
Types ¶
type Block ¶
Block represents a Block annotated with OTV related metadata.
func NewRootBlock ¶
func NewRootBlock(blockID models.BlockID, slotTimeProvider *slot.TimeProvider) *Block
func (*Block) IsAcceptanceQueued ¶
func (*Block) IsAccepted ¶
IsAccepted returns true if the Block was accepted.
func (*Block) IsConfirmationQueued ¶
func (*Block) IsConfirmed ¶
func (*Block) IsStronglyAccepted ¶
IsStronglyAccepted returns true if the Block was accepted through strong children.
func (*Block) IsStronglyConfirmed ¶
func (*Block) SetAcceptanceQueued ¶
func (*Block) SetAccepted ¶
SetAccepted sets the Block as accepted.
func (*Block) SetConfirmationQueued ¶
func (*Block) SetConfirmed ¶
type Gadget ¶
type Gadget interface { Events() *Events // IsBlockAccepted returns whether the given block is accepted. IsBlockAccepted(blockID models.BlockID) (accepted bool) IsBlockConfirmed(blockID models.BlockID) bool // IsMarkerAccepted returns whether the given marker is accepted. IsMarkerAccepted(marker markers.Marker) (accepted bool) FirstUnacceptedIndex(sequenceID markers.SequenceID) (firstUnacceptedIndex markers.Index) module.Interface }
type MockBlockGadget ¶
type MockBlockGadget struct { AcceptedBlocks models.BlockIDs AcceptedMarkers *markers.Markers module.Module // contains filtered or unexported fields }
MockBlockGadget mocks a block gadget marking all blocks as confirmed.
func NewMockAcceptanceGadget ¶
func NewMockAcceptanceGadget() *MockBlockGadget
func (*MockBlockGadget) AcceptedBlocksInSlot ¶
func (m *MockBlockGadget) AcceptedBlocksInSlot(index slot.Index) (blocks models.BlockIDs)
func (*MockBlockGadget) Events ¶
func (m *MockBlockGadget) Events() *Events
func (*MockBlockGadget) FirstUnacceptedIndex ¶
func (m *MockBlockGadget) FirstUnacceptedIndex(sequenceID markers.SequenceID) (firstUnacceptedIndex markers.Index)
func (*MockBlockGadget) IsBlockAccepted ¶
func (m *MockBlockGadget) IsBlockAccepted(blockID models.BlockID) bool
IsBlockAccepted mocks its interface function returning that all blocks are confirmed.
func (*MockBlockGadget) IsBlockConfirmed ¶
func (m *MockBlockGadget) IsBlockConfirmed(blockID models.BlockID) bool
func (*MockBlockGadget) IsMarkerAccepted ¶
func (m *MockBlockGadget) IsMarkerAccepted(marker markers.Marker) (accepted bool)
func (*MockBlockGadget) SetBlockAccepted ¶
func (m *MockBlockGadget) SetBlockAccepted(block *Block)
func (*MockBlockGadget) SetMarkersAccepted ¶
func (m *MockBlockGadget) SetMarkersAccepted(markers ...markers.Marker)
type TestFramework ¶
type TestFramework struct { Gadget Gadget Mesh *mesh.TestFramework VirtualVoting *booker.VirtualVotingTestFramework MemPool *mempool.TestFramework BlockDAG *blockdag.TestFramework Votes *votes.TestFramework // contains filtered or unexported fields }
func NewTestFramework ¶
func NewTestFramework(test *testing.T, gadget Gadget, meshTF *mesh.TestFramework) *TestFramework
func (*TestFramework) AssertBlockAccepted ¶
func (t *TestFramework) AssertBlockAccepted(blocksAccepted uint32)
func (*TestFramework) AssertBlockConfirmed ¶
func (t *TestFramework) AssertBlockConfirmed(blocksConfirmed uint32)
func (*TestFramework) AssertConflictsAccepted ¶
func (t *TestFramework) AssertConflictsAccepted(conflictsAccepted uint32)
func (*TestFramework) AssertConflictsRejected ¶
func (t *TestFramework) AssertConflictsRejected(conflictsRejected uint32)
func (*TestFramework) ValidateAcceptedBlocks ¶
func (t *TestFramework) ValidateAcceptedBlocks(expectedAcceptedBlocks map[string]bool)
func (*TestFramework) ValidateAcceptedMarker ¶
func (t *TestFramework) ValidateAcceptedMarker(expectedConflictIDs map[markers.Marker]bool)
func (*TestFramework) ValidateConfirmedBlocks ¶
func (t *TestFramework) ValidateConfirmedBlocks(expectedConfirmedBlocks map[string]bool)
func (*TestFramework) ValidateConflictAcceptance ¶
func (t *TestFramework) ValidateConflictAcceptance(expectedConflictIDs map[string]confirmation.State)
Click to show internal directories.
Click to hide internal directories.