From 68d3c1018a37a716b3ab60cb637b8944e060e51d Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Thu, 27 Jan 2022 20:40:43 +0100 Subject: [PATCH] reply_on_error not always --- contracts/cw20-ics20/src/ibc.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/cw20-ics20/src/ibc.rs b/contracts/cw20-ics20/src/ibc.rs index a05fc0023..fec3db9da 100644 --- a/contracts/cw20-ics20/src/ibc.rs +++ b/contracts/cw20-ics20/src/ibc.rs @@ -238,7 +238,7 @@ fn do_ibc_packet_receive( // If it originated on our chain, it looks like "port/channel/ucosm". let denom = parse_voucher_denom(&msg.denom, &packet.src)?; - // make sure we have enough balance for this (that is, the later reduction in the reply handler should succeed) + // make sure we have enough balance for this reduce_channel_balance(deps.storage, &channel, denom, msg.amount)?; // we need to save the data to update the balances in reply @@ -252,7 +252,7 @@ fn do_ibc_packet_receive( let to_send = Amount::from_parts(denom.to_string(), msg.amount); let gas_limit = check_gas_limit(deps.as_ref(), &to_send)?; let send = send_amount(to_send, msg.receiver.clone()); - let mut submsg = SubMsg::reply_always(send, RECEIVE_ID); + let mut submsg = SubMsg::reply_on_error(send, RECEIVE_ID); submsg.gas_limit = gas_limit; let res = IbcReceiveResponse::new()