-
Notifications
You must be signed in to change notification settings - Fork 182
/
params.go
44 lines (36 loc) · 1.39 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
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/okex/okexchain/x/distribution/types"
)
// GetParams returns the total set of distribution parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, ¶ms)
return params
}
// SetParams sets the distribution parameters to the param space.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
}
// GetCommunityTax returns the current CommunityTax rate from the global param store
// nolint: errcheck
func (k Keeper) GetCommunityTax(ctx sdk.Context) (percent sdk.Dec) {
k.paramSpace.Get(ctx, types.ParamStoreKeyCommunityTax, &percent)
return percent
}
// SetCommunityTax sets the value of community tax
// nolint: errcheck
func (k Keeper) SetCommunityTax(ctx sdk.Context, percent sdk.Dec) {
k.paramSpace.Set(ctx, types.ParamStoreKeyCommunityTax, &percent)
}
// GetWithdrawAddrEnabled returns the current WithdrawAddrEnabled
// nolint: errcheck
func (k Keeper) GetWithdrawAddrEnabled(ctx sdk.Context) (enabled bool) {
k.paramSpace.Get(ctx, types.ParamStoreKeyWithdrawAddrEnabled, &enabled)
return enabled
}
// SetWithdrawAddrEnabled sets the value of enabled
// nolint: errcheck
func (k Keeper) SetWithdrawAddrEnabled(ctx sdk.Context, enabled bool) {
k.paramSpace.Set(ctx, types.ParamStoreKeyWithdrawAddrEnabled, &enabled)
}