difftreelog
fix xcm tests ts errors
in: master
3 files changed
tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth21import {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) USDT51const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 51const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n; 525253describe('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 };347347348 const currencies = [[348 const currencies: [any, bigint][] = [349 [349 {350 {350 ForeignAssetId: 0,351 ForeignAssetId: 0,499 },501 },500 };502 };501503502 const currencies = [504 const currencies: any = [503 [505 [504 {506 {505 NativeAssetId: 'Parent',507 NativeAssetId: 'Parent',tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth61 return parachainApiOptions(RELAY_PORT);61 return parachainApiOptions(RELAY_PORT);62}62}636364describe_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 246246247 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});291291292// These tests are relevant only when the foreign asset pallet is disabled292// These tests are relevant only when the foreign asset pallet is disabled293describe('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;295295296 before(async () => {296 before(async () => {405405406 const destWeight = 50000000;406 const destWeight = 50000000;407407408 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});433433434describe_xcm('Integration test: Exchanging QTZ with Moonriver', () => {434describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {435435436 // Quartz constants436 // Quartz constants437 let quartzAlice: IKeyringPair;437 let quartzAlice: IKeyringPair;tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth61 return parachainApiOptions(RELAY_PORT);61 return parachainApiOptions(RELAY_PORT);62}62}636364describe_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 246246247 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});291291292// These tests are relevant only when the foreign asset pallet is disabled292// These tests are relevant only when the foreign asset pallet is disabled293describe('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;295295296 before(async () => {296 before(async () => {405405406 const destWeight = 50000000;406 const destWeight = 50000000;407407408 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});433433434describe_xcm('Integration test: Exchanging UNQ with Moonbeam', () => {434describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {435435436 // Unique constants436 // Unique constants437 let uniqueAlice: IKeyringPair;437 let uniqueAlice: IKeyringPair;