git.delta.rocks / unique-network / refs/commits / 598440f58130

difftreelog

fix quartz xcm tests for kusama 0.9.38

Daniel Shiposha2023-04-10parent: #ceae5ed.patch.diff
in: master

3 files changed

modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
2959 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.teleportAssets`, [destination, beneficiary, assets, feeAssetItem], true);2959 await this.helper.executeExtrinsic(signer, `api.tx.${this.palletName}.teleportAssets`, [destination, beneficiary, assets, feeAssetItem], true);
2960 }2960 }
29612961
2962 async teleportNativeAsset(signer: TSigner, destinationParaId: number, targetAccount: Uint8Array, amount: bigint) {2962 async teleportNativeAsset(signer: TSigner, destinationParaId: number, targetAccount: Uint8Array, amount: bigint, xcmVersion: number = 3) {
2963 const destination = {2963 const destinationContent = {
2964 V1: {
2965 parents: 0,2964 parents: 0,
2966 interior: {2965 interior: {
2967 X1: {2966 X1: {
2968 Parachain: destinationParaId,2967 Parachain: destinationParaId,
2969 },2968 },
2970 },2969 },
2971 },
2972 };2970 };
29732971
2974 const beneficiary = {2972 const beneficiaryContent = {
2975 V1: {
2976 parents: 0,2973 parents: 0,
2977 interior: {2974 interior: {
2978 X1: {2975 X1: {
2982 },2979 },
2983 },2980 },
2984 },2981 },
2985 },
2986 };2982 };
29872983
2988 const assets = {2984 const assetsContent = [
2989 V1: [
2990 {2985 {
2991 id: {2986 id: {
2992 Concrete: {2987 Concrete: {
2998 Fungible: amount,2993 Fungible: amount,
2999 },2994 },
3000 },2995 },
3001 ],2996 ];
3002 };2997
2998 let destination;
2999 let beneficiary;
3000 let assets;
3001
3002 if (xcmVersion == 2) {
3003 destination = { V1: destinationContent };
3004 beneficiary = { V1: beneficiaryContent };
3005 assets = { V1: assetsContent };
3006
3007 } else if (xcmVersion == 3) {
3008 destination = { V2: destinationContent };
3009 beneficiary = { V2: beneficiaryContent };
3010 assets = { V2: assetsContent };
3011
3012 } else {
3013 throw Error("Unknown XCM version: " + xcmVersion);
3014 }
30033015
3004 const feeAssetItem = 0;3016 const feeAssetItem = 0;
30053017
modifiedtests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth
154 // (fee for USDT XCM are paid in relay tokens)154 // (fee for USDT XCM are paid in relay tokens)
155 await usingRelayPlaygrounds(relayUrl, async (helper) => {155 await usingRelayPlaygrounds(relayUrl, async (helper) => {
156 const destination = {156 const destination = {
157 V1: {157 V2: {
158 parents: 0,158 parents: 0,
159 interior: {X1: {159 interior: {X1: {
160 Parachain: QUARTZ_CHAIN,160 Parachain: QUARTZ_CHAIN,
163 }};163 }};
164164
165 const beneficiary = {165 const beneficiary = {
166 V1: {166 V2: {
167 parents: 0,167 parents: 0,
168 interior: {X1: {168 interior: {X1: {
169 AccountId32: {169 AccountId32: {
175 };175 };
176176
177 const assets = {177 const assets = {
178 V1: [178 V2: [
179 {179 {
180 id: {180 id: {
181 Concrete: {181 Concrete: {
200 itSub('Should connect and send USDT from Statemine to Quartz', async ({helper}) => {200 itSub('Should connect and send USDT from Statemine to Quartz', async ({helper}) => {
201 await usingStateminePlaygrounds(statemineUrl, async (helper) => {201 await usingStateminePlaygrounds(statemineUrl, async (helper) => {
202 const dest = {202 const dest = {
203 V1: {203 V2: {
204 parents: 1,204 parents: 1,
205 interior: {X1: {205 interior: {X1: {
206 Parachain: QUARTZ_CHAIN,206 Parachain: QUARTZ_CHAIN,
209 }};209 }};
210210
211 const beneficiary = {211 const beneficiary = {
212 V1: {212 V2: {
213 parents: 0,213 parents: 0,
214 interior: {X1: {214 interior: {X1: {
215 AccountId32: {215 AccountId32: {
221 };221 };
222222
223 const assets = {223 const assets = {
224 V1: [224 V2: [
225 {225 {
226 id: {226 id: {
227 Concrete: {227 Concrete: {
341341
342 await usingRelayPlaygrounds(relayUrl, async (helper) => {342 await usingRelayPlaygrounds(relayUrl, async (helper) => {
343 const destination = {343 const destination = {
344 V1: {344 V2: {
345 parents: 0,345 parents: 0,
346 interior: {X1: {346 interior: {X1: {
347 Parachain: QUARTZ_CHAIN,347 Parachain: QUARTZ_CHAIN,
350 }};350 }};
351351
352 const beneficiary = {352 const beneficiary = {
353 V1: {353 V2: {
354 parents: 0,354 parents: 0,
355 interior: {X1: {355 interior: {X1: {
356 AccountId32: {356 AccountId32: {
362 };362 };
363363
364 const assets = {364 const assets = {
365 V1: [365 V2: [
366 {366 {
367 id: {367 id: {
368 Concrete: {368 Concrete: {
modifiedtests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth
8585
86 await usingRelayPlaygrounds(relayUrl, async (helper) => {86 await usingRelayPlaygrounds(relayUrl, async (helper) => {
87 // Fund accounts on Statemint87 // Fund accounts on Statemint
88 const relayXcmVersion = 2;
88 await helper.xcm.teleportNativeAsset(alice, STATEMINT_CHAIN, alice.addressRaw, FUNDING_AMOUNT);89 await helper.xcm.teleportNativeAsset(alice, STATEMINT_CHAIN, alice.addressRaw, FUNDING_AMOUNT, relayXcmVersion);
89 await helper.xcm.teleportNativeAsset(alice, STATEMINT_CHAIN, bob.addressRaw, FUNDING_AMOUNT);90 await helper.xcm.teleportNativeAsset(alice, STATEMINT_CHAIN, bob.addressRaw, FUNDING_AMOUNT, relayXcmVersion);
90 });91 });
9192
92 await usingStatemintPlaygrounds(statemintUrl, async (helper) => {93 await usingStatemintPlaygrounds(statemintUrl, async (helper) => {