Documentation
¶
Index ¶
- Variables
- func WithBookerOptions(opts ...options.Option[markerbooker.Booker]) options.Option[TestFramework]
- func WithEngineOptions(opts ...options.Option[engine.Engine]) options.Option[TestFramework]
- func WithGenesisUnixTime(unixTime int64) options.Option[TestFramework]
- func WithSlotNotarizationOptions(opts ...options.Option[slotnotarization.Manager]) options.Option[TestFramework]
- func WithTimeSinceConfirmationThreshold(timeSinceConfirmationThreshold time.Duration) options.Option[TipManager]
- func WithTipManagerOptions(opts ...options.Option[TipManager]) options.Option[TestFramework]
- func WithWidth(maxWidth int) options.Option[TipManager]
- type Events
- type TestFramework
- func (t *TestFramework) AssertEqualBlocks(actualBlocks, expectedBlocks models.BlockIDs)
- func (t *TestFramework) AssertIsPastConeTimestampCorrect(blockAlias string, expected bool)
- func (t *TestFramework) AssertTipCount(expectedTipCount int)
- func (t *TestFramework) AssertTips(expectedTips models.BlockIDs)
- func (t *TestFramework) AssertTipsAdded(count uint32)
- func (t *TestFramework) AssertTipsRemoved(count uint32)
- func (t *TestFramework) FormCommitment(index slot.Index, acceptedBlocksAliases []string, prevIndex slot.Index) (cm *commitment.Commitment)
- func (t *TestFramework) IssueBlocksAndSetAccepted(aliases ...string)
- func (t *TestFramework) SetAcceptedTime(acceptedTime time.Time)
- func (t *TestFramework) SetBlocksAccepted(aliases ...string)
- func (t *TestFramework) SetMarkersAccepted(m ...markers.Marker)
- func (t *TestFramework) SlotTimeProvider() *slot.TimeProvider
- type TipManager
- func (t *TipManager) AddTip(block *scheduler.Block)
- func (t *TipManager) AddTipNonMonotonic(block *scheduler.Block)
- func (t *TipManager) AllTips() (allTips []*scheduler.Block)
- func (t *TipManager) DeleteTip(block *scheduler.Block) (deleted bool)
- func (t *TipManager) EvictTSCCache(index slot.Index)
- func (t *TipManager) IsPastConeTimestampCorrect(block *booker.Block) (timestampValid bool)
- func (t *TipManager) LinkTo(engine *engine.Engine)
- func (t *TipManager) RemoveStrongParents(block *models.Block)
- func (t *TipManager) TipCount() int
- func (t *TipManager) Tips(countParents int) (parents models.BlockIDs)
- type TipsConflictTracker
- func (c *TipsConflictTracker) AddTip(block *scheduler.Block, blockConflictIDs utxo.TransactionIDs)
- func (c *TipsConflictTracker) Cleanup()
- func (c *TipsConflictTracker) MissingConflicts(amount int) (missingConflicts utxo.TransactionIDs)
- func (c *TipsConflictTracker) RemoveTip(block *scheduler.Block)
Constants ¶
This section is empty.
Variables ¶
View Source
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) { return &Events{ TipAdded: event.New1[*scheduler.Block](), TipRemoved: event.New1[*scheduler.Block](), } })
NewEvents contains the constructor of the Events object (it is generated by a generic factory).
Functions ¶
func WithBookerOptions ¶
func WithBookerOptions(opts ...options.Option[markerbooker.Booker]) options.Option[TestFramework]
func WithEngineOptions ¶
func WithGenesisUnixTime ¶
func WithGenesisUnixTime(unixTime int64) options.Option[TestFramework]
func WithSlotNotarizationOptions ¶
func WithSlotNotarizationOptions(opts ...options.Option[slotnotarization.Manager]) options.Option[TestFramework]
func WithTimeSinceConfirmationThreshold ¶
func WithTimeSinceConfirmationThreshold(timeSinceConfirmationThreshold time.Duration) options.Option[TipManager]
WithTimeSinceConfirmationThreshold returns an option that sets the time since confirmation threshold.
func WithTipManagerOptions ¶
func WithTipManagerOptions(opts ...options.Option[TipManager]) options.Option[TestFramework]
Types ¶
type Events ¶
type Events struct {
// Fired when a tip is added.
TipAdded *event.Event1[*scheduler.Block]
// Fired when a tip is removed.
TipRemoved *event.Event1[*scheduler.Block]
event.Group[Events, *Events]
}
Events represents events happening on the TipManager.
type TestFramework ¶
type TestFramework struct {
Instance *TipManager
Engine *engine.Engine
Mesh *mesh.TestFramework
// contains filtered or unexported fields
}
func NewTestFramework ¶
func NewTestFramework(test *testing.T, workers *workerpool.Group, opts ...options.Option[TestFramework]) (t *TestFramework)
func (*TestFramework) AssertEqualBlocks ¶
func (t *TestFramework) AssertEqualBlocks(actualBlocks, expectedBlocks models.BlockIDs)
func (*TestFramework) AssertIsPastConeTimestampCorrect ¶
func (t *TestFramework) AssertIsPastConeTimestampCorrect(blockAlias string, expected bool)
func (*TestFramework) AssertTipCount ¶
func (t *TestFramework) AssertTipCount(expectedTipCount int)
func (*TestFramework) AssertTips ¶
func (t *TestFramework) AssertTips(expectedTips models.BlockIDs)
func (*TestFramework) AssertTipsAdded ¶
func (t *TestFramework) AssertTipsAdded(count uint32)
func (*TestFramework) AssertTipsRemoved ¶
func (t *TestFramework) AssertTipsRemoved(count uint32)
func (*TestFramework) FormCommitment ¶
func (t *TestFramework) FormCommitment(index slot.Index, acceptedBlocksAliases []string, prevIndex slot.Index) (cm *commitment.Commitment)
func (*TestFramework) IssueBlocksAndSetAccepted ¶
func (t *TestFramework) IssueBlocksAndSetAccepted(aliases ...string)
func (*TestFramework) SetAcceptedTime ¶
func (t *TestFramework) SetAcceptedTime(acceptedTime time.Time)
func (*TestFramework) SetBlocksAccepted ¶
func (t *TestFramework) SetBlocksAccepted(aliases ...string)
func (*TestFramework) SetMarkersAccepted ¶
func (t *TestFramework) SetMarkersAccepted(m ...markers.Marker)
func (*TestFramework) SlotTimeProvider ¶
func (t *TestFramework) SlotTimeProvider() *slot.TimeProvider
type TipManager ¶
type TipManager struct {
Events *Events
TipsConflictTracker *TipsConflictTracker
// contains filtered or unexported fields
}
func New ¶
func New(workers *workerpool.Group, schedulerBlockRetrieverFunc blockRetrieverFunc, opts ...options.Option[TipManager]) (t *TipManager)
New creates a new TipManager.
func (*TipManager) AddTip ¶
func (t *TipManager) AddTip(block *scheduler.Block)
func (*TipManager) AddTipNonMonotonic ¶
func (t *TipManager) AddTipNonMonotonic(block *scheduler.Block)
func (*TipManager) AllTips ¶
func (t *TipManager) AllTips() (allTips []*scheduler.Block)
AllTips returns a list of all tips that are stored in the TipManger.
func (*TipManager) DeleteTip ¶
func (t *TipManager) DeleteTip(block *scheduler.Block) (deleted bool)
func (*TipManager) EvictTSCCache ¶
func (t *TipManager) EvictTSCCache(index slot.Index)
func (*TipManager) IsPastConeTimestampCorrect ¶
func (t *TipManager) IsPastConeTimestampCorrect(block *booker.Block) (timestampValid bool)
func (*TipManager) LinkTo ¶
func (t *TipManager) LinkTo(engine *engine.Engine)
func (*TipManager) RemoveStrongParents ¶
func (t *TipManager) RemoveStrongParents(block *models.Block)
RemoveStrongParents removes all tips that are parents of the given block.
type TipsConflictTracker ¶
func NewTipsConflictTracker ¶
func NewTipsConflictTracker(workerPool *workerpool.WorkerPool, engineInstance *engine.Engine) *TipsConflictTracker
func (*TipsConflictTracker) AddTip ¶
func (c *TipsConflictTracker) AddTip(block *scheduler.Block, blockConflictIDs utxo.TransactionIDs)
func (*TipsConflictTracker) Cleanup ¶
func (c *TipsConflictTracker) Cleanup()
func (*TipsConflictTracker) MissingConflicts ¶
func (c *TipsConflictTracker) MissingConflicts(amount int) (missingConflicts utxo.TransactionIDs)
func (*TipsConflictTracker) RemoveTip ¶
func (c *TipsConflictTracker) RemoveTip(block *scheduler.Block)
Click to show internal directories.
Click to hide internal directories.