-
Notifications
You must be signed in to change notification settings - Fork 10
/
params.go
50 lines (40 loc) · 1.4 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
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/bianjieai/iritamod/modules/opb/types"
)
// ParamKeyTable for the OPB module
func ParamKeyTable() paramstypes.KeyTable {
return paramstypes.NewKeyTable().RegisterParamSet(&types.Params{})
}
// BaseTokenDenom returns the base token denom
func (k Keeper) BaseTokenDenom(ctx sdk.Context) (res string) {
k.paramSpace.Get(ctx, types.KeyBaseTokenDenom, &res)
return
}
// PointTokenDenom returns the point token denom
func (k Keeper) PointTokenDenom(ctx sdk.Context) (res string) {
k.paramSpace.Get(ctx, types.KeyPointTokenDenom, &res)
return
}
// BaseTokenManager returns the base token manager
func (k Keeper) BaseTokenManager(ctx sdk.Context) (res string) {
k.paramSpace.Get(ctx, types.KeyBaseTokenManager, &res)
return
}
// UnrestrictedTokenTransfer returns the boolean value which indicates if the token transfer is restricted
func (k Keeper) UnrestrictedTokenTransfer(ctx sdk.Context) (res bool) {
k.paramSpace.Get(ctx, types.KeyUnrestrictedTokenTransfer, &res)
return
}
// GetParams gets all parameters
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
var p types.Params
k.paramSpace.GetParamSet(ctx, &p)
return p
}
// SetParams sets the params to the store
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
}