Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Use ibc denom for refund bank sends
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Nov 7, 2022
1 parent 255323d commit 84141e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion router/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,20 @@ func (k Keeper) WriteAcknowledgementForForwardedPacket(
}
}

denomTrace := transfertypes.ParseDenomTrace(fullDenomPath)
var denom string
if denomTrace.Path == "" {
denom = data.Denom
} else {
denom = denomTrace.IBCDenom()
}

amount, ok := sdk.NewIntFromString(data.Amount)
if !ok {
return fmt.Errorf("failed to parse amount for burn: %s", data.Amount)
}

token := sdk.NewCoin(data.Denom, amount)
token := sdk.NewCoin(denom, amount)

if transfertypes.SenderChainIsSource(inFlightPacket.RefundPortId, inFlightPacket.RefundChannelId, fullDenomPath) {
// create the escrow address for the tokens
Expand Down

0 comments on commit 84141e8

Please sign in to comment.