1/* broken by design2// substrate transactions are sequential, not parallel3// the order of execution is indeterminate45import { IKeyringPair } from '@polkadot/types/types';6import chai from 'chai';7import chaiAsPromised from 'chai-as-promised';8import privateKey from '../substrate/privateKey';9import usingApi from '../substrate/substrate-api';10import {11 addToAllowListExpectSuccess,12 createCollectionExpectSuccess,13 setMintPermissionExpectSuccess,14 normalizeAccountId,15 waitNewBlocks,16} from '../util/helpers';1718chai.use(chaiAsPromised);19const expect = chai.expect;20let Alice: IKeyringPair;21let Ferdie: IKeyringPair;2223before(async () => {24 await usingApi(async () => {25 Alice = privateKey('//Alice');26 Ferdie = privateKey('//Ferdie');27 });28});2930describe('Turns off minting mode: ', () => {31 // tslint:disable-next-line: max-line-length32 it('The collection owner turns off minting mode and there are minting transactions in the same block ', async () => {33 await usingApi(async (api) => {34 const collectionId = await createCollectionExpectSuccess();35 await setMintPermissionExpectSuccess(Alice, collectionId, true);36 await addToAllowListExpectSuccess(Alice, collectionId, Ferdie.address);3738 const mintItem = api.tx.unique.createItem(collectionId, normalizeAccountId(Ferdie.address), 'NFT');39 const offMinting = api.tx.unique.setMintPermission(collectionId, false);40 await Promise.all([41 mintItem.signAndSend(Ferdie),42 offMinting.signAndSend(Alice),43 ]);44 let itemList = false;45 itemList = (await (api.query.unique.nftItemList(collectionId, mintItem))).toJSON() as boolean;46 // tslint:disable-next-line: no-unused-expression47 expect(itemList).to.be.null;48 await waitNewBlocks(2);49 });50 });51});52*/difftreelog
source
tests/src/collision-tests/turnsOffMinting.test.ts1.8 KiBsourcehistory