-
Notifications
You must be signed in to change notification settings - Fork 12
/
events.go
78 lines (74 loc) · 3.71 KB
/
events.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package engine
import (
"github.com/iotaledger/hive.go/core/eventticker"
"github.com/iotaledger/hive.go/runtime/event"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blockdag"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
"github.com/iotaledger/iota-core/pkg/protocol/engine/booker"
"github.com/iotaledger/iota-core/pkg/protocol/engine/clock"
"github.com/iotaledger/iota-core/pkg/protocol/engine/congestioncontrol/scheduler"
"github.com/iotaledger/iota-core/pkg/protocol/engine/consensus/blockgadget"
"github.com/iotaledger/iota-core/pkg/protocol/engine/consensus/slotgadget"
"github.com/iotaledger/iota-core/pkg/protocol/engine/filter/postsolidfilter"
"github.com/iotaledger/iota-core/pkg/protocol/engine/filter/presolidfilter"
"github.com/iotaledger/iota-core/pkg/protocol/engine/ledger"
"github.com/iotaledger/iota-core/pkg/protocol/engine/mempool"
"github.com/iotaledger/iota-core/pkg/protocol/engine/mempool/spenddag"
"github.com/iotaledger/iota-core/pkg/protocol/engine/notarization"
"github.com/iotaledger/iota-core/pkg/protocol/engine/syncmanager"
"github.com/iotaledger/iota-core/pkg/protocol/engine/tipmanager"
"github.com/iotaledger/iota-core/pkg/protocol/sybilprotection"
"github.com/iotaledger/iota-core/pkg/protocol/sybilprotection/seatmanager"
"github.com/iotaledger/iota-core/pkg/retainer"
iotago "github.com/iotaledger/iota.go/v4"
)
type Events struct {
BlockProcessed *event.Event1[iotago.BlockID]
AcceptedBlockProcessed *event.Event1[*blocks.Block]
Evict *event.Event1[iotago.SlotIndex]
PreSolidFilter *presolidfilter.Events
PostSolidFilter *postsolidfilter.Events
BlockRequester *eventticker.Events[iotago.SlotIndex, iotago.BlockID]
TipManager *tipmanager.Events
BlockDAG *blockdag.Events
Booker *booker.Events
Clock *clock.Events
BlockGadget *blockgadget.Events
SlotGadget *slotgadget.Events
SybilProtection *sybilprotection.Events
Ledger *ledger.Events
Notarization *notarization.Events
SpendDAG *spenddag.Events[iotago.TransactionID, mempool.StateID]
Scheduler *scheduler.Events
SeatManager *seatmanager.Events
SyncManager *syncmanager.Events
BlockRetainer *retainer.BlockRetainerEvents
TransactionRetainer *retainer.TransactionRetainerEvents
event.Group[Events, *Events]
}
// NewEvents contains the constructor of the Events object (it is generated by a generic factory).
var NewEvents = event.CreateGroupConstructor(func() (newEvents *Events) {
return &Events{
BlockProcessed: event.New1[iotago.BlockID](),
AcceptedBlockProcessed: event.New1[*blocks.Block](),
Evict: event.New1[iotago.SlotIndex](),
PreSolidFilter: presolidfilter.NewEvents(),
PostSolidFilter: postsolidfilter.NewEvents(),
BlockRequester: eventticker.NewEvents[iotago.SlotIndex, iotago.BlockID](),
TipManager: tipmanager.NewEvents(),
BlockDAG: blockdag.NewEvents(),
Booker: booker.NewEvents(),
Clock: clock.NewEvents(),
BlockGadget: blockgadget.NewEvents(),
SlotGadget: slotgadget.NewEvents(),
SybilProtection: sybilprotection.NewEvents(),
Ledger: ledger.NewEvents(),
Notarization: notarization.NewEvents(),
SpendDAG: spenddag.NewEvents[iotago.TransactionID, mempool.StateID](),
Scheduler: scheduler.NewEvents(),
SeatManager: seatmanager.NewEvents(),
SyncManager: syncmanager.NewEvents(),
BlockRetainer: retainer.NewBlockRetainerEvents(),
TransactionRetainer: retainer.NewTransactionRetainerEvents(),
}
})