@@ -30,11 +30,14 @@ const (
3030
3131var (
3232 // _candidateRegisterInterface is the interface of the abi encoding of stake action
33- _candidateRegisterMethod abi.Method
34- _candidateRegisterWithBLSMethod abi.Method
35- _candidateRegisteredEvent abi.Event
36- _stakedEvent abi.Event
37- _candidateActivatedEvent abi.Event
33+ _candidateRegisterMethod abi.Method
34+ _candidateRegisterWithBLSMethod abi.Method
35+ _candidateRegisteredEvent abi.Event
36+ _stakedEvent abi.Event
37+ _candidateActivatedEvent abi.Event
38+ _candidateDeactivationRequestedEvent abi.Event
39+ _candidateDeactivationScheduledEvent abi.Event
40+ _candidateDeactivatedEvent abi.Event
3841
3942 // ErrInvalidAmount represents that amount is 0 or negative
4043 ErrInvalidAmount = errors .New ("invalid amount" )
@@ -89,6 +92,18 @@ func init() {
8992 if ! ok {
9093 panic ("fail to load the event" )
9194 }
95+ _candidateDeactivationRequestedEvent , ok = abi .Events ["CandidateDeactivationRequested" ]
96+ if ! ok {
97+ panic ("fail to load the event" )
98+ }
99+ _candidateDeactivationScheduledEvent , ok = abi .Events ["CandidateDeactivationScheduled" ]
100+ if ! ok {
101+ panic ("fail to load the event" )
102+ }
103+ _candidateDeactivatedEvent , ok = abi .Events ["CandidateDeactivated" ]
104+ if ! ok {
105+ panic ("fail to load the event" )
106+ }
92107}
93108
94109// NewCandidateRegister creates a CandidateRegister instance
@@ -426,6 +441,42 @@ func PackCandidateActivatedEvent(
426441 return topics , data , nil
427442}
428443
444+ // PackCandidateDeactivationRequestedEvent packs the CandidateDeactivationRequested event
445+ func PackCandidateDeactivationRequestedEvent (candidate address.Address ) (Topics , []byte , error ) {
446+ data , err := _candidateDeactivationRequestedEvent .Inputs .NonIndexed ().Pack ()
447+ if err != nil {
448+ return nil , nil , errors .Wrap (err , "failed to pack CandidateDeactivationRequested event" )
449+ }
450+ topics := make (Topics , 2 )
451+ topics [0 ] = hash .Hash256 (_candidateDeactivationRequestedEvent .ID )
452+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
453+ return topics , data , nil
454+ }
455+
456+ // PackCandidateDeactivationScheduledEvent packs the CandidateDeactivationScheduled event
457+ func PackCandidateDeactivationScheduledEvent (candidate address.Address , blkHeight uint64 ) (Topics , []byte , error ) {
458+ data , err := _candidateDeactivationScheduledEvent .Inputs .NonIndexed ().Pack (blkHeight )
459+ if err != nil {
460+ return nil , nil , errors .Wrap (err , "failed to pack ScheduleCandidateDeactivation event" )
461+ }
462+ topics := make (Topics , 2 )
463+ topics [0 ] = hash .Hash256 (_candidateDeactivationScheduledEvent .ID )
464+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
465+ return topics , data , nil
466+ }
467+
468+ // PackCandidateDeactivatedEvent packs the CandidateDeactivated event
469+ func PackCandidateDeactivatedEvent (candidate address.Address ) (Topics , []byte , error ) {
470+ data , err := _candidateDeactivatedEvent .Inputs .NonIndexed ().Pack ()
471+ if err != nil {
472+ return nil , nil , errors .Wrap (err , "failed to pack CandidateDeactivated event" )
473+ }
474+ topics := make (Topics , 2 )
475+ topics [0 ] = hash .Hash256 (_candidateDeactivatedEvent .ID )
476+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
477+ return topics , data , nil
478+ }
479+
429480// NewCandidateRegisterFromABIBinary decodes data into CandidateRegister action
430481func NewCandidateRegisterFromABIBinary (data []byte , value * big.Int ) (* CandidateRegister , error ) {
431482 var (
0 commit comments