difftreelog
tests(parallel): fix phantom errors
in: master
7 files changed
tests/src/approve.test.tsdiffbeforeafterboth--- a/tests/src/approve.test.ts
+++ b/tests/src/approve.test.ts
@@ -227,7 +227,7 @@
});
});
-describe('Approved amount decreases by the transferred amount.:', () => {
+describe('Approved amount decreases by the transferred amount:', () => {
let alice: IKeyringPair;
let bob: IKeyringPair;
let charlie: IKeyringPair;
tests/src/confirmSponsorship.test.tsdiffbeforeafterboth--- a/tests/src/confirmSponsorship.test.ts
+++ b/tests/src/confirmSponsorship.test.ts
@@ -73,7 +73,7 @@
});
itSub('Fungible: Transfer fees are paid by the sponsor after confirmation', async ({helper}) => {
- const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'}, 0);
+ const collection = await helper.ft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
await collection.setSponsor(alice, bob.address);
await collection.confirmSponsorship(bob);
const bobBalanceBefore = await helper.balance.getSubstrate(bob.address);
@@ -163,7 +163,10 @@
});
itSub('NFT: Sponsoring of createItem is rate limited', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL', limits: {
+ sponsoredDataRateLimit: {blocks: 1000},
+ sponsorTransferTimeout: 1000,
+ }});
await collection.setSponsor(alice, bob.address);
await collection.confirmSponsorship(bob);
await collection.setPermissions(alice, {mintMode: true, access: 'AllowList'});
@@ -195,7 +198,7 @@
});
itSub('(!negative test!) Confirm sponsorship for a collection that never existed', async ({helper}) => {
- const collectionId = 1_000_000;
+ const collectionId = (1 << 32) - 1;
const confirmSponsorshipTx = async () => helper.collection.confirmSponsorship(bob, collectionId);
await expect(confirmSponsorshipTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
});
tests/src/deprecated-helpers/helpers.tsdiffbeforeafterboth--- a/tests/src/deprecated-helpers/helpers.ts
+++ b/tests/src/deprecated-helpers/helpers.ts
@@ -1764,11 +1764,11 @@
return (await api.rpc.unique.collectionById(collectionId)).unwrap();
}
-/*export const describe_xcm = (
+export const describeXCM = (
process.env.RUN_XCM_TESTS
? describe
: describe.skip
-);*/
+);
export async function waitNewBlocks(blocksCount = 1): Promise<void> {
await usingApi(async (api) => {
tests/src/refungible.test.tsdiffbeforeafterboth--- a/tests/src/refungible.test.ts
+++ b/tests/src/refungible.test.ts
@@ -62,7 +62,7 @@
.to.eventually.be.rejectedWith(/refungible\.WrongRefungiblePieces/);
});
- itSub('RPC method tokenOnewrs for refungible collection and token', async ({helper}) => {
+ itSub('RPC method tokenOwners for refungible collection and token', async ({helper}) => {
const ethAcc = {Ethereum: '0x67fb3503a61b284dc83fa96dceec4192db47dc7c'};
const facelessCrowd = (await helper.arrange.createAccounts(Array(7).fill(0n), donor)).map(keyring => {return {Substrate: keyring.address};});
@@ -212,7 +212,8 @@
const token = await collection.mintToken(alice, 100n);
await token.repartition(alice, 200n);
const chainEvents = helper.chainLog.slice(-1)[0].events;
- expect(chainEvents).to.deep.include({
+ const event = chainEvents.find((event: any) => event.section === 'common' && event.method === 'ItemCreated');
+ expect(event).to.deep.include({
section: 'common',
method: 'ItemCreated',
index: [66, 2],
@@ -222,7 +223,6 @@
{substrate: alice.address},
100n,
],
- phase: {applyExtrinsic: 2},
});
});
@@ -231,9 +231,10 @@
const token = await collection.mintToken(alice, 100n);
await token.repartition(alice, 50n);
const chainEvents = helper.chainLog.slice(-1)[0].events;
- expect(chainEvents).to.deep.include({
+ const event = chainEvents.find((event: any) => event.section === 'common' && event.method === 'ItemDestroyed');
+ expect(event).to.deep.include({
+ section: 'common',
method: 'ItemDestroyed',
- section: 'common',
index: [66, 3],
data: [
collection.collectionId,
@@ -241,7 +242,6 @@
{substrate: alice.address},
50n,
],
- phase: {applyExtrinsic: 2},
});
});
tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth--- a/tests/src/xcm/xcmOpal.test.ts
+++ b/tests/src/xcm/xcmOpal.test.ts
@@ -21,7 +21,7 @@
import {ApiOptions} from '@polkadot/api/types';
import {IKeyringPair} from '@polkadot/types/types';
import usingApi, {executeTransaction} from './../substrate/substrate-api';
-import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount, normalizeAccountId} from './../deprecated-helpers/helpers';
+import {bigIntToDecimals, describeXCM, getGenericResult, paraSiblingSovereignAccount, normalizeAccountId} from './../deprecated-helpers/helpers';
import waitNewBlocks from './../substrate/wait-new-blocks';
import getBalance from './../substrate/get-balance';
@@ -49,7 +49,7 @@
// 10,000.00 (ten thousands) USDT
const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n;
-describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => {
+describeXCM('[XCM] Integration test: Exchanging USDT with Westmint', () => {
let alice: IKeyringPair;
let bob: IKeyringPair;
tests/src/xcm/xcmQuartz.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 {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers';24import {getGenericResult, generateKeyringPair, waitEvent, describeXCM, bigIntToDecimals} from '../deprecated-helpers/helpers';25import {MultiLocation} from '@polkadot/types/interfaces';25import {MultiLocation} from '@polkadot/types/interfaces';26import {blake2AsHex} from '@polkadot/util-crypto';26import {blake2AsHex} from '@polkadot/util-crypto';27import waitNewBlocks from '../substrate/wait-new-blocks';27import waitNewBlocks from '../substrate/wait-new-blocks';61 return parachainApiOptions(RELAY_PORT);61 return parachainApiOptions(RELAY_PORT);62}62}636364describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => {64describeXCM('[XCM] Integration test: Exchanging tokens with Karura', () => {65 let alice: IKeyringPair;65 let alice: IKeyringPair;66 let randomAccount: IKeyringPair;66 let randomAccount: IKeyringPair;6767292});292});293293294// These tests are relevant only when the foreign asset pallet is disabled294// These tests are relevant only when the foreign asset pallet is disabled295describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => {295describeXCM('[XCM] Integration test: Quartz rejects non-native tokens', () => {296 let alice: IKeyringPair;296 let alice: IKeyringPair;297297298 before(async () => {298 before(async () => {433 });433 });434});434});435435436describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {436describeXCM('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {437437438 // Quartz constants438 // Quartz constants439 let quartzAlice: IKeyringPair;439 let quartzAlice: IKeyringPair;tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth--- a/tests/src/xcm/xcmUnique.test.ts
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -21,7 +21,7 @@
import {ApiOptions} from '@polkadot/api/types';
import {IKeyringPair} from '@polkadot/types/types';
import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../deprecated-helpers/helpers';
+import {getGenericResult, generateKeyringPair, waitEvent, describeXCM, bigIntToDecimals} from '../deprecated-helpers/helpers';
import {MultiLocation} from '@polkadot/types/interfaces';
import {blake2AsHex} from '@polkadot/util-crypto';
import waitNewBlocks from '../substrate/wait-new-blocks';
@@ -61,7 +61,7 @@
return parachainApiOptions(RELAY_PORT);
}
-describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => {
+describeXCM('[XCM] Integration test: Exchanging tokens with Acala', () => {
let alice: IKeyringPair;
let randomAccount: IKeyringPair;
@@ -292,7 +292,7 @@
});
// These tests are relevant only when the foreign asset pallet is disabled
-describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => {
+describeXCM('[XCM] Integration test: Unique rejects non-native tokens', () => {
let alice: IKeyringPair;
before(async () => {
@@ -433,7 +433,7 @@
});
});
-describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {
+describeXCM('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {
// Unique constants
let uniqueAlice: IKeyringPair;