Skip to content

Commit 785d28b

Browse files
MaksandreCertainLach
authored andcommitted
Build/941056 tests up (#938)
Use XCM V2
1 parent dcfb30c commit 785d28b

2 files changed

Lines changed: 33 additions & 14 deletions

File tree

tests/src/xcm/xcmQuartz.test.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,7 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => {
803803
let quartzParachainMultilocation: any;
804804
let quartzAccountMultilocation: any;
805805
let quartzCombinedMultilocation: any;
806+
let quartzCombinedMultilocationKarura: any; // TODO remove it when Karura goes V2
806807

807808
let messageSent: any;
808809

@@ -847,6 +848,15 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => {
847848
},
848849
};
849850

851+
quartzCombinedMultilocationKarura = {
852+
V1: {
853+
parents: 1,
854+
interior: {
855+
X2: [quartzParachainJunction, quartzAccountJunction],
856+
},
857+
},
858+
};
859+
850860
// Set the default version to wrap the first message to other chains.
851861
await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);
852862
});
@@ -869,7 +879,7 @@ describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => {
869879
const id = {
870880
Token: 'KAR',
871881
};
872-
const destination = quartzCombinedMultilocation;
882+
const destination = quartzCombinedMultilocationKarura;
873883
await helper.xTokens.transfer(alice, id, testAmount, destination, 'Unlimited');
874884

875885
messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent);
@@ -1433,7 +1443,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => {
14331443
itSub('Should connect to Shiden and send QTZ back', async ({helper}) => {
14341444
await usingShidenPlaygrounds(shidenUrl, async (helper) => {
14351445
const destination = {
1436-
V1: {
1446+
V2: {
14371447
parents: 1,
14381448
interior: {
14391449
X1: {
@@ -1444,7 +1454,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => {
14441454
};
14451455

14461456
const beneficiary = {
1447-
V1: {
1457+
V2: {
14481458
parents: 0,
14491459
interior: {
14501460
X1: {
@@ -1458,7 +1468,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => {
14581468
};
14591469

14601470
const assets = {
1461-
V1: [
1471+
V2: [
14621472
{
14631473
id: {
14641474
Concrete: {
@@ -1515,7 +1525,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => {
15151525
const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice);
15161526

15171527
const quartzMultilocation = {
1518-
V1: {
1528+
V2: {
15191529
parents: 1,
15201530
interior: {
15211531
X1: {Parachain: QUARTZ_CHAIN},
@@ -1580,7 +1590,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Shiden', () => {
15801590
const [targetAccount] = await helper.arrange.createAccounts([0n], alice);
15811591

15821592
const quartzMultilocation = {
1583-
V1: {
1593+
V2: {
15841594
parents: 1,
15851595
interior: {
15861596
X1: {

tests/src/xcm/xcmUnique.test.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,7 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => {
805805
let uniqueParachainMultilocation: any;
806806
let uniqueAccountMultilocation: any;
807807
let uniqueCombinedMultilocation: any;
808+
let uniqueCombinedMultilocationAcala: any; // TODO remove when Acala goes V2
808809

809810
let messageSent: any;
810811

@@ -823,7 +824,7 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => {
823824
};
824825

825826
uniqueParachainMultilocation = {
826-
V1: {
827+
V2: {
827828
parents: 1,
828829
interior: {
829830
X1: uniqueParachainJunction,
@@ -849,6 +850,15 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => {
849850
},
850851
};
851852

853+
uniqueCombinedMultilocationAcala = {
854+
V1: {
855+
parents: 1,
856+
interior: {
857+
X2: [uniqueParachainJunction, uniqueAccountJunction],
858+
},
859+
},
860+
};
861+
852862
// Set the default version to wrap the first message to other chains.
853863
await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);
854864
});
@@ -871,7 +881,7 @@ describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => {
871881
const id = {
872882
Token: 'ACA',
873883
};
874-
const destination = uniqueCombinedMultilocation;
884+
const destination = uniqueCombinedMultilocationAcala;
875885
await helper.xTokens.transfer(alice, id, testAmount, destination, 'Unlimited');
876886

877887
messageSent = await helper.wait.expectEvent(maxWaitBlocks, Event.XcmpQueue.XcmpMessageSent);
@@ -1436,7 +1446,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => {
14361446
itSub('Should connect to Astar and send UNQ back', async ({helper}) => {
14371447
await usingAstarPlaygrounds(astarUrl, async (helper) => {
14381448
const destination = {
1439-
V1: {
1449+
V2: {
14401450
parents: 1,
14411451
interior: {
14421452
X1: {
@@ -1447,7 +1457,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => {
14471457
};
14481458

14491459
const beneficiary = {
1450-
V1: {
1460+
V2: {
14511461
parents: 0,
14521462
interior: {
14531463
X1: {
@@ -1461,7 +1471,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => {
14611471
};
14621472

14631473
const assets = {
1464-
V1: [
1474+
V2: [
14651475
{
14661476
id: {
14671477
Concrete: {
@@ -1517,7 +1527,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => {
15171527
const [targetAccount] = await helper.arrange.createAccounts([targetAccountBalance], alice);
15181528

15191529
const uniqueMultilocation = {
1520-
V1: {
1530+
V2: {
15211531
parents: 1,
15221532
interior: {
15231533
X1: {Parachain: UNIQUE_CHAIN},
@@ -1582,7 +1592,7 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => {
15821592
const [targetAccount] = await helper.arrange.createAccounts([0n], alice);
15831593

15841594
const uniqueMultilocation = {
1585-
V1: {
1595+
V2: {
15861596
parents: 1,
15871597
interior: {
15881598
X1: {
@@ -1652,5 +1662,4 @@ describeXCM('[XCM] Integration test: Exchanging tokens with Astar', () => {
16521662
accountBalance = await helper.balance.getSubstrate(targetAccount.address);
16531663
expect(accountBalance).to.be.equal(0n);
16541664
});
1655-
16561665
});

0 commit comments

Comments
 (0)