-
Notifications
You must be signed in to change notification settings - Fork 12
/
events.go
25 lines (21 loc) · 888 Bytes
/
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
package seatmanager
import (
"github.com/iotaledger/hive.go/runtime/event"
"github.com/iotaledger/iota-core/pkg/core/account"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
iotago "github.com/iotaledger/iota.go/v4"
)
type Events struct {
BlockProcessed *event.Event1[*blocks.Block]
OnlineCommitteeSeatAdded *event.Event2[account.SeatIndex, iotago.AccountID]
OnlineCommitteeSeatRemoved *event.Event1[account.SeatIndex]
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[*blocks.Block](),
OnlineCommitteeSeatAdded: event.New2[account.SeatIndex, iotago.AccountID](),
OnlineCommitteeSeatRemoved: event.New1[account.SeatIndex](),
}
})