@@ -30,11 +30,15 @@ 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+ _candidateDeactivationCanceledEvent abi.Event
40+ _candidateDeactivationScheduledEvent abi.Event
41+ _candidateDeactivatedEvent abi.Event
3842
3943 // ErrInvalidAmount represents that amount is 0 or negative
4044 ErrInvalidAmount = errors .New ("invalid amount" )
@@ -89,6 +93,22 @@ func init() {
8993 if ! ok {
9094 panic ("fail to load the event" )
9195 }
96+ _candidateDeactivationRequestedEvent , ok = abi .Events ["CandidateDeactivationRequested" ]
97+ if ! ok {
98+ panic ("fail to load the event" )
99+ }
100+ _candidateDeactivationCanceledEvent , ok = abi .Events ["CandidateDeactivationCanceled" ]
101+ if ! ok {
102+ panic ("fail to load the event" )
103+ }
104+ _candidateDeactivationScheduledEvent , ok = abi .Events ["CandidateDeactivationScheduled" ]
105+ if ! ok {
106+ panic ("fail to load the event" )
107+ }
108+ _candidateDeactivatedEvent , ok = abi .Events ["CandidateDeactivated" ]
109+ if ! ok {
110+ panic ("fail to load the event" )
111+ }
92112}
93113
94114// NewCandidateRegister creates a CandidateRegister instance
@@ -426,6 +446,54 @@ func PackCandidateActivatedEvent(
426446 return topics , data , nil
427447}
428448
449+ // PackCandidateDeactivationRequestedEvent packs the CandidateDeactivationRequested event
450+ func PackCandidateDeactivationRequestedEvent (candidate address.Address ) (Topics , []byte , error ) {
451+ data , err := _candidateDeactivationRequestedEvent .Inputs .NonIndexed ().Pack ()
452+ if err != nil {
453+ return nil , nil , errors .Wrap (err , "failed to pack CandidateDeactivationRequested event" )
454+ }
455+ topics := make (Topics , 2 )
456+ topics [0 ] = hash .Hash256 (_candidateDeactivationRequestedEvent .ID )
457+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
458+ return topics , data , nil
459+ }
460+
461+ // PackCandidateDeactivationCanceledEvent packs the CandidateDeactivationCanceled event
462+ func PackCandidateDeactivationCanceledEvent (candidate address.Address ) (Topics , []byte , error ) {
463+ data , err := _candidateDeactivationCanceledEvent .Inputs .NonIndexed ().Pack ()
464+ if err != nil {
465+ return nil , nil , errors .Wrap (err , "failed to pack CandidateDeactivationCanceled event" )
466+ }
467+ topics := make (Topics , 2 )
468+ topics [0 ] = hash .Hash256 (_candidateDeactivationCanceledEvent .ID )
469+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
470+ return topics , data , nil
471+ }
472+
473+ // PackCandidateDeactivationScheduledEvent packs the CandidateDeactivationScheduled event
474+ func PackCandidateDeactivationScheduledEvent (candidate address.Address , blkHeight uint64 ) (Topics , []byte , error ) {
475+ data , err := _candidateDeactivationScheduledEvent .Inputs .NonIndexed ().Pack (blkHeight )
476+ if err != nil {
477+ return nil , nil , errors .Wrap (err , "failed to pack ScheduleCandidateDeactivation event" )
478+ }
479+ topics := make (Topics , 2 )
480+ topics [0 ] = hash .Hash256 (_candidateDeactivationScheduledEvent .ID )
481+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
482+ return topics , data , nil
483+ }
484+
485+ // PackCandidateDeactivatedEvent packs the CandidateDeactivated event
486+ func PackCandidateDeactivatedEvent (candidate address.Address ) (Topics , []byte , error ) {
487+ data , err := _candidateDeactivatedEvent .Inputs .NonIndexed ().Pack ()
488+ if err != nil {
489+ return nil , nil , errors .Wrap (err , "failed to pack CandidateDeactivated event" )
490+ }
491+ topics := make (Topics , 2 )
492+ topics [0 ] = hash .Hash256 (_candidateDeactivatedEvent .ID )
493+ topics [1 ] = hash .BytesToHash256 (candidate .Bytes ())
494+ return topics , data , nil
495+ }
496+
429497// NewCandidateRegisterFromABIBinary decodes data into CandidateRegister action
430498func NewCandidateRegisterFromABIBinary (data []byte , value * big.Int ) (* CandidateRegister , error ) {
431499 var (
0 commit comments