0g-chain/x/council/v1/keeper/params.go
Solovyov1796 2ce418a5eb
Some checks failed
Continuous Integration (Commit) / lint (push) Has been cancelled
migrate from v0.25
2024-08-02 19:32:08 +08:00

30 lines
567 B
Go

package keeper
import (
"github.com/0glabs/0g-chain/x/council/v1/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.ParamsKey)
if len(bz) == 0 {
return params
}
k.cdc.MustUnmarshal(bz, &params)
return params
}
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error {
store := ctx.KVStore(k.storeKey)
bz, err := k.cdc.Marshal(&params)
if err != nil {
return err
}
store.Set(types.ParamsKey, bz)
return nil
}