-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.go
32 lines (26 loc) · 1009 Bytes
/
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
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
)
// IsHostEnabled retrieves the host enabled boolean from the paramstore.
// True is returned if the host submodule is enabled.
func (k Keeper) IsHostEnabled(ctx sdk.Context) bool {
var res bool
k.paramSpace.Get(ctx, types.KeyHostEnabled, &res)
return res
}
// GetAllowMessages retrieves the host enabled msg types from the paramstore
func (k Keeper) GetAllowMessages(ctx sdk.Context) []string {
var res []string
k.paramSpace.Get(ctx, types.KeyAllowMessages, &res)
return res
}
// GetParams returns the total set of the host submodule parameters.
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
return types.NewParams(k.IsHostEnabled(ctx), k.GetAllowMessages(ctx))
}
// SetParams sets the total set of the host submodule parameters.
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramSpace.SetParamSet(ctx, ¶ms)
}