From 4e497445bcbde77a88675b527263247ab1f1fd10 Mon Sep 17 00:00:00 2001 From: klim0v Date: Thu, 7 Oct 2021 15:40:41 +0300 Subject: [PATCH] cleanup code --- api/events.go | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/api/events.go b/api/events.go index dabce8f..a910e07 100644 --- a/api/events.go +++ b/api/events.go @@ -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"` } @@ -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 @@ -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 @@ -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 @@ -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 {