Skip to content

Commit

Permalink
fix: broken integration test consumer registration
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Nov 15, 2023
1 parent c74d907 commit 1a2b003
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions tests/integration/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
})
Expand Down Expand Up @@ -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),
}
}
Expand All @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions testutil/ibc_testing/generic_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1a2b003

Please sign in to comment.