forked from evmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validator.go
34 lines (29 loc) · 980 Bytes
/
validator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// create a new ValidatorHistoricalRewards
func NewValidatorHistoricalRewards(cumulativeRewardRatio sdk.DecCoins, referenceCount uint32) ValidatorHistoricalRewards {
return ValidatorHistoricalRewards{
CumulativeRewardRatio: cumulativeRewardRatio,
ReferenceCount: referenceCount,
}
}
// create a new ValidatorCurrentRewards
func NewValidatorCurrentRewards(rewards sdk.DecCoins, period uint64) ValidatorCurrentRewards {
return ValidatorCurrentRewards{
Rewards: rewards,
Period: period,
}
}
// return the initial accumulated commission (zero)
func InitialValidatorAccumulatedCommission() ValidatorAccumulatedCommission {
return ValidatorAccumulatedCommission{}
}
// create a new ValidatorSlashEvent
func NewValidatorSlashEvent(validatorPeriod uint64, fraction sdk.Dec) ValidatorSlashEvent {
return ValidatorSlashEvent{
ValidatorPeriod: validatorPeriod,
Fraction: fraction,
}
}