Julian Strobl d4eed021c8
[go.mod] Switch module to github.com (#86)
This is the quasi-standard and fixes the error below:

```
$ go get -u github.com/planetmint/planetmint-go@v0.1.0
go: github.com/planetmint/planetmint-go@v0.1.0: parsing go.mod:
        module declares its path as: planetmint-go
                but was required as: github.com/planetmint/planetmint-go
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-09-21 17:37:57 +02:00

58 lines
1.6 KiB
Go

package keeper
import (
"fmt"
"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
memKey storetypes.StoreKey
paramstore paramtypes.Subspace
}
)
func NewKeeper(
cdc codec.BinaryCodec,
storeKey,
indexStoreKey,
issuerPlanetmintIndexStoreKey,
issuerLiquidIndexStoreKey,
taStoreKey,
memKey storetypes.StoreKey,
ps paramtypes.Subspace,
) *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,
memKey: memKey,
paramstore: ps,
}
}
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))
}