-
Notifications
You must be signed in to change notification settings - Fork 105
/
events.go
99 lines (87 loc) · 2.69 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/axelarnetwork/axelar-core/x/multisig/exported"
nexus "github.com/axelarnetwork/axelar-core/x/nexus/exported"
)
// NewKeygenStarted is the constructor for event keygen started
func NewKeygenStarted(keyID exported.KeyID, participants []sdk.ValAddress) *KeygenStarted {
return &KeygenStarted{
Module: ModuleName,
KeyID: keyID,
Participants: participants,
}
}
// NewKeygenCompleted is the constructor for event keygen completed
func NewKeygenCompleted(keyID exported.KeyID) *KeygenCompleted {
return &KeygenCompleted{
Module: ModuleName,
KeyID: keyID,
}
}
// NewKeygenExpired is the constructor for event keygen expired
func NewKeygenExpired(keyID exported.KeyID) *KeygenExpired {
return &KeygenExpired{
Module: ModuleName,
KeyID: keyID,
}
}
// NewPubKeySubmitted is the constructor for event pub key submitted
func NewPubKeySubmitted(keyID exported.KeyID, participant sdk.ValAddress, pubKey exported.PublicKey) *PubKeySubmitted {
return &PubKeySubmitted{
Module: ModuleName,
KeyID: keyID,
Participant: participant,
PubKey: pubKey,
}
}
// NewSigningStarted is the constructor for event signing started
func NewSigningStarted(sigID uint64, key Key, payloadHash exported.Hash, requestingModule string) *SigningStarted {
return &SigningStarted{
Module: ModuleName,
SigID: sigID,
KeyID: key.GetID(),
PubKeys: key.GetPubKeys(),
PayloadHash: payloadHash,
RequestingModule: requestingModule,
}
}
// NewSigningExpired is the constructor for event signing expired
func NewSigningExpired(sigID uint64) *SigningExpired {
return &SigningExpired{
Module: ModuleName,
SigID: sigID,
}
}
// NewSigningCompleted is the constructor for event signing completed
func NewSigningCompleted(sigID uint64) *SigningCompleted {
return &SigningCompleted{
Module: ModuleName,
SigID: sigID,
}
}
// NewSignatureSubmitted is the constructor for event signature submitted
func NewSignatureSubmitted(sigID uint64, participant sdk.ValAddress, signature Signature) *SignatureSubmitted {
return &SignatureSubmitted{
Module: ModuleName,
SigID: sigID,
Participant: participant,
Signature: signature,
}
}
// NewKeyAssigned is the constructor for event key assigned
func NewKeyAssigned(chain nexus.ChainName, keyID exported.KeyID) *KeyAssigned {
return &KeyAssigned{
Module: ModuleName,
Chain: chain,
KeyID: keyID,
}
}
// NewKeyRotated is the constructor for event key rotated
func NewKeyRotated(chain nexus.ChainName, keyID exported.KeyID) *KeyRotated {
return &KeyRotated{
Module: ModuleName,
Chain: chain,
KeyID: keyID,
}
}