Documentation ¶
Index ¶
- func NewDefaultTestFramework(t *testing.T, workers *workerpool.Group, ledger mempool.MemPool, ...) *booker.TestFramework
- func NewProvider(opts ...options.Option[Booker]) module.Provider[*engine.Engine, booker.Booker]
- func WithMarkerManagerOptions(...) options.Option[Booker]
- func WithSequenceCutoffCallback(sequenceCutoffCallback func(id markers.SequenceID) markers.Index) options.Option[Booker]
- func WithSlotCutoffCallback(slotCutoffCallback func() slot.Index) options.Option[Booker]
- type Booker
- func (b *Booker) Block(id models.BlockID) (block *booker.Block, exists bool)
- func (b *Booker) BlockBookingDetails(block *booker.Block) (pastMarkersConflictIDs, blockConflictIDs utxo.TransactionIDs)
- func (b *Booker) BlockCeiling(marker markers.Marker) (ceilingMarker markers.Marker, exists bool)
- func (b *Booker) BlockConflicts(block *booker.Block) (blockConflictIDs utxo.TransactionIDs)
- func (b *Booker) BlockFloor(marker markers.Marker) (floorMarker markers.Marker, exists bool)
- func (b *Booker) BlockFromMarker(marker markers.Marker) (block *booker.Block, exists bool)
- func (b *Booker) Events() *booker.Events
- func (b *Booker) EvictSequence(sequenceID markers.SequenceID)
- func (b *Booker) EvictSlotTracker(slotIndex slot.Index)
- func (b *Booker) GetAllAttachments(txID utxo.TransactionID) (attachments *advancedset.AdvancedSet[*booker.Block])
- func (b *Booker) GetEarliestAttachment(txID utxo.TransactionID) (attachment *booker.Block)
- func (b *Booker) GetLatestAttachment(txID utxo.TransactionID) (attachment *booker.Block)
- func (b *Booker) Initialize(blockDAG blockdag.BlockDAG)
- func (b *Booker) MarkerVotersTotalWeight(marker markers.Marker) (totalWeight int64)
- func (b *Booker) OrphanAttachment(block *booker.Block)
- func (b *Booker) PayloadConflictID(block *booker.Block) (conflictID utxo.TransactionID, conflictingConflictIDs utxo.TransactionIDs, ...)
- func (b *Booker) ProcessForkedMarker(marker markers.Marker, forkedConflictID utxo.TransactionID, ...)
- func (b *Booker) PropagateForkedConflict(transactionID, addedConflictID utxo.TransactionID, ...) (err error)
- func (b *Booker) Queue(block *booker.Block) (wasQueued bool, err error)
- func (b *Booker) Sequence(id markers.SequenceID) (sequence *markers.Sequence, exists bool)
- func (b *Booker) SequenceManager() *markers.SequenceManager
- func (b *Booker) SequenceTracker() *sequencetracker.SequenceTracker[booker.BlockVotePower]
- func (b *Booker) SlotVotersTotalWeight(slotIndex slot.Index) (totalWeight int64)
- func (b *Booker) TransactionConflictIDs(block *booker.Block) (conflictIDs utxo.TransactionIDs)
- func (b *Booker) VirtualVoting() booker.VirtualVoting
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultTestFramework ¶
func NewProvider ¶
Types ¶
type Booker ¶
type Booker struct { MemPool mempool.MemPool module.Module // contains filtered or unexported fields }
func New ¶
func New(workers *workerpool.Group, evictionState *eviction.State, memPool mempool.MemPool, validators *sybilprotection.WeightedSet, slotTimeProviderFunc func() *slot.TimeProvider, opts ...options.Option[Booker]) *Booker
func (*Booker) Block ¶
Block retrieves a Block with metadata from the in-memory storage of the Booker.
func (*Booker) BlockBookingDetails ¶
func (b *Booker) BlockBookingDetails(block *booker.Block) (pastMarkersConflictIDs, blockConflictIDs utxo.TransactionIDs)
BlockBookingDetails returns the Conflict and Marker related details of the given Block.
func (*Booker) BlockCeiling ¶
BlockCeiling returns the smallest Index that is >= the given Marker and a boolean value indicating if it exists.
func (*Booker) BlockConflicts ¶
func (b *Booker) BlockConflicts(block *booker.Block) (blockConflictIDs utxo.TransactionIDs)
BlockConflicts returns the Conflict related details of the given Block.
func (*Booker) BlockFloor ¶
BlockFloor returns the largest Index that is <= the given Marker and a boolean value indicating if it exists.
func (*Booker) BlockFromMarker ¶
BlockFromMarker retrieves the Block of the given Marker.
func (*Booker) EvictSequence ¶
func (b *Booker) EvictSequence(sequenceID markers.SequenceID)
func (*Booker) EvictSlotTracker ¶
func (*Booker) GetAllAttachments ¶
func (b *Booker) GetAllAttachments(txID utxo.TransactionID) (attachments *advancedset.AdvancedSet[*booker.Block])
func (*Booker) GetEarliestAttachment ¶
func (b *Booker) GetEarliestAttachment(txID utxo.TransactionID) (attachment *booker.Block)
GetEarliestAttachment returns the earliest attachment for a given transaction ID. returnOrphaned parameter specifies whether the returned attachment may be orphaned.
func (*Booker) GetLatestAttachment ¶
func (b *Booker) GetLatestAttachment(txID utxo.TransactionID) (attachment *booker.Block)
GetLatestAttachment returns the latest attachment for a given transaction ID. returnOrphaned parameter specifies whether the returned attachment may be orphaned.
func (*Booker) Initialize ¶
func (*Booker) MarkerVotersTotalWeight ¶
MarkerVotersTotalWeight retrieves Validators supporting a given marker.
func (*Booker) OrphanAttachment ¶
func (*Booker) PayloadConflictID ¶
func (b *Booker) PayloadConflictID(block *booker.Block) (conflictID utxo.TransactionID, conflictingConflictIDs utxo.TransactionIDs, isTransaction bool)
PayloadConflictID returns the ConflictID of the conflicting payload contained in the given Block without conflicts from the UTXO past cone.
func (*Booker) ProcessForkedMarker ¶
func (b *Booker) ProcessForkedMarker(marker markers.Marker, forkedConflictID utxo.TransactionID, parentConflictIDs utxo.TransactionIDs)
func (*Booker) PropagateForkedConflict ¶
func (b *Booker) PropagateForkedConflict(transactionID, addedConflictID utxo.TransactionID, removedConflictIDs utxo.TransactionIDs) (err error)
PropagateForkedConflict propagates the forked ConflictID to the future cone of the attachments of the given Transaction.
func (*Booker) SequenceManager ¶
func (b *Booker) SequenceManager() *markers.SequenceManager
func (*Booker) SequenceTracker ¶
func (b *Booker) SequenceTracker() *sequencetracker.SequenceTracker[booker.BlockVotePower]
func (*Booker) SlotVotersTotalWeight ¶
SlotVotersTotalWeight retrieves the total weight of the Validators voting for a given slot.
func (*Booker) TransactionConflictIDs ¶
func (b *Booker) TransactionConflictIDs(block *booker.Block) (conflictIDs utxo.TransactionIDs)
TransactionConflictIDs returns the ConflictIDs of the Transaction contained in the given Block including conflicts from the UTXO past cone.
func (*Booker) VirtualVoting ¶
func (b *Booker) VirtualVoting() booker.VirtualVoting