Skip to content

Commit

Permalink
set timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 23, 2024
1 parent da01fad commit 0bcb77a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ import (
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
ibcchanneltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcerrors "github.com/cosmos/ibc-go/v8/modules/core/errors"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
Expand Down Expand Up @@ -301,8 +302,7 @@ func (im CustomIBCFeeMiddleware) OnAcknowledgementPacket(
) error {
if im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) {
var ack ibcfeetypes.IncentivizedAcknowledgement
err := ibcfeetypes.ModuleCdc.UnmarshalJSON(acknowledgement, &ack)
if err != nil {
if err := ibcfeetypes.ModuleCdc.UnmarshalJSON(acknowledgement, &ack); err != nil {
return errors.Wrapf(err, "cannot unmarshal ICS-29 incentivized packet acknowledgement: %v", ack)
}
im.keeper.SetPayeeAddress(ctx, relayer.String(), ack.ForwardRelayerAddress, packet.SourceChannel)
Expand All @@ -315,6 +315,11 @@ func (im CustomIBCFeeMiddleware) OnTimeoutPacket(
packet ibcchanneltypes.Packet,
relayer sdk.AccAddress,
) error {
var data ibctransfertypes.FungibleTokenPacketData
if err := ibctransfertypes.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil {
return errors.Wrapf(ibcerrors.ErrUnknownRequest, "cannot unmarshal ICS-20 transfer packet data: %s", err.Error())
}
im.keeper.SetPayeeAddress(ctx, relayer.String(), data.Sender, packet.SourceChannel)
return im.IBCMiddleware.OnTimeoutPacket(ctx, packet, relayer)
}

Expand Down

0 comments on commit 0bcb77a

Please sign in to comment.