diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bd8c4266e0..3c21957809f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking +* (modules/core) [\#161](https://github.com/cosmos/ibc-go/pull/161) Remove Type(), Route(), GetSignBytes() from 02-client, 03-connection, and 04-channel messages. * (modules) [\#140](https://github.com/cosmos/ibc-go/pull/140) IsFrozen() client state interface changed to Status(). gRPC `ClientStatus` route added. * (modules/core) [\#109](https://github.com/cosmos/ibc-go/pull/109) Remove connection and channel handshake CLI commands. * (modules) [\#107](https://github.com/cosmos/ibc-go/pull/107) Modify OnRecvPacket callback to return an acknowledgement which indicates if it is successful or not. Callback state changes are discarded for unsuccessful acknowledgements only. diff --git a/modules/core/02-client/types/msgs.go b/modules/core/02-client/types/msgs.go index 46538c95580..e2ff1ca02b1 100644 --- a/modules/core/02-client/types/msgs.go +++ b/modules/core/02-client/types/msgs.go @@ -51,16 +51,6 @@ func NewMsgCreateClient( }, nil } -// Route implements sdk.Msg -func (msg MsgCreateClient) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgCreateClient) Type() string { - return TypeMsgCreateClient -} - // ValidateBasic implements sdk.Msg func (msg MsgCreateClient) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Signer) @@ -90,12 +80,6 @@ func (msg MsgCreateClient) ValidateBasic() error { return consensusState.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgCreateClient) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgCreateClient) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) @@ -132,16 +116,6 @@ func NewMsgUpdateClient(id string, header exported.Header, signer string) (*MsgU }, nil } -// Route implements sdk.Msg -func (msg MsgUpdateClient) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgUpdateClient) Type() string { - return TypeMsgUpdateClient -} - // ValidateBasic implements sdk.Msg func (msg MsgUpdateClient) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Signer) @@ -161,12 +135,6 @@ func (msg MsgUpdateClient) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgUpdateClient) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgUpdateClient) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) @@ -205,16 +173,6 @@ func NewMsgUpgradeClient(clientID string, clientState exported.ClientState, cons }, nil } -// Route implements sdk.Msg -func (msg MsgUpgradeClient) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgUpgradeClient) Type() string { - return TypeMsgUpgradeClient -} - // ValidateBasic implements sdk.Msg func (msg MsgUpgradeClient) ValidateBasic() error { // will not validate client state as committed client may not form a valid client state. @@ -247,12 +205,6 @@ func (msg MsgUpgradeClient) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgUpgradeClient) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgUpgradeClient) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) @@ -289,14 +241,6 @@ func NewMsgSubmitMisbehaviour(clientID string, misbehaviour exported.Misbehaviou }, nil } -// Route returns the MsgSubmitClientMisbehaviour's route. -func (msg MsgSubmitMisbehaviour) Route() string { return host.RouterKey } - -// Type returns the MsgSubmitMisbehaviour's type. -func (msg MsgSubmitMisbehaviour) Type() string { - return TypeMsgSubmitMisbehaviour -} - // ValidateBasic performs basic (non-state-dependant) validation on a MsgSubmitMisbehaviour. func (msg MsgSubmitMisbehaviour) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Signer) @@ -321,12 +265,6 @@ func (msg MsgSubmitMisbehaviour) ValidateBasic() error { return host.ClientIdentifierValidator(msg.ClientId) } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgSubmitMisbehaviour) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners returns the single expected signer for a MsgSubmitMisbehaviour. func (msg MsgSubmitMisbehaviour) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) diff --git a/modules/core/03-connection/types/events.go b/modules/core/03-connection/types/events.go index 37973ed5129..94615c431ce 100644 --- a/modules/core/03-connection/types/events.go +++ b/modules/core/03-connection/types/events.go @@ -16,10 +16,10 @@ const ( // IBC connection events vars var ( - EventTypeConnectionOpenInit = MsgConnectionOpenInit{}.Type() - EventTypeConnectionOpenTry = MsgConnectionOpenTry{}.Type() - EventTypeConnectionOpenAck = MsgConnectionOpenAck{}.Type() - EventTypeConnectionOpenConfirm = MsgConnectionOpenConfirm{}.Type() + EventTypeConnectionOpenInit = "connection_open_init" + EventTypeConnectionOpenTry = "connection_open_try" + EventTypeConnectionOpenAck = "connection_open_ack" + EventTypeConnectionOpenConfirm = "connection_open_confirm" AttributeValueCategory = fmt.Sprintf("%s_%s", host.ModuleName, SubModuleName) ) diff --git a/modules/core/03-connection/types/msgs.go b/modules/core/03-connection/types/msgs.go index 0ef6f06bbec..7d6f88faac3 100644 --- a/modules/core/03-connection/types/msgs.go +++ b/modules/core/03-connection/types/msgs.go @@ -39,16 +39,6 @@ func NewMsgConnectionOpenInit( } } -// Route implements sdk.Msg -func (msg MsgConnectionOpenInit) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgConnectionOpenInit) Type() string { - return "connection_open_init" -} - // ValidateBasic implements sdk.Msg. func (msg MsgConnectionOpenInit) ValidateBasic() error { if err := host.ClientIdentifierValidator(msg.ClientId); err != nil { @@ -71,12 +61,6 @@ func (msg MsgConnectionOpenInit) ValidateBasic() error { return msg.Counterparty.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgConnectionOpenInit) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgConnectionOpenInit) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) @@ -114,16 +98,6 @@ func NewMsgConnectionOpenTry( } } -// Route implements sdk.Msg -func (msg MsgConnectionOpenTry) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgConnectionOpenTry) Type() string { - return "connection_open_try" -} - // ValidateBasic implements sdk.Msg func (msg MsgConnectionOpenTry) ValidateBasic() error { // an empty connection identifier indicates that a connection identifier should be generated @@ -184,12 +158,6 @@ func (msg MsgConnectionOpenTry) UnpackInterfaces(unpacker codectypes.AnyUnpacker return unpacker.UnpackAny(msg.ClientState, new(exported.ClientState)) } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgConnectionOpenTry) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgConnectionOpenTry) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) @@ -228,16 +196,6 @@ func (msg MsgConnectionOpenAck) UnpackInterfaces(unpacker codectypes.AnyUnpacker return unpacker.UnpackAny(msg.ClientState, new(exported.ClientState)) } -// Route implements sdk.Msg -func (msg MsgConnectionOpenAck) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgConnectionOpenAck) Type() string { - return "connection_open_ack" -} - // ValidateBasic implements sdk.Msg func (msg MsgConnectionOpenAck) ValidateBasic() error { if !IsValidConnectionID(msg.ConnectionId) { @@ -281,12 +239,6 @@ func (msg MsgConnectionOpenAck) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgConnectionOpenAck) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgConnectionOpenAck) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) @@ -310,16 +262,6 @@ func NewMsgConnectionOpenConfirm( } } -// Route implements sdk.Msg -func (msg MsgConnectionOpenConfirm) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgConnectionOpenConfirm) Type() string { - return "connection_open_confirm" -} - // ValidateBasic implements sdk.Msg func (msg MsgConnectionOpenConfirm) ValidateBasic() error { if !IsValidConnectionID(msg.ConnectionId) { @@ -338,12 +280,6 @@ func (msg MsgConnectionOpenConfirm) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgConnectionOpenConfirm) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgConnectionOpenConfirm) GetSigners() []sdk.AccAddress { accAddr, err := sdk.AccAddressFromBech32(msg.Signer) diff --git a/modules/core/04-channel/types/events.go b/modules/core/04-channel/types/events.go index 6229ebaaa4e..1ef14346bfb 100644 --- a/modules/core/04-channel/types/events.go +++ b/modules/core/04-channel/types/events.go @@ -14,11 +14,12 @@ const ( AttributeCounterpartyPortID = "counterparty_port_id" AttributeCounterpartyChannelID = "counterparty_channel_id" - EventTypeSendPacket = "send_packet" - EventTypeRecvPacket = "recv_packet" - EventTypeWriteAck = "write_acknowledgement" - EventTypeAcknowledgePacket = "acknowledge_packet" - EventTypeTimeoutPacket = "timeout_packet" + EventTypeSendPacket = "send_packet" + EventTypeRecvPacket = "recv_packet" + EventTypeWriteAck = "write_acknowledgement" + EventTypeAcknowledgePacket = "acknowledge_packet" + EventTypeTimeoutPacket = "timeout_packet" + EventTypeTimeoutPacketOnClose = "timeout_on_close_packet" // NOTE: DEPRECATED in favor of AttributeKeyDataHex AttributeKeyData = "packet_data" @@ -38,12 +39,12 @@ const ( // IBC channel events vars var ( - EventTypeChannelOpenInit = MsgChannelOpenInit{}.Type() - EventTypeChannelOpenTry = MsgChannelOpenTry{}.Type() - EventTypeChannelOpenAck = MsgChannelOpenAck{}.Type() - EventTypeChannelOpenConfirm = MsgChannelOpenConfirm{}.Type() - EventTypeChannelCloseInit = MsgChannelCloseInit{}.Type() - EventTypeChannelCloseConfirm = MsgChannelCloseConfirm{}.Type() + EventTypeChannelOpenInit = "channel_open_init" + EventTypeChannelOpenTry = "channel_open_try" + EventTypeChannelOpenAck = "channel_open_ack" + EventTypeChannelOpenConfirm = "channel_open_confirm" + EventTypeChannelCloseInit = "channel_close_init" + EventTypeChannelCloseConfirm = "channel_close_confirm" AttributeValueCategory = fmt.Sprintf("%s_%s", host.ModuleName, SubModuleName) ) diff --git a/modules/core/04-channel/types/msgs.go b/modules/core/04-channel/types/msgs.go index 151b5582c74..784aa6f92b6 100644 --- a/modules/core/04-channel/types/msgs.go +++ b/modules/core/04-channel/types/msgs.go @@ -28,16 +28,6 @@ func NewMsgChannelOpenInit( } } -// Route implements sdk.Msg -func (msg MsgChannelOpenInit) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgChannelOpenInit) Type() string { - return "channel_open_init" -} - // ValidateBasic implements sdk.Msg func (msg MsgChannelOpenInit) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.PortId); err != nil { @@ -59,12 +49,6 @@ func (msg MsgChannelOpenInit) ValidateBasic() error { return msg.Channel.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgChannelOpenInit) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgChannelOpenInit) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -96,16 +80,6 @@ func NewMsgChannelOpenTry( } } -// Route implements sdk.Msg -func (msg MsgChannelOpenTry) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgChannelOpenTry) Type() string { - return "channel_open_try" -} - // ValidateBasic implements sdk.Msg func (msg MsgChannelOpenTry) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.PortId); err != nil { @@ -140,12 +114,6 @@ func (msg MsgChannelOpenTry) ValidateBasic() error { return msg.Channel.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgChannelOpenTry) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgChannelOpenTry) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -174,16 +142,6 @@ func NewMsgChannelOpenAck( } } -// Route implements sdk.Msg -func (msg MsgChannelOpenAck) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgChannelOpenAck) Type() string { - return "channel_open_ack" -} - // ValidateBasic implements sdk.Msg func (msg MsgChannelOpenAck) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.PortId); err != nil { @@ -208,12 +166,6 @@ func (msg MsgChannelOpenAck) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgChannelOpenAck) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgChannelOpenAck) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -240,16 +192,6 @@ func NewMsgChannelOpenConfirm( } } -// Route implements sdk.Msg -func (msg MsgChannelOpenConfirm) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgChannelOpenConfirm) Type() string { - return "channel_open_confirm" -} - // ValidateBasic implements sdk.Msg func (msg MsgChannelOpenConfirm) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.PortId); err != nil { @@ -271,12 +213,6 @@ func (msg MsgChannelOpenConfirm) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgChannelOpenConfirm) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgChannelOpenConfirm) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -300,16 +236,6 @@ func NewMsgChannelCloseInit( } } -// Route implements sdk.Msg -func (msg MsgChannelCloseInit) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgChannelCloseInit) Type() string { - return "channel_close_init" -} - // ValidateBasic implements sdk.Msg func (msg MsgChannelCloseInit) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.PortId); err != nil { @@ -325,12 +251,6 @@ func (msg MsgChannelCloseInit) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgChannelCloseInit) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgChannelCloseInit) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -357,16 +277,6 @@ func NewMsgChannelCloseConfirm( } } -// Route implements sdk.Msg -func (msg MsgChannelCloseConfirm) Route() string { - return host.RouterKey -} - -// Type implements sdk.Msg -func (msg MsgChannelCloseConfirm) Type() string { - return "channel_close_confirm" -} - // ValidateBasic implements sdk.Msg func (msg MsgChannelCloseConfirm) ValidateBasic() error { if err := host.PortIdentifierValidator(msg.PortId); err != nil { @@ -388,12 +298,6 @@ func (msg MsgChannelCloseConfirm) ValidateBasic() error { return nil } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgChannelCloseConfirm) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgChannelCloseConfirm) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -419,11 +323,6 @@ func NewMsgRecvPacket( } } -// Route implements sdk.Msg -func (msg MsgRecvPacket) Route() string { - return host.RouterKey -} - // ValidateBasic implements sdk.Msg func (msg MsgRecvPacket) ValidateBasic() error { if len(msg.ProofCommitment) == 0 { @@ -439,12 +338,6 @@ func (msg MsgRecvPacket) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgRecvPacket) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetDataSignBytes returns the base64-encoded bytes used for the // data field when signing the packet. func (msg MsgRecvPacket) GetDataSignBytes() []byte { @@ -461,11 +354,6 @@ func (msg MsgRecvPacket) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -// Type implements sdk.Msg -func (msg MsgRecvPacket) Type() string { - return "recv_packet" -} - var _ sdk.Msg = &MsgTimeout{} // NewMsgTimeout constructs new MsgTimeout @@ -483,11 +371,6 @@ func NewMsgTimeout( } } -// Route implements sdk.Msg -func (msg MsgTimeout) Route() string { - return host.RouterKey -} - // ValidateBasic implements sdk.Msg func (msg MsgTimeout) ValidateBasic() error { if len(msg.ProofUnreceived) == 0 { @@ -506,12 +389,6 @@ func (msg MsgTimeout) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgTimeout) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgTimeout) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -521,11 +398,6 @@ func (msg MsgTimeout) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -// Type implements sdk.Msg -func (msg MsgTimeout) Type() string { - return "timeout_packet" -} - // NewMsgTimeoutOnClose constructs new MsgTimeoutOnClose // nolint:interfacer func NewMsgTimeoutOnClose( @@ -543,11 +415,6 @@ func NewMsgTimeoutOnClose( } } -// Route implements sdk.Msg -func (msg MsgTimeoutOnClose) Route() string { - return host.RouterKey -} - // ValidateBasic implements sdk.Msg func (msg MsgTimeoutOnClose) ValidateBasic() error { if msg.NextSequenceRecv == 0 { @@ -569,12 +436,6 @@ func (msg MsgTimeoutOnClose) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgTimeoutOnClose) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgTimeoutOnClose) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -584,11 +445,6 @@ func (msg MsgTimeoutOnClose) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } -// Type implements sdk.Msg -func (msg MsgTimeoutOnClose) Type() string { - return "timeout_on_close_packet" -} - var _ sdk.Msg = &MsgAcknowledgement{} // NewMsgAcknowledgement constructs a new MsgAcknowledgement @@ -608,11 +464,6 @@ func NewMsgAcknowledgement( } } -// Route implements sdk.Msg -func (msg MsgAcknowledgement) Route() string { - return host.RouterKey -} - // ValidateBasic implements sdk.Msg func (msg MsgAcknowledgement) ValidateBasic() error { if len(msg.ProofAcked) == 0 { @@ -631,12 +482,6 @@ func (msg MsgAcknowledgement) ValidateBasic() error { return msg.Packet.ValidateBasic() } -// GetSignBytes implements sdk.Msg. The function will panic since it is used -// for amino transaction verification which IBC does not support. -func (msg MsgAcknowledgement) GetSignBytes() []byte { - panic("IBC messages do not support amino") -} - // GetSigners implements sdk.Msg func (msg MsgAcknowledgement) GetSigners() []sdk.AccAddress { signer, err := sdk.AccAddressFromBech32(msg.Signer) @@ -645,8 +490,3 @@ func (msg MsgAcknowledgement) GetSigners() []sdk.AccAddress { } return []sdk.AccAddress{signer} } - -// Type implements sdk.Msg -func (msg MsgAcknowledgement) Type() string { - return "acknowledge_packet" -} diff --git a/modules/core/04-channel/types/msgs_test.go b/modules/core/04-channel/types/msgs_test.go index a296520e654..10401ebcae7 100644 --- a/modules/core/04-channel/types/msgs_test.go +++ b/modules/core/04-channel/types/msgs_test.go @@ -315,12 +315,6 @@ func (suite *TypesTestSuite) TestMsgChannelCloseConfirmValidateBasic() { } } -func (suite *TypesTestSuite) TestMsgRecvPacketType() { - msg := types.NewMsgRecvPacket(packet, suite.proof, height, addr) - - suite.Equal("recv_packet", msg.Type()) -} - func (suite *TypesTestSuite) TestMsgRecvPacketValidateBasic() { testCases := []struct { name string diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index a64cb2ec86b..8c3d879acd3 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -462,7 +462,7 @@ func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacke defer func() { telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, + []string{"tx", "msg", "ibc", channeltypes.EventTypeRecvPacket}, 1, []metrics.Label{ telemetry.NewLabel("source-port", msg.Packet.SourcePort), @@ -604,7 +604,7 @@ func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAckn defer func() { telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, + []string{"tx", "msg", "ibc", channeltypes.EventTypeAcknowledgePacket}, 1, []metrics.Label{ telemetry.NewLabel("source-port", msg.Packet.SourcePort),