From f3c76cd55b65d85067d46ab79da51975e439e0bc Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Tue, 16 Jan 2024 15:32:34 +0100 Subject: [PATCH] chore: remove `upgrade` prefix from upgrade event attributes (#5603) * chore: remove upgrade prefix from upgrade event attributes * add migration docs for v9 * Update docs/docs/05-migrations/12-v8-to-v9.md Co-authored-by: DimitrisJim * rename attribute string --------- Co-authored-by: DimitrisJim --- docs/docs/05-migrations/12-v8-to-v9.md | 35 ++++ modules/core/04-channel/keeper/events.go | 42 ++--- modules/core/04-channel/types/events.go | 28 +-- modules/core/keeper/msg_server_test.go | 206 +++++++++++------------ 4 files changed, 173 insertions(+), 138 deletions(-) create mode 100644 docs/docs/05-migrations/12-v8-to-v9.md diff --git a/docs/docs/05-migrations/12-v8-to-v9.md b/docs/docs/05-migrations/12-v8-to-v9.md new file mode 100644 index 00000000000..c13e2e15c1e --- /dev/null +++ b/docs/docs/05-migrations/12-v8-to-v9.md @@ -0,0 +1,35 @@ +--- +title: IBC-Go v8 to v9 +sidebar_label: IBC-Go v8 to v9 +sidebar_position: 12 +slug: /migrations/v8-to-v9 +--- + +# Migrating from v8 to v9 + +This guide provides instructions for migrating to a new version of ibc-go. + +There are four sections based on the four potential user groups of this document: + +- [Chains](#chains) +- [IBC Apps](#ibc-apps) +- [Relayers](#relayers) +- [IBC Light Clients](#ibc-light-clients) + +**Note:** ibc-go supports golang semantic versioning and therefore all imports must be updated on major version releases. + +## Chains + +- No relevant changes were made in this release. + +## IBC Apps + +- No relevant changes were made in this release. + +## Relayers + +- Renaming of event attribute keys in [#5603](https://github.com/cosmos/ibc-go/pull/5603). + +## IBC Light Clients + +- No relevant changes were made in this release. diff --git a/modules/core/04-channel/keeper/events.go b/modules/core/04-channel/keeper/events.go index 44d9c75d941..a536ae848ae 100644 --- a/modules/core/04-channel/keeper/events.go +++ b/modules/core/04-channel/keeper/events.go @@ -19,7 +19,7 @@ func emitChannelOpenInitEvent(ctx sdk.Context, portID string, channelID string, sdk.NewAttribute(types.AttributeKeyChannelID, channelID), sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeVersion, channel.Version), + sdk.NewAttribute(types.AttributeKeyVersion, channel.Version), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -38,7 +38,7 @@ func emitChannelOpenTryEvent(ctx sdk.Context, portID string, channelID string, c sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeVersion, channel.Version), + sdk.NewAttribute(types.AttributeKeyVersion, channel.Version), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -280,9 +280,9 @@ func EmitChannelUpgradeInitEvent(ctx sdk.Context, portID string, channelID strin sdk.NewAttribute(types.AttributeKeyChannelID, channelID), sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyUpgradeConnectionHops, upgrade.Fields.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeKeyUpgradeVersion, upgrade.Fields.Version), - sdk.NewAttribute(types.AttributeKeyUpgradeOrdering, upgrade.Fields.Ordering.String()), + sdk.NewAttribute(types.AttributeKeyConnectionHops, upgrade.Fields.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeKeyVersion, upgrade.Fields.Version), + sdk.NewAttribute(types.AttributeKeyOrdering, upgrade.Fields.Ordering.String()), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), ), sdk.NewEvent( @@ -301,9 +301,9 @@ func EmitChannelUpgradeTryEvent(ctx sdk.Context, portID string, channelID string sdk.NewAttribute(types.AttributeKeyChannelID, channelID), sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyUpgradeConnectionHops, upgrade.Fields.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeKeyUpgradeVersion, upgrade.Fields.Version), - sdk.NewAttribute(types.AttributeKeyUpgradeOrdering, upgrade.Fields.Ordering.String()), + sdk.NewAttribute(types.AttributeKeyConnectionHops, upgrade.Fields.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeKeyVersion, upgrade.Fields.Version), + sdk.NewAttribute(types.AttributeKeyOrdering, upgrade.Fields.Ordering.String()), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), ), sdk.NewEvent( @@ -322,9 +322,9 @@ func EmitChannelUpgradeAckEvent(ctx sdk.Context, portID string, channelID string sdk.NewAttribute(types.AttributeKeyChannelID, channelID), sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyUpgradeConnectionHops, upgrade.Fields.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeKeyUpgradeVersion, upgrade.Fields.Version), - sdk.NewAttribute(types.AttributeKeyUpgradeOrdering, upgrade.Fields.Ordering.String()), + sdk.NewAttribute(types.AttributeKeyConnectionHops, upgrade.Fields.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeKeyVersion, upgrade.Fields.Version), + sdk.NewAttribute(types.AttributeKeyOrdering, upgrade.Fields.Ordering.String()), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), ), sdk.NewEvent( @@ -363,9 +363,9 @@ func EmitChannelUpgradeOpenEvent(ctx sdk.Context, portID string, channelID strin sdk.NewAttribute(types.AttributeKeyChannelState, currentChannel.State.String()), sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyUpgradeConnectionHops, currentChannel.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeKeyUpgradeVersion, currentChannel.Version), - sdk.NewAttribute(types.AttributeKeyUpgradeOrdering, currentChannel.Ordering.String()), + sdk.NewAttribute(types.AttributeKeyConnectionHops, currentChannel.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeKeyVersion, currentChannel.Version), + sdk.NewAttribute(types.AttributeKeyOrdering, currentChannel.Ordering.String()), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), ), sdk.NewEvent( @@ -384,9 +384,9 @@ func EmitChannelUpgradeTimeoutEvent(ctx sdk.Context, portID string, channelID st sdk.NewAttribute(types.AttributeKeyChannelID, channelID), sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyUpgradeConnectionHops, upgrade.Fields.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeKeyUpgradeVersion, upgrade.Fields.Version), - sdk.NewAttribute(types.AttributeKeyUpgradeOrdering, upgrade.Fields.Ordering.String()), + sdk.NewAttribute(types.AttributeKeyConnectionHops, upgrade.Fields.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeKeyVersion, upgrade.Fields.Version), + sdk.NewAttribute(types.AttributeKeyOrdering, upgrade.Fields.Ordering.String()), sdk.NewAttribute(types.AttributeKeyUpgradeTimeoutHeight, upgrade.Timeout.Height.String()), sdk.NewAttribute(types.AttributeKeyUpgradeTimeoutTimestamp, fmt.Sprintf("%d", upgrade.Timeout.Timestamp)), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), @@ -408,7 +408,7 @@ func EmitErrorReceiptEvent(ctx sdk.Context, portID string, channelID string, cur sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), - sdk.NewAttribute(types.AttributeKeyUpgradeErrorReceipt, err.Error()), + sdk.NewAttribute(types.AttributeKeyErrorReceipt, err.Error()), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -426,9 +426,9 @@ func EmitChannelUpgradeCancelEvent(ctx sdk.Context, portID string, channelID str sdk.NewAttribute(types.AttributeKeyChannelID, channelID), sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), - sdk.NewAttribute(types.AttributeKeyUpgradeConnectionHops, upgrade.Fields.ConnectionHops[0]), - sdk.NewAttribute(types.AttributeKeyUpgradeVersion, upgrade.Fields.Version), - sdk.NewAttribute(types.AttributeKeyUpgradeOrdering, upgrade.Fields.Ordering.String()), + sdk.NewAttribute(types.AttributeKeyConnectionHops, upgrade.Fields.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeKeyVersion, upgrade.Fields.Version), + sdk.NewAttribute(types.AttributeKeyOrdering, upgrade.Fields.Ordering.String()), sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", currentChannel.UpgradeSequence)), ), sdk.NewEvent( diff --git a/modules/core/04-channel/types/events.go b/modules/core/04-channel/types/events.go index 92ed9094022..6e7c7e83ae7 100644 --- a/modules/core/04-channel/types/events.go +++ b/modules/core/04-channel/types/events.go @@ -8,11 +8,20 @@ import ( // IBC channel events const ( - AttributeKeyConnectionID = "connection_id" - AttributeKeyPortID = "port_id" - AttributeKeyChannelID = "channel_id" - AttributeKeyChannelState = "channel_state" - AttributeVersion = "version" + AttributeKeyConnectionID = "connection_id" + AttributeKeyPortID = "port_id" + AttributeKeyChannelID = "channel_id" + AttributeKeyChannelState = "channel_state" + AttributeKeyVersion = "version" + AttributeKeyConnectionHops = "connection_hops" + AttributeKeyOrdering = "ordering" + + // upgrade specific keys + AttributeKeyUpgradeTimeoutHeight = "timeout_height" + AttributeKeyUpgradeTimeoutTimestamp = "timeout_timestamp" + AttributeKeyUpgradeSequence = "upgrade_sequence" + AttributeKeyErrorReceipt = "error_receipt" + AttributeCounterpartyPortID = "counterparty_port_id" AttributeCounterpartyChannelID = "counterparty_channel_id" @@ -38,15 +47,6 @@ const ( AttributeKeyDstChannel = "packet_dst_channel" AttributeKeyChannelOrdering = "packet_channel_ordering" AttributeKeyConnection = "packet_connection" - - // upgrade specific keys - AttributeKeyUpgradeSequence = "upgrade_sequence" - AttributeKeyUpgradeVersion = "upgrade_version" - AttributeKeyUpgradeConnectionHops = "upgrade_connection_hops" - AttributeKeyUpgradeOrdering = "upgrade_ordering" - AttributeKeyUpgradeErrorReceipt = "upgrade_error_receipt" - AttributeKeyUpgradeTimeoutHeight = "upgrade_timeout_height" - AttributeKeyUpgradeTimeoutTimestamp = "upgrade_timeout_timestamp" ) // IBC channel events vars diff --git a/modules/core/keeper/msg_server_test.go b/modules/core/keeper/msg_server_test.go index ccd846766dc..9a9dfc31c61 100644 --- a/modules/core/keeper/msg_server_test.go +++ b/modules/core/keeper/msg_server_test.go @@ -933,14 +933,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeInit() { expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeInit: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: upgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: upgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: upgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: upgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: upgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: upgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1042,14 +1042,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTry() { expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeTry: { - channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: upgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: upgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: upgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeKeyConnectionHops: upgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: upgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: upgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1100,7 +1100,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTry() { channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "counterparty upgrade sequence < current upgrade sequence (1 < 99): invalid upgrade sequence", + channeltypes.AttributeKeyErrorReceipt: "counterparty upgrade sequence < current upgrade sequence (1 < 99): invalid upgrade sequence", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1204,14 +1204,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeAck: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: upgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: upgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: upgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: upgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: upgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: upgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1241,14 +1241,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeAck: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: upgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: upgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: upgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: upgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: upgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: upgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1320,7 +1320,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "expected upgrade ordering (ORDER_NONE_UNSPECIFIED) to match counterparty upgrade ordering (ORDER_UNORDERED): incompatible counterparty upgrade", + channeltypes.AttributeKeyErrorReceipt: "expected upgrade ordering (ORDER_NONE_UNSPECIFIED) to match counterparty upgrade ordering (ORDER_UNORDERED): incompatible counterparty upgrade", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1365,7 +1365,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "mock app callback failed", + channeltypes.AttributeKeyErrorReceipt: "mock app callback failed", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1474,15 +1474,15 @@ func (suite *KeeperTestSuite) TestChannelUpgradeConfirm() { channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, channeltypes.EventTypeChannelUpgradeOpen: { - channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeKeyChannelState: channeltypes.OPEN.String(), - channeltypes.AttributeKeyUpgradeConnectionHops: channel.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: channel.Version, - channeltypes.AttributeKeyUpgradeOrdering: channel.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeKeyChannelState: channeltypes.OPEN.String(), + channeltypes.AttributeKeyConnectionHops: channel.ConnectionHops[0], + channeltypes.AttributeKeyVersion: channel.Version, + channeltypes.AttributeKeyOrdering: channel.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1665,7 +1665,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeConfirm() { channeltypes.AttributeCounterpartyChannelID: path.EndpointA.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "counterparty upgrade timeout elapsed: current timestamp: 1578269010000000000, timeout timestamp 1578268995000000000: timeout elapsed", + channeltypes.AttributeKeyErrorReceipt: "counterparty upgrade timeout elapsed: current timestamp: 1578269010000000000, timeout timestamp 1578268995000000000: timeout elapsed", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1770,15 +1770,15 @@ func (suite *KeeperTestSuite) TestChannelUpgradeOpen() { expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeOpen: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyChannelState: channeltypes.OPEN.String(), - channeltypes.AttributeKeyUpgradeConnectionHops: channel.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: channel.Version, - channeltypes.AttributeKeyUpgradeOrdering: channel.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyChannelState: channeltypes.OPEN.String(), + channeltypes.AttributeKeyConnectionHops: channel.ConnectionHops[0], + channeltypes.AttributeKeyVersion: channel.Version, + channeltypes.AttributeKeyOrdering: channel.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1916,14 +1916,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { proposedUpgrade := path.EndpointA.GetProposedUpgrade() expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeCancel: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: proposedUpgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: proposedUpgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: proposedUpgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: proposedUpgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, channeltypes.EventTypeChannelUpgradeError: { channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, @@ -1932,7 +1932,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "invalid upgrade", + channeltypes.AttributeKeyErrorReceipt: "invalid upgrade", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -1965,14 +1965,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { proposedUpgrade := path.EndpointA.GetProposedUpgrade() expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeCancel: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: proposedUpgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: proposedUpgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: proposedUpgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: proposedUpgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, channeltypes.EventTypeChannelUpgradeError: { channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, @@ -1981,7 +1981,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "invalid upgrade", + channeltypes.AttributeKeyErrorReceipt: "invalid upgrade", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -2015,14 +2015,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { proposedUpgrade := path.EndpointA.GetProposedUpgrade() expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeCancel: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: proposedUpgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: proposedUpgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: proposedUpgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: proposedUpgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, channeltypes.EventTypeChannelUpgradeError: { channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, @@ -2031,7 +2031,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "invalid upgrade", + channeltypes.AttributeKeyErrorReceipt: "invalid upgrade", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -2065,14 +2065,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { proposedUpgrade := path.EndpointA.GetProposedUpgrade() expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeCancel: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: proposedUpgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: proposedUpgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: proposedUpgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: proposedUpgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, channeltypes.EventTypeChannelUpgradeError: { channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, @@ -2081,7 +2081,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "invalid upgrade", + channeltypes.AttributeKeyErrorReceipt: "invalid upgrade", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -2114,14 +2114,14 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { proposedUpgrade := path.EndpointA.GetProposedUpgrade() expEvents := ibctesting.EventsMap{ channeltypes.EventTypeChannelUpgradeCancel: { - channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, - channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, - channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, - channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: proposedUpgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: proposedUpgrade.Fields.Ordering.String(), - channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), + channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, + channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, + channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, + channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, + channeltypes.AttributeKeyConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: proposedUpgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: proposedUpgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), }, channeltypes.EventTypeChannelUpgradeError: { channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID, @@ -2130,7 +2130,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "invalid upgrade", + channeltypes.AttributeKeyErrorReceipt: "invalid upgrade", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory, @@ -2313,9 +2313,9 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTimeout() { channeltypes.AttributeKeyChannelID: path.EndpointA.ChannelID, channeltypes.AttributeCounterpartyPortID: path.EndpointB.ChannelConfig.PortID, channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, - channeltypes.AttributeKeyUpgradeConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], - channeltypes.AttributeKeyUpgradeVersion: proposedUpgrade.Fields.Version, - channeltypes.AttributeKeyUpgradeOrdering: proposedUpgrade.Fields.Ordering.String(), + channeltypes.AttributeKeyConnectionHops: proposedUpgrade.Fields.ConnectionHops[0], + channeltypes.AttributeKeyVersion: proposedUpgrade.Fields.Version, + channeltypes.AttributeKeyOrdering: proposedUpgrade.Fields.Ordering.String(), channeltypes.AttributeKeyUpgradeTimeoutHeight: timeout.Height.String(), channeltypes.AttributeKeyUpgradeTimeoutTimestamp: fmt.Sprintf("%d", timeout.Timestamp), channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), @@ -2327,7 +2327,7 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTimeout() { channeltypes.AttributeCounterpartyChannelID: path.EndpointB.ChannelID, channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), // need to manually insert this because the errorReceipt is a string constant as it is written into state - channeltypes.AttributeKeyUpgradeErrorReceipt: "upgrade timed-out", + channeltypes.AttributeKeyErrorReceipt: "upgrade timed-out", }, sdk.EventTypeMessage: { sdk.AttributeKeyModule: channeltypes.AttributeValueCategory,