add ignored test which will work once we upgrade to v0.9.19
@@ -10,6 +10,54 @@ use orml_traits::currency::MultiCurrency;
use sp_runtime::traits::AccountIdConversion;
use xcm_emulator::TestExt;
+#[test]
+#[ignore]
+//TODO: This test is ignored as cross chain reserve transfer disabled on polkadot v0.9.16 within pallet_xcm (via pallet config `XcmReserveTransferFilter`).
+//From polkadot v0.9.19 this filter allows such transfer (https://github.com/paritytech/polkadot/blob/f00a2772497aadddf75b8b4b475843ea0d910c48/runtime/polkadot/src/xcm_config.rs#L185), so we should remove the #[ignore] tag once we upgrade to that version
+fn hydra_should_receive_asset_when_transferred_from_polkadot_relay_chain() {
+ //Arrange
+ Hydra::execute_with(|| {
+ assert_ok!(hydradx_runtime::AssetRegistry::set_location(
+ hydradx_runtime::Origin::root(),
+ 1,
+ hydradx_runtime::AssetLocation(MultiLocation::parent())
+ ));
+ });
+ PolkadotRelay::execute_with(|| {
+ //Act
+ assert_ok!(polkadot_runtime::XcmPallet::reserve_transfer_assets(
+ polkadot_runtime::Origin::signed(ALICE.into()),
+ Box::new(Parachain(2000).into().into()),
+ Box::new(
+ Junction::AccountId32 {
+ id: BOB,
+ network: NetworkId::Any
+ }
+ .into()
+ .into()
+ ),
+ Box::new((Here, 300 * UNITS).into()),
+ 0,
+ ));
+
+ //Assert
+ assert_eq!(
+ polkadot_runtime::Balances::free_balance(&ParaId::from(2000i32).into_account()),
+ 310 * UNITS
+ );
+ });
+
+ Hydra::execute_with(|| {
+ assert_eq!(
+ hydradx_runtime::Tokens::free_balance(1, &AccountId::from(BOB)),
+ 12780 * UNITS / 10
+ );
+ assert_eq!(
+ hydradx_runtime::Tokens::free_balance(1, &hydradx_runtime::Treasury::account_id()),
+ 22 * UNITS
+ );
+ });
+}
#[test]
fn polkadot_should_receive_asset_when_sent_from_hydra() {
