Skip to content

Commit

Permalink
fix: fix NewKeeper
Browse files Browse the repository at this point in the history
Signed-off-by: 170210 <[email protected]>
  • Loading branch information
170210 committed Apr 17, 2024
1 parent 4e0771a commit 4c1b61a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
33 changes: 14 additions & 19 deletions x/fswap/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,31 @@ import (
"github.com/tendermint/tendermint/libs/log"

"github.com/Finschia/finschia-sdk/codec"
storetypes "github.com/Finschia/finschia-sdk/store/types"
sdk "github.com/Finschia/finschia-sdk/types"
"github.com/Finschia/finschia-sdk/x/fswap/types"
paramtypes "github.com/Finschia/finschia-sdk/x/params/types"
)

type (
Keeper struct {
cdc codec.BinaryCodec
storeKey sdk.StoreKey
memKey sdk.StoreKey
paramstore paramtypes.Subspace
cdc codec.BinaryCodec
accountKeeper types.AccountKeeper
bankKeeper types.BankKeeper
storeKey storetypes.StoreKey
}
)

func NewKeeper(
cdc codec.BinaryCodec,
storeKey,
memKey sdk.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,
memKey: memKey,
paramstore: ps,
ak types.AccountKeeper,
bk types.BankKeeper,
storeKey storetypes.StoreKey,
) Keeper {
return Keeper{
cdc: cdc,
accountKeeper: ak,
bankKeeper: bk,
storeKey: storeKey,
}
}

Expand Down
2 changes: 1 addition & 1 deletion x/fswap/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params {

// SetParams set the params
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramstore.SetParamSet(ctx, &params)
// k.paramstore.SetParamSet(ctx, &params)
}

0 comments on commit 4c1b61a

Please sign in to comment.