From cf3e324b24fc07cef3a1fcc6792829c912c3a07d Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:57:50 -0700 Subject: [PATCH] adjust TestSendPacketsDeletion --- x/ccv/consumer/keeper/relay_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/x/ccv/consumer/keeper/relay_test.go b/x/ccv/consumer/keeper/relay_test.go index 7d3decd3a2..e1986cd0d4 100644 --- a/x/ccv/consumer/keeper/relay_test.go +++ b/x/ccv/consumer/keeper/relay_test.go @@ -465,7 +465,12 @@ func TestSendPacketsDeletion(t *testing.T) { consumerKeeper.SetProviderChannel(ctx, "consumerCCVChannelID") consumerKeeper.SetParams(ctx, consumertypes.DefaultParams()) - // Queue two pending packets + // Queue two pending packets. Note VSC matured enqueued first since slash packets block further sending + consumerKeeper.AppendPendingPacket(ctx, types.VscMaturedPacket, &types.ConsumerPacketData_VscMaturedPacketData{ + VscMaturedPacketData: &types.VSCMaturedPacketData{ + ValsetUpdateId: 90, + }, + }) consumerKeeper.AppendPendingPacket(ctx, types.SlashPacket, &types.ConsumerPacketData_SlashPacketData{ // Slash appears first SlashPacketData: &types.SlashPacketData{ Validator: abci.Validator{}, @@ -473,11 +478,6 @@ func TestSendPacketsDeletion(t *testing.T) { Infraction: stakingtypes.Infraction_INFRACTION_DOWNTIME, }, }) - consumerKeeper.AppendPendingPacket(ctx, types.VscMaturedPacket, &types.ConsumerPacketData_VscMaturedPacketData{ - VscMaturedPacketData: &types.VSCMaturedPacketData{ - ValsetUpdateId: 90, - }, - }) // Get mocks for a successful SendPacket call that does NOT return an error expectations := testkeeper.GetMocksForSendIBCPacket(ctx, mocks, "consumerCCVChannelID", 1) @@ -489,6 +489,6 @@ func TestSendPacketsDeletion(t *testing.T) { consumerKeeper.SendPackets(ctx) // Expect the first successfully sent packet to be popped from queue - require.Equal(t, 1, len(consumerKeeper.GetPendingPackets(ctx))) - require.Equal(t, types.VscMaturedPacket, consumerKeeper.GetPendingPackets(ctx)[0].Type) + require.Len(t, consumerKeeper.GetPendingPackets(ctx), 1) + require.Equal(t, types.SlashPacket, consumerKeeper.GetPendingPackets(ctx)[0].Type) }