From b8370003a9d9de680d636f8857e1f747695d4ab4 Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Mon, 30 Sep 2024 19:06:45 +0300 Subject: [PATCH] fix bridge test --- .../src/tests/asset_transfers.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs index 0a8033c9a4e0f..62e9b26d57d09 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend/src/tests/asset_transfers.rs @@ -570,6 +570,9 @@ fn do_send_pens_and_wnds_from_penpal_westend_via_ahw_to_asset_hub_rococo( AssetHubWestend::force_xcm_version(destination.clone(), XCM_VERSION); BridgeHubWestend::force_xcm_version(bridge_hub_rococo_location(), XCM_VERSION); + // open bridge + open_bridge_between_asset_hub_rococo_and_asset_hub_westend(); + // send message over bridge assert_ok!(PenpalB::execute_with(|| { let signed_origin = ::RuntimeOrigin::signed(PenpalBSender::get()); @@ -586,17 +589,18 @@ fn do_send_pens_and_wnds_from_penpal_westend_via_ahw_to_asset_hub_rococo( // XCM to be executed at (intermediary) Westend Asset Hub let context = PenpalUniversalLocation::get(); let reanchored_dest = destination.clone().reanchored(&local_asset_hub, &context).unwrap(); - // Pay up to half the WNDs in fees on AHW - let mut reanchored_wnds = wnds.clone().reanchored(&local_asset_hub, &context).unwrap(); - reanchored_wnds.fun = Fungible(wnds_amount / 2); + let reanchored_pens = pens.clone().reanchored(&local_asset_hub, &context).unwrap(); + let mut onward_wnds = wnds.clone().reanchored(&local_asset_hub, &context).unwrap(); + // reserve 100_000_000_000 WNDs in fees on AHW + // (exec fees: 3_593_000_000, transpo fees: 69_021_561_290 = 72_614_561_290) + // TODO: make this exact once we have PayFees + bridge dry-running + onward_wnds.fun = Fungible(wnds_amount - 100_000_000_000); let xcm_on_ahw = Xcm(vec![ // both WNDs and PENs are local-reserve transferred to Rococo Asset Hub InitiateTransfer { destination: reanchored_dest, - // use up to half the WNDs for fees - remote_fees: Some(AssetTransferFilter::ReserveDeposit(reanchored_wnds.into())), - // transfer everything else (including unspent WNDs) further - assets: vec![AssetTransferFilter::ReserveDeposit(AssetFilter::Wild(All))], + remote_fees: Some(AssetTransferFilter::ReserveDeposit(onward_wnds.into())), + assets: vec![AssetTransferFilter::ReserveDeposit(reanchored_pens.into())], remote_xcm: xcm_on_dest, }, ]);