git.delta.rocks / unique-network / refs/commits / de884669db7a

difftreelog

fix astar xcm tests with xcm v3

Daniel Shiposha2023-03-30parent: #a8f5a1c.patch.diff
in: master

2 files changed

modifiedtests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth
996 const qtzToShidenTransferred = 10n * (10n ** QTZ_DECIMALS); // 10 QTZ996 const qtzToShidenTransferred = 10n * (10n ** QTZ_DECIMALS); // 10 QTZ
997 const qtzToShidenArrived = 9_999_999_999_088_000_000n; // 9.999 ... QTZ, Shiden takes a commision in foreign tokens997 const qtzToShidenArrived = 9_999_999_999_088_000_000n; // 9.999 ... QTZ, Shiden takes a commision in foreign tokens
998 const senderIinitialBalanceQTZ = 100n * (10n ** QTZ_DECIMALS); // How many QTZ sender has initially998 const senderIinitialBalanceQTZ = 100n * (10n ** QTZ_DECIMALS); // How many QTZ sender has initially
999 const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... QTZ after XCM call999 const senderBalanceAfterXCM = 89_946678090945539197n; // 89.94... QTZ after XCM call
10001000
1001 // Shiden -> Quartz1001 // Shiden -> Quartz
1002 const qtzFromShidenTransfered = 5n * (10n ** QTZ_DECIMALS); // 5 QTZ1002 const qtzFromShidenTransfered = 5n * (10n ** QTZ_DECIMALS); // 5 QTZ
1008 [sender] = await helper.arrange.createAccounts([100n], alice);1008 [sender] = await helper.arrange.createAccounts([100n], alice);
1009 console.log('sender', sender.address);1009 console.log('sender', sender.address);
1010
1011 // Set the default version to wrap the first message to other chains.
1012 await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);
1010 });1013 });
10111014
1012 await usingShidenPlaygrounds(shidenUrl, async (helper) => {1015 await usingShidenPlaygrounds(shidenUrl, async (helper) => {
10511054
1052 itSub('Should connect and send QTZ to Shiden', async ({helper}) => {1055 itSub('Should connect and send QTZ to Shiden', async ({helper}) => {
1053 const destination = {1056 const destination = {
1054 V1: {1057 V2: {
1055 parents: 1,1058 parents: 1,
1056 interior: {1059 interior: {
1057 X1: {1060 X1: {
1062 };1065 };
10631066
1064 const beneficiary = {1067 const beneficiary = {
1065 V1: {1068 V2: {
1066 parents: 0,1069 parents: 0,
1067 interior: {1070 interior: {
1068 X1: {1071 X1: {
1076 };1079 };
10771080
1078 const assets = {1081 const assets = {
1079 V1: [1082 V2: [
1080 {1083 {
1081 id: {1084 id: {
1082 Concrete: {1085 Concrete: {
modifiedtests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth
--- a/tests/src/xcm/xcmUnique.test.ts
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -998,7 +998,7 @@
   const unqToAstarTransferred = 10n * (10n ** UNQ_DECIMALS); // 10 UNQ
   const unqToAstarArrived = 9_999_999_999_088_000_000n; // 9.999 ... UNQ, Shiden takes a commision in foreign tokens
   const senderIinitialBalanceUNQ = 100n * (10n ** UNQ_DECIMALS); // How many UNQ sender has initially
-  const senderBalanceAfterXCM = 89_941967662676666465n; // 89.94... UNQ after XCM call
+  const senderBalanceAfterXCM = 89_946678090945539197n; // 89.94... UNQ after XCM call
 
   // Astar -> Unique
   const unqFromAstarTransfered = 5n * (10n ** UNQ_DECIMALS); // 5 UNQ
@@ -1009,6 +1009,9 @@
       alice = await privateKey('//Alice');
       [randomAccount] = await helper.arrange.createAccounts([100n], alice);
       console.log('randomAccount', randomAccount.address);
+
+      // Set the default version to wrap the first message to other chains.
+      await helper.getSudo().xcm.setSafeXcmVersion(alice, SAFE_XCM_VERSION);
     });
 
     await usingAstarPlaygrounds(astarUrl, async (helper) => {
@@ -1053,7 +1056,7 @@
 
   itSub('Should connect and send UNQ to Astar', async ({helper}) => {
     const destination = {
-      V1: {
+      V2: {
         parents: 1,
         interior: {
           X1: {
@@ -1064,7 +1067,7 @@
     };
 
     const beneficiary = {
-      V1: {
+      V2: {
         parents: 0,
         interior: {
           X1: {
@@ -1078,7 +1081,7 @@
     };
 
     const assets = {
-      V1: [
+      V2: [
         {
           id: {
             Concrete: {