/
params.go
59 lines (50 loc) · 1.67 KB
/
params.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/lavanet/lava/x/rewards/types"
)
// GetParams get all parameters as types.Params
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
return types.NewParams(
k.MinBondedTarget(ctx),
k.MaxBondedTarget(ctx),
k.LowFactor(ctx),
k.LeftoverBurnRate(ctx),
k.MaxRewardBoost(ctx),
k.ValidatorsSubscriptionParticipation(ctx),
)
}
// SetParams set the params
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramstore.SetParamSet(ctx, ¶ms)
}
// MinBondedTarget returns the MinBondedTarget param
func (k Keeper) MinBondedTarget(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyMinBondedTarget, &res)
return
}
// MaxBondedTarget returns the MaxBondedTarget param
func (k Keeper) MaxBondedTarget(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyMaxBondedTarget, &res)
return
}
// LowFactor returns the LowFactor param
func (k Keeper) LowFactor(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyLowFactor, &res)
return
}
// LeftoverBurnRate returns the LeftoverBurnRate param
func (k Keeper) LeftoverBurnRate(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyLeftoverBurnRate, &res)
return
}
// MaxRewardBoost returns the MaxRewardBoost param
func (k Keeper) MaxRewardBoost(ctx sdk.Context) (res uint64) {
k.paramstore.Get(ctx, types.KeyMaxRewardBoost, &res)
return
}
// ValidatorsSubscriptionParticipation returns the ValidatorsSubscriptionParticipation param
func (k Keeper) ValidatorsSubscriptionParticipation(ctx sdk.Context) (res sdk.Dec) {
k.paramstore.Get(ctx, types.KeyValidatorsSubscriptionParticipation, &res)
return
}