From 26fc76408f1397b40611ddd18fc839e2397825a8 Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Wed, 27 Mar 2024 14:49:42 +0700 Subject: [PATCH 1/4] remove event emission --- modules/core/04-channel/keeper/events.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/modules/core/04-channel/keeper/events.go b/modules/core/04-channel/keeper/events.go index 3a9bd673f43..c0a9a7425ca 100644 --- a/modules/core/04-channel/keeper/events.go +++ b/modules/core/04-channel/keeper/events.go @@ -280,9 +280,6 @@ 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.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 +298,6 @@ 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.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 +316,6 @@ 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.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 +354,6 @@ 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.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 +372,6 @@ 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.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)), @@ -426,9 +411,6 @@ 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.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( From b5840a0095bc8d313d20bdfe73597d7b4a785797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20Vi=E1=BB=87t=20Ho=C3=A0ng?= Date: Wed, 27 Mar 2024 14:55:51 +0700 Subject: [PATCH 2/4] Update events.go --- modules/core/04-channel/keeper/events.go | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/core/04-channel/keeper/events.go b/modules/core/04-channel/keeper/events.go index 38cf8ccc4db..7d2e9fe4a6a 100644 --- a/modules/core/04-channel/keeper/events.go +++ b/modules/core/04-channel/keeper/events.go @@ -278,9 +278,9 @@ func EmitChannelUpgradeInitEvent(ctx sdk.Context, portID string, channelID strin types.EventTypeChannelUpgradeInit, sdk.NewAttribute(types.AttributeKeyPortID, portID), sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - 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.AttributeCounterpartyPortID, channel.Counterparty.PortId), + sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), + sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", channel.UpgradeSequence)), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -296,9 +296,9 @@ func EmitChannelUpgradeTryEvent(ctx sdk.Context, portID string, channelID string types.EventTypeChannelUpgradeTry, sdk.NewAttribute(types.AttributeKeyPortID, portID), sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - 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.AttributeCounterpartyPortID, channel.Counterparty.PortId), + sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), + sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", channel.UpgradeSequence)), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -314,9 +314,9 @@ func EmitChannelUpgradeAckEvent(ctx sdk.Context, portID string, channelID string types.EventTypeChannelUpgradeAck, sdk.NewAttribute(types.AttributeKeyPortID, portID), sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - 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.AttributeCounterpartyPortID, channel.Counterparty.PortId), + sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), + sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", channel.UpgradeSequence)), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -351,10 +351,10 @@ func EmitChannelUpgradeOpenEvent(ctx sdk.Context, portID string, channelID strin types.EventTypeChannelUpgradeOpen, sdk.NewAttribute(types.AttributeKeyPortID, portID), sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - sdk.NewAttribute(types.AttributeKeyChannelState, currentChannel.State.String()), - 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.AttributeKeyChannelState, channel.State.String()), + sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), + sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), + sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", channel.UpgradeSequence)), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -370,11 +370,11 @@ func EmitChannelUpgradeTimeoutEvent(ctx sdk.Context, portID string, channelID st types.EventTypeChannelUpgradeTimeout, sdk.NewAttribute(types.AttributeKeyPortID, portID), sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - sdk.NewAttribute(types.AttributeCounterpartyPortID, currentChannel.Counterparty.PortId), - sdk.NewAttribute(types.AttributeCounterpartyChannelID, currentChannel.Counterparty.ChannelId), + sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), + sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), 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)), + sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", channel.UpgradeSequence)), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -403,15 +403,15 @@ func EmitErrorReceiptEvent(ctx sdk.Context, portID string, channelID string, cha } // EmitChannelUpgradeCancelEvent emits an upgraded cancelled event. -func EmitChannelUpgradeCancelEvent(ctx sdk.Context, portID string, channelID string, currentChannel types.Channel, upgrade types.Upgrade) { +func EmitChannelUpgradeCancelEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel, upgrade types.Upgrade) { ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeChannelUpgradeCancel, sdk.NewAttribute(types.AttributeKeyPortID, portID), sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - 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.AttributeCounterpartyPortID, channel.Counterparty.PortId), + sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), + sdk.NewAttribute(types.AttributeKeyUpgradeSequence, fmt.Sprintf("%d", channel.UpgradeSequence)), ), sdk.NewEvent( sdk.EventTypeMessage, From ced7b32d82a3c70299f09cbba97507204c071ec9 Mon Sep 17 00:00:00 2001 From: hoangdv2429 Date: Wed, 27 Mar 2024 15:26:37 +0700 Subject: [PATCH 3/4] update test acrroding --- modules/core/keeper/msg_server_test.go | 59 -------------------------- 1 file changed, 59 deletions(-) diff --git a/modules/core/keeper/msg_server_test.go b/modules/core/keeper/msg_server_test.go index 1f7de0c2fe1..512b307809c 100644 --- a/modules/core/keeper/msg_server_test.go +++ b/modules/core/keeper/msg_server_test.go @@ -932,8 +932,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeInit() { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(uint64(1), res.UpgradeSequence) - - upgrade := path.EndpointA.GetChannelUpgrade() channel := path.EndpointA.GetChannel() expEvents := ibctesting.EventsMap{ @@ -942,9 +940,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeInit() { 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: { @@ -1078,17 +1073,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTry() { suite.Require().Equal(channeltypes.FLUSHING, channel.State) suite.Require().Equal(uint64(1), channel.UpgradeSequence) - upgrade := path.EndpointB.GetChannelUpgrade() - 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.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: { @@ -1265,17 +1255,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { suite.Require().Equal(channeltypes.FLUSHCOMPLETE, channel.State) suite.Require().Equal(uint64(1), channel.UpgradeSequence) - upgrade := path.EndpointA.GetChannelUpgrade() - 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.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: { @@ -1302,17 +1287,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { suite.Require().Equal(channeltypes.FLUSHING, channel.State) suite.Require().Equal(uint64(1), channel.UpgradeSequence) - upgrade := path.EndpointA.GetChannelUpgrade() - 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.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: { @@ -1580,9 +1560,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeConfirm() { 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: { @@ -1873,9 +1850,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeOpen() { 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: { @@ -1919,9 +1893,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeOpen() { 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: { @@ -2055,17 +2026,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { // Upgrade sequence should be changed to match sequence on error receipt. suite.Require().Equal(uint64(2), channel.UpgradeSequence) - // we need to find the event values from the proposed upgrade as the actual upgrade has been deleted. - 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.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: { @@ -2104,17 +2070,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { // Upgrade sequence should be changed to match initial upgrade sequence. suite.Require().Equal(uint64(3), channel.UpgradeSequence) - // we need to find the event values from the proposed upgrade as the actual upgrade has been deleted. - 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.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: { @@ -2154,17 +2115,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { // Upgrade sequence should be changed to match initial upgrade sequence. suite.Require().Equal(uint64(1), channel.UpgradeSequence) - // we need to find the event values from the proposed upgrade as the actual upgrade has been deleted. - 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.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: { @@ -2204,17 +2160,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { // Upgrade sequence should be changed to match initial upgrade sequence. suite.Require().Equal(uint64(1), channel.UpgradeSequence) - // we need to find the event values from the proposed upgrade as the actual upgrade has been deleted. - 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.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: { @@ -2253,17 +2204,12 @@ func (suite *KeeperTestSuite) TestChannelUpgradeCancel() { // Upgrade sequence should not be changed. suite.Require().Equal(uint64(2), channel.UpgradeSequence) - // we need to find the event values from the proposed upgrade as the actual upgrade has been deleted. - 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.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: { @@ -2428,8 +2374,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTimeout() { suite.Require().True(found) suite.Require().Equal(uint64(1), errorReceipt.Sequence) - // we need to find the event values from the proposed upgrade as the actual upgrade has been deleted. - proposedUpgrade := path.EndpointA.GetProposedUpgrade() // use the timeout we set in the malleate function timeout := channeltypes.NewTimeout(clienttypes.ZeroHeight(), 1) expEvents := ibctesting.EventsMap{ @@ -2438,9 +2382,6 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTimeout() { 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.AttributeKeyUpgradeTimeoutHeight: timeout.Height.String(), channeltypes.AttributeKeyUpgradeTimeoutTimestamp: fmt.Sprintf("%d", timeout.Timestamp), channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence), From 2dbfd46a0caef5885f55e05835caa8490030742c Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Wed, 3 Apr 2024 21:34:28 +0200 Subject: [PATCH 4/4] update hermes tag --- e2e/testsuite/testconfig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index 3da52060b06..a8326390750 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -62,7 +62,7 @@ const ( // TODO: https://github.com/cosmos/ibc-go/issues/4965 defaultHyperspaceTag = "20231122v39" // defaultHermesTag is the tag that will be used if no relayer tag is specified for hermes. - defaultHermesTag = "luca_joss-channel-upgrade-authority" + defaultHermesTag = "sean-channel-upgradability" // defaultChainTag is the tag that will be used for the chains if none is specified. defaultChainTag = "main" // defaultConfigFileName is the default filename for the config file that can be used to configure