From 46cb3528cd8cd1394af2335a6907d7ab8647717a Mon Sep 17 00:00:00 2001
From: ron <yrong1997@gmail.com>
Date: Tue, 3 Sep 2024 10:20:23 +0800
Subject: [PATCH] SetAppendix with fee not trapped

---
 .../snowbridge/primitives/router/src/inbound/mod.rs   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bridges/snowbridge/primitives/router/src/inbound/mod.rs b/bridges/snowbridge/primitives/router/src/inbound/mod.rs
index fd3f71390bb..d8292488f14 100644
--- a/bridges/snowbridge/primitives/router/src/inbound/mod.rs
+++ b/bridges/snowbridge/primitives/router/src/inbound/mod.rs
@@ -433,15 +433,16 @@ impl<
 				let dest_para_fee_asset: Asset = (Location::parent(), dest_para_fee).into();
 
 				instructions.extend(vec![
+					// `SetAppendix` ensures that `fees` are not trapped in any case
+					SetAppendix(Xcm(vec![DepositAsset {
+						assets: AllCounted(1).into(),
+						beneficiary: Location::new(1, [Parachain(dest_para_id)]),
+					}])),
 					// Perform a reserve withdraw to send to destination chain. Leave half of the
 					// asset_hub_fee for the delivery cost
 					InitiateReserveWithdraw {
 						assets: Definite(
-							vec![
-								asset.clone(),
-								(Location::parent(), dest_para_fee + asset_hub_fee / 2).into(),
-							]
-							.into(),
+							vec![asset.clone(), (Location::parent(), dest_para_fee).into()].into(),
 						),
 						reserve: Location::new(1, [Parachain(dest_para_id)]),
 						xcm: vec![
-- 
GitLab