Documentation ¶
Index ¶
- func NewDefaultTestFramework(t *testing.T, workers *workerpool.Group, ...) *blockdag.TestFramework
- func NewProvider(opts ...options.Option[BlockDAG]) module.Provider[*engine.Engine, blockdag.BlockDAG]
- type BlockDAG
- func (b *BlockDAG) Attach(data *models.Block) (block *blockdag.Block, wasAttached bool, err error)
- func (b *BlockDAG) Block(id models.BlockID) (block *blockdag.Block, exists bool)
- func (b *BlockDAG) Events() *blockdag.Events
- func (b *BlockDAG) EvictionState() *eviction.State
- func (b *BlockDAG) PromoteFutureBlocksUntil(index slot.Index)
- func (b *BlockDAG) SetInvalid(block *blockdag.Block, reason error) (wasUpdated bool)
- func (b *BlockDAG) SetOrphaned(block *blockdag.Block, orphaned bool) (updated bool)
- func (b *BlockDAG) SlotTimeProvider() *slot.TimeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultTestFramework ¶
func NewDefaultTestFramework(t *testing.T, workers *workerpool.Group, optsBlockDAG ...options.Option[BlockDAG]) *blockdag.TestFramework
Types ¶
type BlockDAG ¶
type BlockDAG struct { Workers *workerpool.Group module.Module // contains filtered or unexported fields }
BlockDAG is a causally ordered DAG that forms the central data structure of the ZIPP protocol.
func New ¶
func New(workers *workerpool.Group, evictionState *eviction.State, slotTimeProviderFunc func() *slot.TimeProvider, latestCommitmentFunc func(slot.Index) (*commitment.Commitment, error), opts ...options.Option[BlockDAG]) (newBlockDAG *BlockDAG)
New is the constructor for the BlockDAG and creates a new BlockDAG instance.
func NewTestBlockDAG ¶
func NewTestBlockDAG(t *testing.T, workers *workerpool.Group, evictionState *eviction.State, slotTimeProvider *slot.TimeProvider, commitmentLoadFunc func(index slot.Index) (commitment *commitment.Commitment, err error), optsBlockDAG ...options.Option[BlockDAG]) *BlockDAG
func (*BlockDAG) Attach ¶
Attach is used to attach new Blocks to the BlockDAG. It is the main function of the BlockDAG that triggers Events.
func (*BlockDAG) Block ¶
Block retrieves a Block with metadata from the in-memory storage of the BlockDAG.
func (*BlockDAG) EvictionState ¶
func (*BlockDAG) PromoteFutureBlocksUntil ¶
func (*BlockDAG) SetInvalid ¶
SetInvalid marks a Block as invalid and propagates the invalidity to its future cone.
func (*BlockDAG) SetOrphaned ¶
SetOrphaned marks a Block as orphaned and propagates it to its future cone.
func (*BlockDAG) SlotTimeProvider ¶
func (b *BlockDAG) SlotTimeProvider() *slot.TimeProvider
Click to show internal directories.
Click to hide internal directories.