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
61 return parachainApiOptions(RELAY_PORT);61 return parachainApiOptions(RELAY_PORT);
62}62}
6363
64describe_xcm('Integration test: Exchanging tokens with Karura', () => {64describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => {
65 let alice: IKeyringPair;65 let alice: IKeyringPair;
66 let randomAccount: IKeyringPair;66 let randomAccount: IKeyringPair;
67 67
246246
247 const destWeight = 50000000;247 const destWeight = 50000000;
248 248
249 const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight);249 const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
250 const events = await submitTransactionAsync(randomAccount, tx);250 const events = await submitTransactionAsync(randomAccount, tx);
251 const result = getGenericResult(events);251 const result = getGenericResult(events);
252 expect(result.success).to.be.true;252 expect(result.success).to.be.true;
290});290});
291291
292// These tests are relevant only when the foreign asset pallet is disabled292// These tests are relevant only when the foreign asset pallet is disabled
293describe('Integration test: Quartz rejects non-native tokens', () => {293describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => {
294 let alice: IKeyringPair;294 let alice: IKeyringPair;
295295
296 before(async () => {296 before(async () => {
405405
406 const destWeight = 50000000;406 const destWeight = 50000000;
407407
408 const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight);408 const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
409 const events = await submitTransactionAsync(alice, tx);409 const events = await submitTransactionAsync(alice, tx);
410 const result = getGenericResult(events);410 const result = getGenericResult(events);
411 expect(result.success).to.be.true;411 expect(result.success).to.be.true;
431 });431 });
432});432});
433433
434describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => {434describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {
435435
436 // Quartz constants436 // Quartz constants
437 let quartzAlice: IKeyringPair;437 let quartzAlice: IKeyringPair;
modifiedtests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth
61 return parachainApiOptions(RELAY_PORT);61 return parachainApiOptions(RELAY_PORT);
62}62}
6363
64describe_xcm('Integration test: Exchanging tokens with Acala', () => {64describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => {
65 let alice: IKeyringPair;65 let alice: IKeyringPair;
66 let randomAccount: IKeyringPair;66 let randomAccount: IKeyringPair;
67 67
246246
247 const destWeight = 50000000;247 const destWeight = 50000000;
248 248
249 const tx = api.tx.xTokens.transfer(id, TRANSFER_AMOUNT, destination, destWeight);249 const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
250 const events = await submitTransactionAsync(randomAccount, tx);250 const events = await submitTransactionAsync(randomAccount, tx);
251 const result = getGenericResult(events);251 const result = getGenericResult(events);
252 expect(result.success).to.be.true;252 expect(result.success).to.be.true;
290});290});
291291
292// These tests are relevant only when the foreign asset pallet is disabled292// These tests are relevant only when the foreign asset pallet is disabled
293describe('Integration test: Unique rejects non-native tokens', () => {293describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => {
294 let alice: IKeyringPair;294 let alice: IKeyringPair;
295295
296 before(async () => {296 before(async () => {
405405
406 const destWeight = 50000000;406 const destWeight = 50000000;
407407
408 const tx = api.tx.xTokens.transfer(id, 100_000_000_000, destination, destWeight);408 const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
409 const events = await submitTransactionAsync(alice, tx);409 const events = await submitTransactionAsync(alice, tx);
410 const result = getGenericResult(events);410 const result = getGenericResult(events);
411 expect(result.success).to.be.true;411 expect(result.success).to.be.true;
431 });431 });
432});432});
433433
434describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => {434describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {
435435
436 // Unique constants436 // Unique constants
437 let uniqueAlice: IKeyringPair;437 let uniqueAlice: IKeyringPair;