Skip to content

Commit

Permalink
reserve transfer back works!
Browse files Browse the repository at this point in the history
  • Loading branch information
luispdm committed Jan 8, 2025
1 parent 2f1dafa commit b903f6b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion xcm-simulator/src/tests/laosish_xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ fn roundtrip_reserve_transfer_laosish_to_para_a() {
});

let transfer_amount_1 = 100;
let transfer_amount_2 = 10;

let alith: laosish::AccountId = ALITH.into();

Expand Down Expand Up @@ -293,5 +294,26 @@ fn roundtrip_reserve_transfer_laosish_to_para_a() {
parachain::ForeignAssets::balance((Parent, Parachain(PARA_LAOSISH_ID)).into(), &ALICE),
transfer_amount_1
);
})

assert_ok!(ParachainPalletXcm::limited_reserve_transfer_assets(
parachain::RuntimeOrigin::signed(ALICE),
Box::new((Parent, Parachain(PARA_LAOSISH_ID)).into()),
Box::new(AccountKey20 { network: None, key: ALITH }.into()),
Box::new(((Parent, Parachain(PARA_LAOSISH_ID)), transfer_amount_2).into()),
0,
WeightLimit::Unlimited
));

assert_eq!(
parachain::ForeignAssets::balance((Parent, Parachain(PARA_LAOSISH_ID)).into(), &ALICE),
transfer_amount_1 - transfer_amount_2
);
});

Laosish::execute_with(|| {
assert_eq!(
laosish::Balances::free_balance(alith),
INITIAL_BALANCE - (transfer_amount_1 - transfer_amount_2)
);
});
}

0 comments on commit b903f6b

Please sign in to comment.