Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
klim0v committed Oct 7, 2021
1 parent 8ae67d6 commit 4e49744
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions api/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,18 @@ type JailEvent struct {
JailedUntil string `json:"jailed_until"`
}

func (e *JailEvent) Type() EventType { return TypeJailEvent }

func (e *JailEvent) GetPublicKey() string {
return e.ValidatorPubKey
}

// GetValidatorPublicKey return validator public key
// Deprecated: Use GetPublicKey
func (e *JailEvent) GetValidatorPublicKey() string {
return e.ValidatorPubKey
}

func (e *JailEvent) Type() EventType { return TypeJailEvent }

type RemoveCandidateEvent struct {
CandidatePubKey string `json:"candidate_pub_key"`
}
Expand Down Expand Up @@ -159,6 +165,12 @@ func (e *RewardEvent) GetAddress() string {
func (e *RewardEvent) GetPublicKey() string {
return e.ValidatorPubKey
}

// GetValidatorPublicKey return validator public key
// Deprecated: Use GetPublicKey
func (e *RewardEvent) GetValidatorPublicKey() string {
return e.ValidatorPubKey
}
func (e *RewardEvent) Type() EventType { return TypeRewardEvent }

// SlashEvent is the payment of the validator's penalty by this stake
Expand All @@ -178,6 +190,12 @@ func (e *SlashEvent) GetAddress() string {
func (e *SlashEvent) GetPublicKey() string {
return e.ValidatorPubKey
}

// GetValidatorPublicKey return validator public key
// Deprecated: Use GetPublicKey
func (e *SlashEvent) GetValidatorPublicKey() string {
return e.ValidatorPubKey
}
func (e *SlashEvent) Type() EventType { return TypeSlashEvent }

// UnbondEvent is the unbinding a stake from a validator
Expand All @@ -197,6 +215,12 @@ func (e *UnbondEvent) GetAddress() string {
func (e *UnbondEvent) GetPublicKey() string {
return e.ValidatorPubKey
}

// GetValidatorPublicKey return validator public key
// Deprecated: Use GetPublicKey
func (e *UnbondEvent) GetValidatorPublicKey() string {
return e.ValidatorPubKey
}
func (e *UnbondEvent) Type() EventType { return TypeUnbondEvent }

// StakeKickEvent is the knocking out a stake to the waiting list
Expand All @@ -216,6 +240,13 @@ func (e *StakeKickEvent) GetAddress() string {
func (e *StakeKickEvent) GetPublicKey() string {
return e.ValidatorPubKey
}

// GetValidatorPublicKey return validator public key
// Deprecated: Use GetPublicKey
func (e *StakeKickEvent) GetValidatorPublicKey() string {
return e.ValidatorPubKey
}

func (e *StakeKickEvent) Type() EventType { return TypeStakeKickEvent }

type OrderExpiredEvent struct {
Expand Down

0 comments on commit 4e49744

Please sign in to comment.