git.delta.rocks / unique-network / refs/commits / 492866af2f53

difftreelog

fix xcm tests ts errors

Daniel Shiposha2022-09-07parent: #622f2e6.patch.diff
in: master

3 files changed

modifiedtests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth
21import {ApiOptions} from '@polkadot/api/types';21import {ApiOptions} from '@polkadot/api/types';
22import {IKeyringPair} from '@polkadot/types/types';22import {IKeyringPair} from '@polkadot/types/types';
23import usingApi, {submitTransactionAsync} from './../substrate/substrate-api';23import usingApi, {submitTransactionAsync} from './../substrate/substrate-api';
24import {bigIntToDecimals, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers';24import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers';
25import waitNewBlocks from './../substrate/wait-new-blocks';25import waitNewBlocks from './../substrate/wait-new-blocks';
26import {normalizeAccountId} from './../util/helpers';26import {normalizeAccountId} from './../util/helpers';
27import getBalance from './../substrate/get-balance';27import getBalance from './../substrate/get-balance';
50// 10,000.00 (ten thousands) USDT50// 10,000.00 (ten thousands) USDT
51const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 51const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n;
5252
53describe('Integration test: Exchanging USDT with Westmint', () => {53describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => {
54 let alice: IKeyringPair;54 let alice: IKeyringPair;
55 let bob: IKeyringPair;55 let bob: IKeyringPair;
56 56
345 },345 },
346 };346 };
347347
348 const currencies = [[348 const currencies: [any, bigint][] = [
349 [
349 {350 {
350 ForeignAssetId: 0,351 ForeignAssetId: 0,
499 },501 },
500 };502 };
501503
502 const currencies = [504 const currencies: any = [
503 [505 [
504 {506 {
505 NativeAssetId: 'Parent',507 NativeAssetId: 'Parent',
modifiedtests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth
--- a/tests/src/xcm/xcmQuartz.test.ts
+++ b/tests/src/xcm/xcmQuartz.test.ts
@@ -61,7 +61,7 @@
   return parachainApiOptions(RELAY_PORT);
 }
 
-describe_xcm('Integration test: Exchanging tokens with Karura', () => {
+describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => {
   let alice: IKeyringPair;
   let randomAccount: IKeyringPair;
   
@@ -246,7 +246,7 @@
 
         const destWeight = 50000000;
   
-        const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight);
+        const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
         const events = await submitTransactionAsync(randomAccount, tx);
         const result = getGenericResult(events);
         expect(result.success).to.be.true;
@@ -290,7 +290,7 @@
 });
 
 // These tests are relevant only when the foreign asset pallet is disabled
-describe('Integration test: Quartz rejects non-native tokens', () => {
+describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => {
   let alice: IKeyringPair;
 
   before(async () => {
@@ -405,7 +405,7 @@
 
       const destWeight = 50000000;
 
-      const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight);
+      const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
       const events = await submitTransactionAsync(alice, tx);
       const result = getGenericResult(events);
       expect(result.success).to.be.true;
@@ -431,7 +431,7 @@
   });
 });
 
-describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => {
+describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {
 
   // Quartz constants
   let quartzAlice: IKeyringPair;
modifiedtests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth
--- a/tests/src/xcm/xcmUnique.test.ts
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -61,7 +61,7 @@
   return parachainApiOptions(RELAY_PORT);
 }
 
-describe_xcm('Integration test: Exchanging tokens with Acala', () => {
+describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => {
   let alice: IKeyringPair;
   let randomAccount: IKeyringPair;
   
@@ -246,7 +246,7 @@
 
         const destWeight = 50000000;
   
-        const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight);
+        const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
         const events = await submitTransactionAsync(randomAccount, tx);
         const result = getGenericResult(events);
         expect(result.success).to.be.true;
@@ -290,7 +290,7 @@
 });
 
 // These tests are relevant only when the foreign asset pallet is disabled
-describe('Integration test: Unique rejects non-native tokens', () => {
+describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => {
   let alice: IKeyringPair;
 
   before(async () => {
@@ -405,7 +405,7 @@
 
       const destWeight = 50000000;
 
-      const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight);
+      const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
       const events = await submitTransactionAsync(alice, tx);
       const result = getGenericResult(events);
       expect(result.success).to.be.true;
@@ -431,7 +431,7 @@
   });
 });
 
-describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => {
+describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {
 
   // Unique constants
   let uniqueAlice: IKeyringPair;