Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
klim0v committed Sep 30, 2021
1 parent 61bf63c commit 8ae67d6
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions api/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const (
TypeUnbondEvent EventType = "minter/UnbondEvent"
TypeStakeKickEvent EventType = "minter/StakeKickEvent"
TypeOrderExpiredEvent EventType = "minter/OrderExpiredEvent"
TypeStakeMoveEvent EventType = "minter/StakeMoveEvent"
TypeUpdateNetworkEvent EventType = "minter/UpdateNetworkEvent"
TypeUpdateCommissionsEvent EventType = "minter/UpdateCommissionsEvent"
TypeRemoveCandidateEvent EventType = "minter/RemoveCandidateEvent"
Expand Down Expand Up @@ -142,26 +141,6 @@ func (e *RemoveCandidateEvent) GetPublicKey() string {
return e.CandidatePubKey
}

// StakeMoveEvent ...
type StakeMoveEvent struct {
Address string `json:"address"`
Amount string `json:"amount"`
Coin string `json:"coin"`
ValidatorPubKey string `json:"validator_pub_key"`
WaitList bool `json:"waitlist"`
}

// GetAddress return owner address
func (e *StakeMoveEvent) GetAddress() string {
return e.Address
}

// GetValidatorPublicKey return validator public key
func (e *StakeMoveEvent) GetPublicKey() string {
return e.ValidatorPubKey
}
func (e *StakeMoveEvent) Type() EventType { return TypeStakeMoveEvent }

// RewardEvent is the payment of rewards
type RewardEvent struct {
Role string `json:"role"`
Expand All @@ -176,7 +155,7 @@ func (e *RewardEvent) GetAddress() string {
return e.Address
}

// GetValidatorPublicKey return validator public key
// GetPublicKey return validator public key
func (e *RewardEvent) GetPublicKey() string {
return e.ValidatorPubKey
}
Expand All @@ -195,7 +174,7 @@ func (e *SlashEvent) GetAddress() string {
return e.Address
}

// GetValidatorPublicKey return validator public key
// GetPublicKey return validator public key
func (e *SlashEvent) GetPublicKey() string {
return e.ValidatorPubKey
}
Expand All @@ -214,7 +193,7 @@ func (e *UnbondEvent) GetAddress() string {
return e.Address
}

// GetValidatorPublicKey return validator public key
// GetPublicKey return validator public key
func (e *UnbondEvent) GetPublicKey() string {
return e.ValidatorPubKey
}
Expand All @@ -233,7 +212,7 @@ func (e *StakeKickEvent) GetAddress() string {
return e.Address
}

// GetValidatorPublicKey return validator public key
// GetPublicKey return validator public key
func (e *StakeKickEvent) GetPublicKey() string {
return e.ValidatorPubKey
}
Expand Down Expand Up @@ -265,8 +244,6 @@ func newEvent(t EventType) Event {
return &UnbondEvent{}
case TypeStakeKickEvent:
return &StakeKickEvent{}
case TypeStakeMoveEvent:
return &StakeMoveEvent{}
case TypeUpdateCommissionsEvent:
return &UpdateCommissionsEvent{}
case TypeUpdateNetworkEvent:
Expand Down

0 comments on commit 8ae67d6

Please sign in to comment.