Skip to content

Commit

Permalink
Merge pull request #511 from ComposableFi/timeout/account
Browse files Browse the repository at this point in the history
convert string to cosmos address. use AccAddressFromBech32 func
  • Loading branch information
RustNinja authored Apr 30, 2024
2 parents 48749f6 + b1e839f commit b30e5ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion x/transfermiddleware/ibc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Pac
return nil
}

refund_err := im.keeper.RefundChannelCosmosFee(ctx, fee_address, sdk.AccAddress(data.Sender), []sdk.Coin{fee})
sender_address, err := sdk.AccAddressFromBech32(data.Sender)
if err != nil {
return nil
}

refund_err := im.keeper.RefundChannelCosmosFee(ctx, fee_address, sender_address, []sdk.Coin{fee})
if refund_err == nil {
im.keeper.IbcTransfermiddleware.DeleteSequenceFee(ctx, packet.Sequence)
}
Expand Down

0 comments on commit b30e5ef

Please sign in to comment.