Skip to content

Commit

Permalink
Revert "chore: Add OnAcknowledgmentPacket to IBCModule V2 Interface (#…
Browse files Browse the repository at this point in the history
…7438)"

This reverts commit 4ed7543.
  • Loading branch information
bznein authored Oct 14, 2024
1 parent a539936 commit b82e3ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
12 changes: 2 additions & 10 deletions modules/core/api/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type IBCModule interface {
relayer sdk.AccAddress,
) channeltypesv2.RecvPacketResult

// OnAcknowledgementPacket

// OnTimeoutPacket is executed when a packet has timed out on the receiving chain.
OnTimeoutPacket(
ctx context.Context,
Expand All @@ -39,14 +41,4 @@ type IBCModule interface {
data channeltypesv2.PacketData,
relayer sdk.AccAddress,
) error

// OnAcknowledgementPacket is executed when a packet gets acknowledged
OnAcknowledgementPacket(
ctx context.Context,
sourceID string,
destinationID string,
data channeltypesv2.PacketData,
acknowledgement []byte,
relayer sdk.AccAddress,
) error
}
7 changes: 3 additions & 4 deletions testing/mock/v2/ibc_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
)

type IBCApp struct {
OnSendPacket func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error
OnRecvPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult
OnTimeoutPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error
OnAcknowledgementPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error
OnSendPacket func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error
OnRecvPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult
OnTimeoutPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error
}
14 changes: 8 additions & 6 deletions testing/mock/v2/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ func (im IBCModule) OnRecvPacket(ctx context.Context, sourceID string, destinati
}
}

func (im IBCModule) OnAcknowledgementPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error {
if im.IBCApp.OnAcknowledgementPacket != nil {
return im.IBCApp.OnAcknowledgementPacket(ctx, sourceID, destinationID, data, acknowledgement, relayer)
}
return nil
}
//
// func (im IBCModule) OnAcknowledgementPacket() error {
// if im.IBCApp.OnAcknowledgementPacket != nil {
// return im.IBCApp.OnAcknowledgementPacket(...)
// }
// return nil
// }
//

func (im IBCModule) OnTimeoutPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error {
if im.IBCApp.OnTimeoutPacket != nil {
Expand Down

0 comments on commit b82e3ee

Please sign in to comment.