/
params.go
41 lines (33 loc) · 1.16 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
package keeper
import (
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/functionx/fx-core/v3/x/erc20/types"
)
// GetParams returns the total set of erc20 parameters.
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
k.paramSpace.GetParamSet(ctx, ¶ms)
return params
}
// GetEnableErc20 returns the EnableErc20 parameter.
func (k Keeper) GetEnableErc20(ctx sdk.Context) bool {
var enableErc20 bool
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEnableErc20, &enableErc20)
return enableErc20
}
// GetEnableEVMHook returns the EnableEVMHook parameter.
func (k Keeper) GetEnableEVMHook(ctx sdk.Context) bool {
var enableEVMHook bool
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyEnableEVMHook, &enableEVMHook)
return enableEVMHook
}
// GetIbcTimeout returns the IbcTimeout parameter.
func (k Keeper) GetIbcTimeout(ctx sdk.Context) time.Duration {
var ibcTimeout time.Duration
k.paramSpace.GetIfExists(ctx, types.ParamStoreKeyIBCTimeout, &ibcTimeout)
return ibcTimeout
}
// SetParams sets the erc20 parameters to the param space.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
}