Jürgen Eckel ec697840de
Eckelj/machine update params (#322)
* added signing authority (dao) to the keeper to enable dao signing checks
* added UpdateParam message for the machine module

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-26 12:00:37 +01:00

62 lines
1.8 KiB
Go

package keeper
import (
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/planetmint/planetmint-go/x/machine/types"
)
type (
Keeper struct {
cdc codec.BinaryCodec
storeKey storetypes.StoreKey
taIndexStoreKey storetypes.StoreKey
issuerPlanetmintIndexStoreKey storetypes.StoreKey
issuerLiquidIndexStoreKey storetypes.StoreKey
taStoreKey storetypes.StoreKey
addressIndexStoreKey storetypes.StoreKey
memKey storetypes.StoreKey
paramstore paramtypes.Subspace
authority string
}
)
func NewKeeper(
cdc codec.BinaryCodec,
storeKey,
indexStoreKey,
issuerPlanetmintIndexStoreKey,
issuerLiquidIndexStoreKey,
taStoreKey,
addressIndexStoreKey,
memKey storetypes.StoreKey,
ps paramtypes.Subspace,
authority string,
) *Keeper {
// set KeyTable if it has not already been set
if !ps.HasKeyTable() {
ps = ps.WithKeyTable(types.ParamKeyTable())
}
return &Keeper{
cdc: cdc,
storeKey: storeKey,
taIndexStoreKey: indexStoreKey,
issuerPlanetmintIndexStoreKey: issuerPlanetmintIndexStoreKey,
issuerLiquidIndexStoreKey: issuerLiquidIndexStoreKey,
taStoreKey: taStoreKey,
addressIndexStoreKey: addressIndexStoreKey,
memKey: memKey,
paramstore: ps,
authority: authority,
}
}
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", "x/"+types.ModuleName)
}