diff --git a/cumulus/parachains/integration-tests/chopsticks/tests/v5-tests/index.ts b/cumulus/parachains/integration-tests/chopsticks/tests/v5-tests/index.ts index 933e7d453e77..8c0278c09128 100644 --- a/cumulus/parachains/integration-tests/chopsticks/tests/v5-tests/index.ts +++ b/cumulus/parachains/integration-tests/chopsticks/tests/v5-tests/index.ts @@ -387,3 +387,100 @@ test("Initiate Teleport with remote fees", async () => { const r = await ahToWnd.signAndSubmit(aliceSigner); expect(r).toBeTruthy(); }) + +test("Withdraw USDT from Alice to Bob", async () => { + + const msg = Enum('V5', [ + XcmV4Instruction.WithdrawAsset([ + { + id: { + parents: 1, + interior: XcmV3Junctions.Here(), + }, + fun: XcmV3MultiassetFungibility.Fungible(3_000_000_000_000n), + }, + ]), + Enum('PayFees', { + asset: { + id: { + parents: 1, + interior: XcmV3Junctions.Here(), + }, + fun: XcmV3MultiassetFungibility.Fungible(1_000_000_000_000n), + } + }), + XcmV4Instruction.TransferReserveAsset({ + assets: [ + { + id: { + parents: 0, + interior: XcmV3Junctions.X2([ + XcmV3Junction.PalletInstance(50), + XcmV3Junction.GeneralIndex(1984n)]), + }, + fun: XcmV3MultiassetFungibility.Fungible(100_000_000n), + }, + { + id: { + parents: 1, + interior: XcmV3Junctions.Here(), + }, + fun: XcmV3MultiassetFungibility.Fungible(2_000_000_000_000n), + }, + ], + dest: { + parents: 1, + interior: XcmV3Junctions.X1( + XcmV3Junction.Parachain(2042), + ), + }, + xcm: [ + Enum('PayFees', { + asset: { + id: { + parents: 1, + interior: XcmV3Junctions.Here(), + }, + fun: XcmV3MultiassetFungibility.Fungible(1_000_000_000_000n), + } + }), + XcmV4Instruction.DepositAsset({ + assets: XcmV3MultiassetMultiAssetFilter.Wild({ + type: 'All', + value: undefined, + }), + // granular version + // assets: XcmV4AssetAssetFilter.Definite([{ + // id: { + // parents: 1, + // // interior: XcmV3Junctions.Here(), + // interior: XcmV3Junctions.X3([ + // XcmV3Junction.Parachain(1000), + // XcmV3Junction.PalletInstance(50), + // XcmV3Junction.GeneralIndex(1984n)]), + // }, + // // fun: XcmV3MultiassetFungibility.Fungible(1_000_000_000_000n), + // fun: XcmV3MultiassetFungibility.Fungible(100_000_000n), + // }]), + beneficiary: { + parents: 0, + interior: XcmV3Junctions.X1(XcmV3Junction.AccountId32({ + network: undefined, + id: Binary.fromBytes(hdkdKeyPairAlice.publicKey), + })), + }, + }), + ], + }), + ]); + + + const ahToWnd = AHApi.tx.PolkadotXcm.execute({ + message: msg, + // max_weight: { ref_time: weight.value.ref_time, proof_size: weight.value.proof_size }, + max_weight: { ref_time: 81834380000n, proof_size: 823193n }, + }, + ); + const r = await ahToWnd.signAndSubmit(aliceSigner); + expect(r).toBeTruthy(); +})