diff --git a/x/tunnel/keeper/keeper_packet_ibc.go b/x/tunnel/keeper/keeper_packet_ibc.go index aa3e2782c..74ca63e17 100644 --- a/x/tunnel/keeper/keeper_packet_ibc.go +++ b/x/tunnel/keeper/keeper_packet_ibc.go @@ -49,5 +49,5 @@ func (k Keeper) SendIBCPacket( return nil, err } - return types.NewIBCPacketReceipt(route.ChannelID, sequence), nil + return types.NewIBCPacketReceipt(sequence), nil } diff --git a/x/tunnel/types/route_ibc.go b/x/tunnel/types/route_ibc.go index d7bb5bc10..f34c32f3d 100644 --- a/x/tunnel/types/route_ibc.go +++ b/x/tunnel/types/route_ibc.go @@ -2,7 +2,8 @@ package types import ( "fmt" - "regexp" + + channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,10 +13,6 @@ import ( // IBCRoute defines the IBC route for the tunnel module var _ RouteI = &IBCRoute{} -// IsChannelIDFormat checks if a channelID is in the format required on the SDK for -// parsing channel identifiers. The channel identifier must be in the form: `channel-{N} -var IsChannelIDFormat = regexp.MustCompile(`^channel-[0-9]{1,20}$`).MatchString - // NewIBCRoute creates a new IBCRoute instance. func NewIBCRoute(channelID string) *IBCRoute { return &IBCRoute{ @@ -26,14 +23,14 @@ func NewIBCRoute(channelID string) *IBCRoute { // Route defines the IBC route for the tunnel module func (r *IBCRoute) ValidateBasic() error { // Validate the ChannelID format - if !IsChannelIDFormat(r.ChannelID) { + if !channeltypes.IsChannelIDFormat(r.ChannelID) { return fmt.Errorf("channel identifier is not in the format: `channel-{N}`") } return nil } // NewIBCPacketReceipt creates a new IBCPacketReceipt instance. -func NewIBCPacketReceipt(channelID string, sequence uint64) *IBCPacketReceipt { +func NewIBCPacketReceipt(sequence uint64) *IBCPacketReceipt { return &IBCPacketReceipt{ Sequence: sequence, }