From 0c37e27c0e525e6d8e23f74bfbd58e4c27670761 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Tue, 3 Dec 2024 11:04:30 +0000 Subject: [PATCH] refactor: update 29-fee to use runtime.Environment --- modules/apps/29-fee/keeper/escrow.go | 4 +- modules/apps/29-fee/keeper/grpc_query.go | 6 +- modules/apps/29-fee/keeper/keeper.go | 74 +++++++++---------- modules/apps/29-fee/keeper/migrations.go | 2 +- modules/apps/29-fee/keeper/msg_server.go | 4 +- modules/apps/callbacks/testing/simapp/app.go | 3 +- .../08-wasm/testing/simapp/app.go | 3 +- simapp/app.go | 3 +- testing/simapp/app.go | 3 +- 9 files changed, 49 insertions(+), 53 deletions(-) diff --git a/modules/apps/29-fee/keeper/escrow.go b/modules/apps/29-fee/keeper/escrow.go index 36571450fb0..648475e09e0 100644 --- a/modules/apps/29-fee/keeper/escrow.go +++ b/modules/apps/29-fee/keeper/escrow.go @@ -160,7 +160,7 @@ func (k Keeper) distributeFee(ctx context.Context, receiver, refundAccAddress sd err := k.bankKeeper.SendCoinsFromModuleToAccount(cacheCtx, types.ModuleName, receiver, fee) if err != nil { if bytes.Equal(receiver, refundAccAddress) { - k.Logger(ctx).Error("error distributing fee", "receiver address", receiver, "fee", fee) + k.Logger.Error("error distributing fee", "receiver address", receiver, "fee", fee) return // if sending to the refund address already failed, then return (no-op) } @@ -168,7 +168,7 @@ func (k Keeper) distributeFee(ctx context.Context, receiver, refundAccAddress sd // then attempt to refund the fee to the original sender err := k.bankKeeper.SendCoinsFromModuleToAccount(cacheCtx, types.ModuleName, refundAccAddress, fee) if err != nil { - k.Logger(ctx).Error("error refunding fee to the original sender", "refund address", refundAccAddress, "fee", fee) + k.Logger.Error("error refunding fee to the original sender", "refund address", refundAccAddress, "fee", fee) return // if sending to the refund address fails, no-op } diff --git a/modules/apps/29-fee/keeper/grpc_query.go b/modules/apps/29-fee/keeper/grpc_query.go index cd6a0e05f33..2edf869dcc4 100644 --- a/modules/apps/29-fee/keeper/grpc_query.go +++ b/modules/apps/29-fee/keeper/grpc_query.go @@ -28,7 +28,7 @@ func (k Keeper) IncentivizedPackets(ctx context.Context, req *types.QueryIncenti var identifiedPackets []types.IdentifiedPacketFees - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), []byte(types.FeesInEscrowPrefix)) + store := prefix.NewStore(runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)), []byte(types.FeesInEscrowPrefix)) pagination, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { packetID, err := types.ParseKeyFeesInEscrow(types.FeesInEscrowPrefix + string(key)) if err != nil { @@ -90,7 +90,7 @@ func (k Keeper) IncentivizedPacketsForChannel(goCtx context.Context, req *types. var packets []*types.IdentifiedPacketFees keyPrefix := types.KeyFeesInEscrowChannelPrefix(req.PortId, req.ChannelId) - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), keyPrefix) + store := prefix.NewStore(runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)), keyPrefix) pagination, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { packetID, err := types.ParseKeyFeesInEscrow(string(keyPrefix) + string(key)) if err != nil { @@ -235,7 +235,7 @@ func (k Keeper) FeeEnabledChannels(ctx context.Context, req *types.QueryFeeEnabl } var feeEnabledChannels []types.FeeEnabledChannel - store := prefix.NewStore(runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)), []byte(types.FeeEnabledKeyPrefix)) + store := prefix.NewStore(runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)), []byte(types.FeeEnabledKeyPrefix)) pagination, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { portID, channelID, err := types.ParseKeyFeeEnabled(types.FeeEnabledKeyPrefix + string(key)) if err != nil { diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index 3e0da0a1d56..e6b94ca2ed1 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -3,8 +3,7 @@ package keeper import ( "context" - corestore "cosmossdk.io/core/store" - "cosmossdk.io/log" + "cosmossdk.io/core/appmodule" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" @@ -14,7 +13,6 @@ import ( "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v9/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported" coretypes "github.com/cosmos/ibc-go/v9/modules/core/types" ) @@ -24,8 +22,8 @@ var _ types.ChannelKeeper = (*Keeper)(nil) // Keeper defines the IBC fungible transfer keeper type Keeper struct { - storeService corestore.KVStoreService - cdc codec.BinaryCodec + appmodule.Environment + cdc codec.BinaryCodec authKeeper types.AccountKeeper ics4Wrapper porttypes.ICS4Wrapper @@ -35,13 +33,13 @@ type Keeper struct { // NewKeeper creates a new 29-fee Keeper instance func NewKeeper( - cdc codec.BinaryCodec, storeService corestore.KVStoreService, + cdc codec.BinaryCodec, env appmodule.Environment, ics4Wrapper porttypes.ICS4Wrapper, channelKeeper types.ChannelKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ) Keeper { return Keeper{ cdc: cdc, - storeService: storeService, + Environment: env, ics4Wrapper: ics4Wrapper, channelKeeper: channelKeeper, authKeeper: authKeeper, @@ -61,12 +59,6 @@ func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { return k.ics4Wrapper } -// Logger returns a module-specific logger. -func (Keeper) Logger(ctx context.Context) log.Logger { - sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 - return sdkCtx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) -} - // GetChannel wraps IBC ChannelKeeper's GetChannel function func (k Keeper) GetChannel(ctx context.Context, portID, channelID string) (channeltypes.Channel, bool) { return k.channelKeeper.GetChannel(ctx, portID, channelID) @@ -107,7 +99,7 @@ func (k Keeper) EscrowAccountHasBalance(ctx context.Context, coins sdk.Coins) bo // identified by channel and port identifiers. // Please see ADR 004 for more information. func (k Keeper) lockFeeModule(ctx context.Context) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) if err := store.Set(types.KeyLocked(), []byte{1}); err != nil { panic(err) } @@ -116,7 +108,7 @@ func (k Keeper) lockFeeModule(ctx context.Context) { // IsLocked indicates if the fee module is locked // Please see ADR 004 for more information. func (k Keeper) IsLocked(ctx context.Context) bool { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) has, err := store.Has(types.KeyLocked()) if err != nil { panic(err) @@ -127,7 +119,7 @@ func (k Keeper) IsLocked(ctx context.Context) bool { // SetFeeEnabled sets a flag to determine if fee handling logic should run for the given channel // identified by channel and port identifiers. func (k Keeper) SetFeeEnabled(ctx context.Context, portID, channelID string) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) if err := store.Set(types.KeyFeeEnabled(portID, channelID), []byte{1}); err != nil { panic(err) } @@ -135,7 +127,7 @@ func (k Keeper) SetFeeEnabled(ctx context.Context, portID, channelID string) { // DeleteFeeEnabled deletes the fee enabled flag for a given portID and channelID func (k Keeper) DeleteFeeEnabled(ctx context.Context, portID, channelID string) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) if err := store.Delete(types.KeyFeeEnabled(portID, channelID)); err != nil { panic(err) } @@ -144,7 +136,7 @@ func (k Keeper) DeleteFeeEnabled(ctx context.Context, portID, channelID string) // IsFeeEnabled returns whether fee handling logic should be run for the given port. It will check the // fee enabled flag for the given port and channel identifiers func (k Keeper) IsFeeEnabled(ctx context.Context, portID, channelID string) bool { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) has, err := store.Has(types.KeyFeeEnabled(portID, channelID)) if err != nil { panic(err) @@ -154,9 +146,9 @@ func (k Keeper) IsFeeEnabled(ctx context.Context, portID, channelID string) bool // GetAllFeeEnabledChannels returns a list of all ics29 enabled channels containing portID & channelID that are stored in state func (k Keeper) GetAllFeeEnabledChannels(ctx context.Context) []types.FeeEnabledChannel { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, []byte(types.FeeEnabledKeyPrefix)) - defer coretypes.LogDeferred(k.Logger(ctx), func() error { return iterator.Close() }) + defer coretypes.LogDeferred(k.Logger, func() error { return iterator.Close() }) var enabledChArr []types.FeeEnabledChannel for ; iterator.Valid(); iterator.Next() { @@ -177,7 +169,7 @@ func (k Keeper) GetAllFeeEnabledChannels(ctx context.Context) []types.FeeEnabled // GetPayeeAddress retrieves the fee payee address stored in state given the provided channel identifier and relayer address func (k Keeper) GetPayeeAddress(ctx context.Context, relayerAddr, channelID string) (string, bool) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyPayee(relayerAddr, channelID) bz, err := store.Get(key) @@ -194,7 +186,7 @@ func (k Keeper) GetPayeeAddress(ctx context.Context, relayerAddr, channelID stri // SetPayeeAddress stores the fee payee address in state keyed by the provided channel identifier and relayer address func (k Keeper) SetPayeeAddress(ctx context.Context, relayerAddr, payeeAddr, channelID string) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) if err := store.Set(types.KeyPayee(relayerAddr, channelID), []byte(payeeAddr)); err != nil { panic(err) } @@ -202,9 +194,9 @@ func (k Keeper) SetPayeeAddress(ctx context.Context, relayerAddr, payeeAddr, cha // GetAllPayees returns all registered payees addresses func (k Keeper) GetAllPayees(ctx context.Context) []types.RegisteredPayee { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, []byte(types.PayeeKeyPrefix)) - defer coretypes.LogDeferred(k.Logger(ctx), func() error { return iterator.Close() }) + defer coretypes.LogDeferred(k.Logger, func() error { return iterator.Close() }) var registeredPayees []types.RegisteredPayee for ; iterator.Valid(); iterator.Next() { @@ -228,7 +220,7 @@ func (k Keeper) GetAllPayees(ctx context.Context) []types.RegisteredPayee { // SetCounterpartyPayeeAddress maps the destination chain counterparty payee address to the source relayer address // The receiving chain must store the mapping from: address -> counterpartyPayeeAddress for the given channel func (k Keeper) SetCounterpartyPayeeAddress(ctx context.Context, address, counterpartyAddress, channelID string) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) if err := store.Set(types.KeyCounterpartyPayee(address, channelID), []byte(counterpartyAddress)); err != nil { panic(err) } @@ -236,7 +228,7 @@ func (k Keeper) SetCounterpartyPayeeAddress(ctx context.Context, address, counte // GetCounterpartyPayeeAddress gets the counterparty payee address given a destination relayer address func (k Keeper) GetCounterpartyPayeeAddress(ctx context.Context, address, channelID string) (string, bool) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyCounterpartyPayee(address, channelID) addr, err := store.Get(key) @@ -252,9 +244,9 @@ func (k Keeper) GetCounterpartyPayeeAddress(ctx context.Context, address, channe // GetAllCounterpartyPayees returns all registered counterparty payee addresses func (k Keeper) GetAllCounterpartyPayees(ctx context.Context) []types.RegisteredCounterpartyPayee { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, []byte(types.CounterpartyPayeeKeyPrefix)) - defer coretypes.LogDeferred(k.Logger(ctx), func() error { return iterator.Close() }) + defer coretypes.LogDeferred(k.Logger, func() error { return iterator.Close() }) var registeredCounterpartyPayees []types.RegisteredCounterpartyPayee for ; iterator.Valid(); iterator.Next() { @@ -277,7 +269,7 @@ func (k Keeper) GetAllCounterpartyPayees(ctx context.Context) []types.Registered // SetRelayerAddressForAsyncAck sets the forward relayer address during OnRecvPacket in case of async acknowledgement func (k Keeper) SetRelayerAddressForAsyncAck(ctx context.Context, packetID channeltypes.PacketId, address string) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) if err := store.Set(types.KeyRelayerAddressForAsyncAck(packetID), []byte(address)); err != nil { panic(err) } @@ -285,7 +277,7 @@ func (k Keeper) SetRelayerAddressForAsyncAck(ctx context.Context, packetID chann // GetRelayerAddressForAsyncAck gets forward relayer address for a particular packet func (k Keeper) GetRelayerAddressForAsyncAck(ctx context.Context, packetID channeltypes.PacketId) (string, bool) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyRelayerAddressForAsyncAck(packetID) addr, err := store.Get(key) @@ -302,9 +294,9 @@ func (k Keeper) GetRelayerAddressForAsyncAck(ctx context.Context, packetID chann // GetAllForwardRelayerAddresses returns all forward relayer addresses stored for async acknowledgements func (k Keeper) GetAllForwardRelayerAddresses(ctx context.Context) []types.ForwardRelayerAddress { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, []byte(types.ForwardRelayerPrefix)) - defer coretypes.LogDeferred(k.Logger(ctx), func() error { return iterator.Close() }) + defer coretypes.LogDeferred(k.Logger, func() error { return iterator.Close() }) var forwardRelayerAddr []types.ForwardRelayerAddress for ; iterator.Valid(); iterator.Next() { @@ -326,7 +318,7 @@ func (k Keeper) GetAllForwardRelayerAddresses(ctx context.Context) []types.Forwa // DeleteForwardRelayerAddress deletes the forwardRelayerAddr associated with the packetID func (k Keeper) DeleteForwardRelayerAddress(ctx context.Context, packetID channeltypes.PacketId) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyRelayerAddressForAsyncAck(packetID) if err := store.Delete(key); err != nil { panic(err) @@ -335,7 +327,7 @@ func (k Keeper) DeleteForwardRelayerAddress(ctx context.Context, packetID channe // GetFeesInEscrow returns all escrowed packet fees for a given packetID func (k Keeper) GetFeesInEscrow(ctx context.Context, packetID channeltypes.PacketId) (types.PacketFees, bool) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyFeesInEscrow(packetID) bz, err := store.Get(key) if err != nil { @@ -350,7 +342,7 @@ func (k Keeper) GetFeesInEscrow(ctx context.Context, packetID channeltypes.Packe // HasFeesInEscrow returns true if packet fees exist for the provided packetID func (k Keeper) HasFeesInEscrow(ctx context.Context, packetID channeltypes.PacketId) bool { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyFeesInEscrow(packetID) has, err := store.Has(key) if err != nil { @@ -361,7 +353,7 @@ func (k Keeper) HasFeesInEscrow(ctx context.Context, packetID channeltypes.Packe // SetFeesInEscrow sets the given packet fees in escrow keyed by the packetID func (k Keeper) SetFeesInEscrow(ctx context.Context, packetID channeltypes.PacketId, fees types.PacketFees) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) bz := k.MustMarshalFees(fees) if err := store.Set(types.KeyFeesInEscrow(packetID), bz); err != nil { panic(err) @@ -370,7 +362,7 @@ func (k Keeper) SetFeesInEscrow(ctx context.Context, packetID channeltypes.Packe // DeleteFeesInEscrow deletes the fee associated with the given packetID func (k Keeper) DeleteFeesInEscrow(ctx context.Context, packetID channeltypes.PacketId) { - store := k.storeService.OpenKVStore(ctx) + store := k.KVStoreService.OpenKVStore(ctx) key := types.KeyFeesInEscrow(packetID) if err := store.Delete(key); err != nil { panic(err) @@ -381,10 +373,10 @@ func (k Keeper) DeleteFeesInEscrow(ctx context.Context, packetID channeltypes.Pa func (k Keeper) GetIdentifiedPacketFeesForChannel(ctx context.Context, portID, channelID string) []types.IdentifiedPacketFees { var identifiedPacketFees []types.IdentifiedPacketFees - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, types.KeyFeesInEscrowChannelPrefix(portID, channelID)) - defer coretypes.LogDeferred(k.Logger(ctx), func() error { return iterator.Close() }) + defer coretypes.LogDeferred(k.Logger, func() error { return iterator.Close() }) for ; iterator.Valid(); iterator.Next() { packetID, err := types.ParseKeyFeesInEscrow(string(iterator.Key())) if err != nil { @@ -402,9 +394,9 @@ func (k Keeper) GetIdentifiedPacketFeesForChannel(ctx context.Context, portID, c // GetAllIdentifiedPacketFees returns a list of all IdentifiedPacketFees that are stored in state func (k Keeper) GetAllIdentifiedPacketFees(ctx context.Context) []types.IdentifiedPacketFees { - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, []byte(types.FeesInEscrowPrefix)) - defer coretypes.LogDeferred(k.Logger(ctx), func() error { return iterator.Close() }) + defer coretypes.LogDeferred(k.Logger, func() error { return iterator.Close() }) var identifiedFees []types.IdentifiedPacketFees for ; iterator.Valid(); iterator.Next() { diff --git a/modules/apps/29-fee/keeper/migrations.go b/modules/apps/29-fee/keeper/migrations.go index 971a692e48c..6bb05548796 100644 --- a/modules/apps/29-fee/keeper/migrations.go +++ b/modules/apps/29-fee/keeper/migrations.go @@ -25,7 +25,7 @@ func NewMigrator(keeper Keeper) Migrator { // Migrate1to2 migrates ibc-fee module from ConsensusVersion 1 to 2 // by refunding leftover fees to the refund address. func (m Migrator) Migrate1to2(ctx sdk.Context) error { - store := runtime.KVStoreAdapter(m.keeper.storeService.OpenKVStore(ctx)) + store := runtime.KVStoreAdapter(m.keeper.KVStoreService.OpenKVStore(ctx)) iterator := storetypes.KVStorePrefixIterator(store, []byte(types.FeesInEscrowPrefix)) defer coretypes.LogDeferred(ctx.Logger(), func() error { return iterator.Close() }) diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go index 421fe6cf1a9..24e714ef97d 100644 --- a/modules/apps/29-fee/keeper/msg_server.go +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -40,7 +40,7 @@ func (k Keeper) RegisterPayee(ctx context.Context, msg *types.MsgRegisterPayee) k.SetPayeeAddress(ctx, msg.Relayer, msg.Payee, msg.ChannelId) - k.Logger(ctx).Info("registering payee address for relayer", "relayer", msg.Relayer, "payee", msg.Payee, "channel", msg.ChannelId) + k.Logger.Info("registering payee address for relayer", "relayer", msg.Relayer, "payee", msg.Payee, "channel", msg.ChannelId) emitRegisterPayeeEvent(ctx, msg.Relayer, msg.Payee, msg.ChannelId) @@ -64,7 +64,7 @@ func (k Keeper) RegisterCounterpartyPayee(ctx context.Context, msg *types.MsgReg k.SetCounterpartyPayeeAddress(ctx, msg.Relayer, msg.CounterpartyPayee, msg.ChannelId) - k.Logger(ctx).Info("registering counterparty payee for relayer", "relayer", msg.Relayer, "counterparty payee", msg.CounterpartyPayee, "channel", msg.ChannelId) + k.Logger.Info("registering counterparty payee for relayer", "relayer", msg.Relayer, "counterparty payee", msg.CounterpartyPayee, "channel", msg.ChannelId) emitRegisterCounterpartyPayeeEvent(ctx, msg.Relayer, msg.CounterpartyPayee, msg.ChannelId) diff --git a/modules/apps/callbacks/testing/simapp/app.go b/modules/apps/callbacks/testing/simapp/app.go index 330878d0af9..04aa589aad8 100644 --- a/modules/apps/callbacks/testing/simapp/app.go +++ b/modules/apps/callbacks/testing/simapp/app.go @@ -424,7 +424,8 @@ func NewSimApp( // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), + appCodec, + runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), logger.With(log.ModuleKey, "x/ibc-fee")), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, app.AuthKeeper, app.BankKeeper, diff --git a/modules/light-clients/08-wasm/testing/simapp/app.go b/modules/light-clients/08-wasm/testing/simapp/app.go index d132314a756..d1e4b81f248 100644 --- a/modules/light-clients/08-wasm/testing/simapp/app.go +++ b/modules/light-clients/08-wasm/testing/simapp/app.go @@ -551,7 +551,8 @@ func NewSimApp( // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), + appCodec, + runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), logger.With(log.ModuleKey, "x/ibc-fee")), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, app.AuthKeeper, app.BankKeeper, diff --git a/simapp/app.go b/simapp/app.go index 080d09a3533..d9e7b63fd38 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -530,7 +530,8 @@ func NewSimApp( // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), + appCodec, + runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), logger.With(log.ModuleKey, "x/ibc-fee")), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, app.AuthKeeper, app.BankKeeper, diff --git a/testing/simapp/app.go b/testing/simapp/app.go index 0f888e10d54..77e3d18af6b 100644 --- a/testing/simapp/app.go +++ b/testing/simapp/app.go @@ -507,7 +507,8 @@ func NewSimApp( // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( - appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), + appCodec, + runtime.NewEnvironment(runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), logger.With(log.ModuleKey, "x/ibc-fee")), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, app.AuthKeeper, app.BankKeeper,