diff --git a/modules/core/04-channel/v2/keeper/keeper.go b/modules/core/04-channel/v2/keeper/keeper.go index 4f91a3ace6f..159efe8aada 100644 --- a/modules/core/04-channel/v2/keeper/keeper.go +++ b/modules/core/04-channel/v2/keeper/keeper.go @@ -199,3 +199,15 @@ func (k *Keeper) AliasV1Channel(ctx context.Context, portID, channelID string) ( } return counterparty, true } + +// getV1Counterparty attempts to retrieve a v1 channel from the channel keeper if it exists, then converts it +// to a v2 counterparty and stores it in the v2 channel keeper for future use +func (k *Keeper) getV1Counterparty(ctx context.Context, port, id string) (types.Counterparty, bool) { + if counterparty, ok := k.AliasV1Channel(ctx, port, id); ok { + // we can key on just the channel here since channel ids are globally unique + k.SetCounterparty(ctx, id, counterparty) + return counterparty, true + } + + return types.Counterparty{}, false +} diff --git a/modules/core/04-channel/v2/keeper/relay.go b/modules/core/04-channel/v2/keeper/packet.go similarity index 95% rename from modules/core/04-channel/v2/keeper/relay.go rename to modules/core/04-channel/v2/keeper/packet.go index ce079fa69ba..d3f8c62822a 100644 --- a/modules/core/04-channel/v2/keeper/relay.go +++ b/modules/core/04-channel/v2/keeper/packet.go @@ -17,18 +17,6 @@ import ( "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ) -// getV1Counterparty attempts to retrieve a v1 channel from the channel keeper if it exists, then converts it -// to a v2 counterparty and stores it in the v2 channel keeper for future use -func (k *Keeper) getV1Counterparty(ctx context.Context, port, id string) (channeltypesv2.Counterparty, bool) { - if counterparty, ok := k.AliasV1Channel(ctx, port, id); ok { - // we can key on just the channel here since channel ids are globally unique - k.SetCounterparty(ctx, id, counterparty) - return counterparty, true - } - - return channeltypesv2.Counterparty{}, false -} - // sendPacket constructs a packet from the input arguments, writes a packet commitment to state // in order for the packet to be sent to the counterparty. func (k *Keeper) sendPacket(