From 1a2b003c16594b964b86b9a80bdd4bf99ca40725 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Wed, 15 Nov 2023 13:58:49 +0100 Subject: [PATCH] fix: broken integration test consumer registration --- tests/integration/setup.go | 11 +++++++---- testutil/ibc_testing/generic_setup.go | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/integration/setup.go b/tests/integration/setup.go index 91a6e9a500..d73154ee5b 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -165,7 +165,8 @@ func (s *CCVTestSuite) registerPacketSniffer(chain *ibctesting.TestChain) { if s.packetSniffers == nil { s.packetSniffers = make(map[*ibctesting.TestChain]*packetSniffer) } - p := newPacketSniffer() + + p := newPacketSniffer(chain.ChainID) chain.App.GetBaseApp().SetStreamingManager(store.StreamingManager{ ABCIListeners: []store.ABCIListener{p}, }) @@ -376,15 +377,17 @@ func preProposalKeyAssignment(s *CCVTestSuite, chainID string) { } // packetSniffer implements the StreamingService interface. -// Implements ListenEndBlock to record packets from events. +// Implements ListenFinalizeBlock to record packets from events. type packetSniffer struct { + chainID string packets map[string]channeltypes.Packet } var _ store.ABCIListener = &packetSniffer{} -func newPacketSniffer() *packetSniffer { +func newPacketSniffer(chainID string) *packetSniffer { return &packetSniffer{ + chainID: chainID, packets: make(map[string]channeltypes.Packet), } } @@ -403,7 +406,7 @@ func getSentPacketKey(sequence uint64, channelID string) string { return fmt.Sprintf("%s-%d", channelID, sequence) } -func (*packetSniffer) ListenCommit(ctx context.Context, res abci.ResponseCommit, cs []*store.StoreKVPair) error { +func (ps *packetSniffer) ListenCommit(ctx context.Context, res abci.ResponseCommit, cs []*store.StoreKVPair) error { return nil } diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index e0a63bb2af..d808336eb8 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -134,8 +134,8 @@ func AddConsumer[Tp testutil.ProviderApp, Tc testutil.ConsumerApp]( // using time.Now() could set the spawn time to be too far in the past or too far in the future SpawnTime: coordinator.CurrentTime, UnbondingPeriod: ccvtypes.DefaultConsumerUnbondingPeriod, - CcvTimeoutPeriod: ccvtypes.DefaultBlocksPerDistributionTransmission, - TransferTimeoutPeriod: ccvtypes.DefaultCCVTimeoutPeriod, + CcvTimeoutPeriod: ccvtypes.DefaultCCVTimeoutPeriod, + TransferTimeoutPeriod: ccvtypes.DefaultTransferTimeoutPeriod, ConsumerRedistributionFraction: ccvtypes.DefaultConsumerRedistributeFrac, BlocksPerDistributionTransmission: ccvtypes.DefaultBlocksPerDistributionTransmission, HistoricalEntries: ccvtypes.DefaultHistoricalEntries,