Skip to content

Commit

Permalink
nit: vanity nits
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Oct 8, 2024
1 parent 288f2d3 commit f56cd9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 12 additions & 0 deletions modules/core/04-channel/v2/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f56cd9f

Please sign in to comment.