/
params.go
60 lines (49 loc) · 1.8 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
60
package keeper
import (
"github.com/terra-money/core/x/treasury/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// TaxPolicy defines constraints for TaxRate
func (k Keeper) TaxPolicy(ctx sdk.Context) (res types.PolicyConstraints) {
k.paramSpace.Get(ctx, types.KeyTaxPolicy, &res)
return
}
// RewardPolicy defines constraints for RewardWeight
func (k Keeper) RewardPolicy(ctx sdk.Context) (res types.PolicyConstraints) {
k.paramSpace.Get(ctx, types.KeyRewardPolicy, &res)
return
}
// SeigniorageBurdenTarget defines fixed target for the Seigniorage Burden. Between 0 and 1.
func (k Keeper) SeigniorageBurdenTarget(ctx sdk.Context) (res sdk.Dec) {
k.paramSpace.Get(ctx, types.KeySeigniorageBurdenTarget, &res)
return
}
// MiningIncrement is a factor used to determine how fast MRL should grow over time
func (k Keeper) MiningIncrement(ctx sdk.Context) (res sdk.Dec) {
k.paramSpace.Get(ctx, types.KeyMiningIncrement, &res)
return
}
// WindowShort is a short period window for moving average
func (k Keeper) WindowShort(ctx sdk.Context) (res uint64) {
k.paramSpace.Get(ctx, types.KeyWindowShort, &res)
return
}
// WindowLong is a long period window for moving average
func (k Keeper) WindowLong(ctx sdk.Context) (res uint64) {
k.paramSpace.Get(ctx, types.KeyWindowLong, &res)
return
}
// WindowProbation is a period of time to prevent updates
func (k Keeper) WindowProbation(ctx sdk.Context) (res uint64) {
k.paramSpace.Get(ctx, types.KeyWindowProbation, &res)
return
}
// GetParams returns the total set of treasury parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, ¶ms)
return params
}
// SetParams sets the total set of treasury parameters.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
}