From bc853b3d477ae3eda7b41e2c0fcebd1a4bb08f67 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri, 14 Jul 2023 11:30:23 -0700 Subject: [PATCH] small updates --- tests/integration/throttle_retry.go | 9 ++++++--- x/ccv/consumer/keeper/throttle_retry.go | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/integration/throttle_retry.go b/tests/integration/throttle_retry.go index c8f4821f94..ae15aac977 100644 --- a/tests/integration/throttle_retry.go +++ b/tests/integration/throttle_retry.go @@ -61,6 +61,9 @@ func (s *CCVTestSuite) TestSlashRetries() { }, ) consumerKeeper.UpdateSlashRecordOnSend(s.consumerCtx()) + slashRecord, found := consumerKeeper.GetSlashRecord(s.consumerCtx()) + s.Require().True(found) + s.Require().True(slashRecord.WaitingOnReply) s.Require().Len(consumerKeeper.GetPendingPackets(s.consumerCtx()), 1) // Recv packet on provider and assert ack. Provider should return v1 result. @@ -68,7 +71,7 @@ func (s *CCVTestSuite) TestSlashRetries() { expectedv1Ack := channeltypes.NewResultAcknowledgement([]byte(ccvtypes.V1Result)) s.Require().Equal(expectedv1Ack.Acknowledgement(), ack.Acknowledgement()) - // Couple blocks pass on provider for staking keeper to process jailing + // Couple blocks pass on provider for provider staking keeper to process jailing s.providerChain.NextBlock() s.providerChain.NextBlock() @@ -110,7 +113,7 @@ func (s *CCVTestSuite) TestSlashRetries() { }, ) consumerKeeper.UpdateSlashRecordOnSend(s.consumerCtx()) - slashRecord, found := consumerKeeper.GetSlashRecord(s.consumerCtx()) + slashRecord, found = consumerKeeper.GetSlashRecord(s.consumerCtx()) s.Require().True(found) s.Require().True(slashRecord.WaitingOnReply) s.Require().Len(consumerKeeper.GetPendingPackets(s.consumerCtx()), 1) @@ -137,7 +140,7 @@ func (s *CCVTestSuite) TestSlashRetries() { err = consumerKeeper.OnAcknowledgementPacket(s.consumerCtx(), packet2, ackForConsumer) s.Require().NoError(err) - // TODO: when provider changes are made, slashRecord.WaitingOnReply should have been updated to false. Packet still in queue + // TODO: when provider changes are made, slashRecord.WaitingOnReply should have been updated to false on consumer. Slash Packet will still be in consumer's pending packets queue. // Slash record should have been deleted, head of pending packets should have been popped // Since provider has handled the packet diff --git a/x/ccv/consumer/keeper/throttle_retry.go b/x/ccv/consumer/keeper/throttle_retry.go index 128bc53bad..9652913c72 100644 --- a/x/ccv/consumer/keeper/throttle_retry.go +++ b/x/ccv/consumer/keeper/throttle_retry.go @@ -9,7 +9,7 @@ import ( consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" ) -// TODO: will need good integration tests making sure this state is properly init, cleared, etc. +// TODO: e2e tests // // Throttling with retries follows a FSM design: