-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imp: remove LatestSequenceSend
#5108
Changes from 5 commits
ea49842
ef965f1
3c58665
c16932e
c23e09a
386e07f
452c4fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -335,82 +335,6 @@ func (suite *KeeperTestSuite) TestRecvPacket() { | |
}, | ||
nil, | ||
}, | ||
{ | ||
"success with channel in flushing state", | ||
func() { | ||
suite.coordinator.Setup(path) | ||
sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) | ||
suite.Require().NoError(err) | ||
packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) | ||
channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) | ||
|
||
channel := path.EndpointB.GetChannel() | ||
channel.State = types.FLUSHING | ||
path.EndpointB.SetChannel(channel) | ||
|
||
// set last packet sent sequence to sequence + 1 | ||
counterpartyUpgrade := types.Upgrade{LatestSequenceSend: sequence + 1} | ||
path.EndpointB.SetChannelCounterpartyUpgrade(counterpartyUpgrade) | ||
Comment on lines
-351
to
-353
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can keep this tests case, but just remove this part. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-added the test removing the highlighted lines! |
||
}, | ||
nil, | ||
}, | ||
{ | ||
"success with an counterparty latest sequence send set to 0", | ||
func() { | ||
suite.coordinator.Setup(path) | ||
sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) | ||
suite.Require().NoError(err) | ||
|
||
packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) | ||
channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) | ||
|
||
channel := path.EndpointB.GetChannel() | ||
channel.State = types.FLUSHING | ||
path.EndpointB.SetChannel(channel) | ||
|
||
// set last packet sent sequence to zero. | ||
counterpartyUpgrade := types.Upgrade{LatestSequenceSend: 0} | ||
path.EndpointB.SetChannelCounterpartyUpgrade(counterpartyUpgrade) | ||
}, | ||
nil, | ||
}, | ||
{ | ||
"failure while upgrading channel, counterparty upgrade not found", | ||
func() { | ||
suite.coordinator.Setup(path) | ||
sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) | ||
suite.Require().NoError(err) | ||
packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) | ||
channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) | ||
|
||
channel := path.EndpointB.GetChannel() | ||
channel.State = types.FLUSHING | ||
path.EndpointB.SetChannel(channel) | ||
}, | ||
types.ErrUpgradeNotFound, | ||
}, | ||
{ | ||
"failure while upgrading channel, packet sequence > counterparty last send sequence", | ||
func() { | ||
suite.coordinator.Setup(path) | ||
// send 2 packets so that when LatestSequenceSend is set to sequence - 1, it is not 0. | ||
_, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) | ||
suite.Require().NoError(err) | ||
sequence, err := path.EndpointA.SendPacket(defaultTimeoutHeight, disabledTimeoutTimestamp, ibctesting.MockPacketData) | ||
suite.Require().NoError(err) | ||
packet = types.NewPacket(ibctesting.MockPacketData, sequence, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, defaultTimeoutHeight, disabledTimeoutTimestamp) | ||
channelCap = suite.chainB.GetChannelCapability(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) | ||
|
||
channel := path.EndpointB.GetChannel() | ||
channel.State = types.FLUSHING | ||
path.EndpointB.SetChannel(channel) | ||
|
||
// set last packet sent sequence to sequence - 1 | ||
counterpartyUpgrade := types.Upgrade{LatestSequenceSend: sequence - 1} | ||
path.EndpointB.SetChannelCounterpartyUpgrade(counterpartyUpgrade) | ||
}, | ||
types.ErrInvalidPacket, | ||
}, | ||
{ | ||
"failure while upgrading channel, channel in flush complete state", | ||
func() { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like something weird is going on with linting 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed this change after I run gofumpt in the branch.