diff --git a/tests/integration/common.go b/tests/integration/common.go index 13488bd7e6..66fd79c6eb 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -373,7 +373,7 @@ func checkRedelegationEntryCompletionTime( func getStakingUnbondingDelegationEntry(ctx sdk.Context, k testutil.TestStakingKeeper, id uint64) (stakingUnbondingOp stakingtypes.UnbondingDelegationEntry, found bool) { stakingUbd, err := k.GetUnbondingDelegationByUnbondingID(ctx, id) if err != nil { - panic(fmt.Sprintf("could not get unbonding delegation", err)) + panic(fmt.Sprintf("could not get unbonding delegation: %v", err)) } found = false diff --git a/tests/integration/setup.go b/tests/integration/setup.go index f3cc6ae7f7..91a6e9a500 100644 --- a/tests/integration/setup.go +++ b/tests/integration/setup.go @@ -3,7 +3,6 @@ package integration import ( "context" "fmt" - "sync" "testing" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" @@ -167,7 +166,9 @@ func (s *CCVTestSuite) registerPacketSniffer(chain *ibctesting.TestChain) { s.packetSniffers = make(map[*ibctesting.TestChain]*packetSniffer) } p := newPacketSniffer() - chain.App.GetBaseApp().SetStreamingManager(p) + chain.App.GetBaseApp().SetStreamingManager(store.StreamingManager{ + ABCIListeners: []store.ABCIListener{p}, + }) s.packetSniffers[chain] = p } @@ -380,8 +381,7 @@ type packetSniffer struct { packets map[string]channeltypes.Packet } -// TODO: @MSalopek this was deprecated, figure out how to use it or ask @tbruyelle -// var _ baseapp.StreamingService = &packetSniffer{} +var _ store.ABCIListener = &packetSniffer{} func newPacketSniffer() *packetSniffer { return &packetSniffer{ @@ -390,7 +390,6 @@ func newPacketSniffer() *packetSniffer { } func (ps *packetSniffer) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error { - // TODO: @MSalopek this was deprecated, figure out how to use it packets := ParsePacketsFromEvents(res.GetEvents()) for _, packet := range packets { ps.packets[getSentPacketKey(packet.Sequence, packet.SourceChannel)] = packet @@ -408,29 +407,7 @@ func (*packetSniffer) ListenCommit(ctx context.Context, res abci.ResponseCommit, return nil } -func (*packetSniffer) Close() error { return nil } -func (*packetSniffer) Listeners() map[store.StoreKey][]store.ABCIListener { return nil } -func (*packetSniffer) Stream(wg *sync.WaitGroup) error { return nil } - -// [legacy simibc method] -// ABCIToSDKEvents converts a list of ABCI events to Cosmos SDK events. -func ABCIToSDKEvents(abciEvents []abci.Event) sdk.Events { - var events sdk.Events - for _, evt := range abciEvents { - var attributes []sdk.Attribute - for _, attr := range evt.GetAttributes() { - attributes = append(attributes, sdk.NewAttribute(attr.Key, attr.Value)) - } - - events = events.AppendEvent(sdk.NewEvent(evt.GetType(), attributes...)) - } - - return events -} - -// [legacy simibc method] // ParsePacketsFromEvents returns all packets found in events. -// func ParsePacketsFromEvents(events []sdk.Event) (packets []channeltypes.Packet) { func ParsePacketsFromEvents(events []abci.Event) (packets []channeltypes.Packet) { for i, ev := range events { if ev.Type == channeltypes.EventTypeSendPacket {