github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/ibc-go/modules/apps/27-interchain-accounts/host/keeper/params.go (about)

     1  package keeper
     2  
     3  import (
     4  	sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
     5  	"github.com/fibonacci-chain/fbc/libs/ibc-go/modules/apps/27-interchain-accounts/host/types"
     6  )
     7  
     8  // IsHostEnabled retrieves the host enabled boolean from the paramstore.
     9  // True is returned if the host submodule is enabled.
    10  func (k Keeper) IsHostEnabled(ctx sdk.Context) bool {
    11  	var res bool
    12  	k.paramSpace.Get(ctx, types.KeyHostEnabled, &res)
    13  	return res
    14  }
    15  
    16  // GetAllowMessages retrieves the host enabled msg types from the paramstore
    17  func (k Keeper) GetAllowMessages(ctx sdk.Context) []string {
    18  	var res []string
    19  	k.paramSpace.Get(ctx, types.KeyAllowMessages, &res)
    20  	return res
    21  }
    22  
    23  // GetParams returns the total set of the host submodule parameters.
    24  func (k Keeper) GetParams(ctx sdk.Context) types.Params {
    25  	return types.NewParams(k.IsHostEnabled(ctx), k.GetAllowMessages(ctx))
    26  }
    27  
    28  // SetParams sets the total set of the host submodule parameters.
    29  func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
    30  	k.paramSpace.SetParamSet(ctx, &params)
    31  }