-
Notifications
You must be signed in to change notification settings - Fork 12
/
tip_metadata.go
36 lines (26 loc) · 1.24 KB
/
tip_metadata.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package tipmanager
import (
"github.com/iotaledger/hive.go/ds/reactive"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
iotago "github.com/iotaledger/iota.go/v4"
)
// TipMetadata allows to access the tip related metadata and events of a block in the TipManager.
type TipMetadata interface {
// ID returns the identifier of the block the TipMetadata belongs to.
ID() iotago.BlockID
// Block returns the block that the TipMetadata belongs to.
Block() *blocks.Block
// TipPool exposes a variable that stores the current TipPool of the block.
TipPool() reactive.Variable[TipPool]
// IsStrongTip returns a ReadableVariable that indicates if the block is a strong tip.
IsStrongTip() reactive.ReadableVariable[bool]
// IsWeakTip returns a ReadableVariable that indicates if the block is a weak tip.
IsWeakTip() reactive.ReadableVariable[bool]
// IsOrphaned returns a ReadableVariable that indicates if the block was orphaned.
IsOrphaned() reactive.ReadableVariable[bool]
// LivenessThresholdReached exposes an event that is triggered when the liveness threshold is reached.
LivenessThresholdReached() reactive.Event
// Evicted exposes an event that is triggered when the block is evicted.
Evicted() reactive.Event
String() string
}