Skip to content

Commit

Permalink
convert string to cosmos address. use AccAddressFromBech32 func
Browse files Browse the repository at this point in the history
  • Loading branch information
RustNinja committed Apr 30, 2024
1 parent 4fb97f0 commit d0f797c
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 d0f797c

Please sign in to comment.