Skip to content

Commit

Permalink
adjust TestSendPacketsDeletion
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Jul 14, 2023
1 parent 46d49e1 commit cf3e324
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions x/ccv/consumer/keeper/relay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,19 +465,19 @@ 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{},
ValsetUpdateId: 88,
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)
Expand All @@ -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)
}

0 comments on commit cf3e324

Please sign in to comment.