-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
In ibc-rs, this is the logic that handles refunds:
pub fn refund_packet_token_execute(
ctx_a: &mut impl TokenTransferExecutionContext,
packet: &Packet,
data: &PacketData,
) -> Result<(), TokenTransferError> {
let sender = ctx_a.sender_account(&data.sender)?;
if is_sender_chain_source(
packet.port_id_on_a.clone(),
packet.chan_id_on_a.clone(),
&data.token.denom,
) {
ctx_a.unescrow_coins_execute(
&sender,
&packet.port_id_on_a,
&packet.chan_id_on_a,
&data.token,
)?;
}
// mint vouchers back to sender
else {
ctx_a.mint_coins_execute(&sender, &data.token)?;
}
Ok(())
}
Our unescrow_coins_execute and mint_coins_execute handlers invoke TokenTransferContext::add_deposit, which increments the per-epoch deposit limit. This means that refunds may fail.
We should distinguish between refunds and actual deposits, when updating the per-epoch deposit limits.
Reactions are currently unavailable