git.delta.rocks / unique-network / refs/commits / 9ddec87093e6

difftreelog

turn off collision-tests

Igor Kozyrev2021-11-08parent: #b1a1af7.patch.diff
in: master

10 files changed

modifiedtests/src/collision-tests/admVsOwnerChanges.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/admVsOwnerChanges.test.ts
+++ b/tests/src/collision-tests/admVsOwnerChanges.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -50,3 +54,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/admVsOwnerData.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/admVsOwnerData.test.ts
+++ b/tests/src/collision-tests/admVsOwnerData.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -46,3 +50,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/admVsOwnerTake.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/admVsOwnerTake.test.ts
+++ b/tests/src/collision-tests/admVsOwnerTake.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -48,3 +52,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/adminDestroyCollection.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminDestroyCollection.test.ts
+++ b/tests/src/collision-tests/adminDestroyCollection.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -47,3 +51,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/adminLimitsOff.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminLimitsOff.test.ts
+++ b/tests/src/collision-tests/adminLimitsOff.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -63,3 +67,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/adminRightsOff.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminRightsOff.test.ts
+++ b/tests/src/collision-tests/adminRightsOff.test.ts
@@ -1,4 +1,6 @@
-/* obsolete
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
 
 import { IKeyringPair } from '@polkadot/types/types';
 import BN from 'bn.js';
@@ -48,5 +50,4 @@
     });
   });
 });
-
 */
\ No newline at end of file
modifiedtests/src/collision-tests/setSponsorNewOwner.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/setSponsorNewOwner.test.ts
+++ b/tests/src/collision-tests/setSponsorNewOwner.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -44,3 +48,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/sponsorPayments.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/sponsorPayments.test.ts
+++ b/tests/src/collision-tests/sponsorPayments.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -53,3 +57,4 @@
     });
   });
 });
+*/
\ No newline at end of file
modifiedtests/src/collision-tests/tokenLimitsOff.test.tsdiffbeforeafterboth
1/* obsolete1/* broken by design
2// substrate transactions are sequential, not parallel
3// the order of execution is indeterminate
4
2import { IKeyringPair } from '@polkadot/types/types';5import { IKeyringPair } from '@polkadot/types/types';
3import BN from 'bn.js';6import BN from 'bn.js';
4import chai from 'chai';7import chai from 'chai';
5import chaiAsPromised from 'chai-as-promised';8import chaiAsPromised from 'chai-as-promised';
6import privateKey from '../substrate/privateKey';9import privateKey from '../substrate/privateKey';
7import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';10import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
8import {11import {
9 addToWhiteListExpectSuccess,12 addToWhiteListExpectSuccess,
10 createCollectionExpectSuccess,13 createCollectionExpectSuccess,
11 getCreateItemResult,14 getCreateItemResult,
12 setMintPermissionExpectSuccess,15 setMintPermissionExpectSuccess,
13 normalizeAccountId,16 normalizeAccountId,
14 waitNewBlocks,17 waitNewBlocks,
15} from '../util/helpers';18} from '../util/helpers';
1619
17chai.use(chaiAsPromised);20chai.use(chaiAsPromised);
18const expect = chai.expect;21const expect = chai.expect;
19let Alice: IKeyringPair;22let Alice: IKeyringPair;
20let Bob: IKeyringPair;23let Bob: IKeyringPair;
21let Ferdie: IKeyringPair;24let Ferdie: IKeyringPair;
2225
23const accountTokenOwnershipLimit = 4;26const accountTokenOwnershipLimit = 4;
24const sponsoredMintSize = 4294967295;27const sponsoredMintSize = 4294967295;
25const tokenLimit = 4;28const tokenLimit = 4;
26const sponsorTimeout = 14400;29const sponsorTimeout = 14400;
27const ownerCanTransfer = false;30const ownerCanTransfer = false;
28const ownerCanDestroy = false;31const ownerCanDestroy = false;
2932
30before(async () => {33before(async () => {
31 await usingApi(async () => {34 await usingApi(async () => {
32 Alice = privateKey('//Alice');35 Alice = privateKey('//Alice');
33 Bob = privateKey('//Bob');36 Bob = privateKey('//Bob');
34 Ferdie = privateKey('//Ferdie');37 Ferdie = privateKey('//Ferdie');
35 });38 });
36});39});
3740
38describe('Token limit exceeded collection: ', () => {41describe('Token limit exceeded collection: ', () => {
39 // tslint:disable-next-line: max-line-length42 // tslint:disable-next-line: max-line-length
40 it('The number of tokens created in the collection from different addresses exceeds the allowed collection limit ', async () => {43 it('The number of tokens created in the collection from different addresses exceeds the allowed collection limit ', async () => {
41 await usingApi(async (api) => {44 await usingApi(async (api) => {
42 const collectionId = await createCollectionExpectSuccess();45 const collectionId = await createCollectionExpectSuccess();
43 await setMintPermissionExpectSuccess(Alice, collectionId, true);46 await setMintPermissionExpectSuccess(Alice, collectionId, true);
44 await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);47 await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
45 await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);48 await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
46 const setCollectionLim = api.tx.nft.setCollectionLimits(49 const setCollectionLim = api.tx.nft.setCollectionLimits(
47 collectionId,50 collectionId,
48 {51 {
49 accountTokenOwnershipLimit,52 accountTokenOwnershipLimit,
50 sponsoredMintSize,53 sponsoredMintSize,
51 tokenLimit,54 tokenLimit,
52 // tslint:disable-next-line: object-literal-sort-keys55 // tslint:disable-next-line: object-literal-sort-keys
53 sponsorTimeout,56 sponsorTimeout,
54 ownerCanTransfer,57 ownerCanTransfer,
55 ownerCanDestroy,58 ownerCanDestroy,
56 },59 },
57 );60 );
58 const subTx = await submitTransactionAsync(Alice, setCollectionLim);61 const subTx = await submitTransactionAsync(Alice, setCollectionLim);
59 const subTxTesult = getCreateItemResult(subTx);62 const subTxTesult = getCreateItemResult(subTx);
60 // tslint:disable-next-line:no-unused-expression63 // tslint:disable-next-line:no-unused-expression
61 expect(subTxTesult.success).to.be.true;64 expect(subTxTesult.success).to.be.true;
62 await waitNewBlocks(2);65 await waitNewBlocks(2);
6366
64 const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];67 const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
65 const mintItemOne = api.tx.nft68 const mintItemOne = api.tx.nft
66 .createMultipleItems(collectionId, normalizeAccountId(Ferdie.address), args);69 .createMultipleItems(collectionId, normalizeAccountId(Ferdie.address), args);
67 const mintItemTwo = api.tx.nft70 const mintItemTwo = api.tx.nft
68 .createMultipleItems(collectionId, normalizeAccountId(Bob.address), args);71 .createMultipleItems(collectionId, normalizeAccountId(Bob.address), args);
69 await Promise.all([72 await Promise.all([
70 mintItemOne.signAndSend(Ferdie),73 mintItemOne.signAndSend(Ferdie),
71 mintItemTwo.signAndSend(Bob),74 mintItemTwo.signAndSend(Bob),
72 ]);75 ]);
73 await waitNewBlocks(2);76 await waitNewBlocks(2);
74 const itemsListIndexAfter = await api.query.nft.itemListIndex(collectionId) as unknown as BN;77 const itemsListIndexAfter = await api.query.nft.itemListIndex(collectionId) as unknown as BN;
75 expect(itemsListIndexAfter.toNumber()).to.be.equal(3);78 expect(itemsListIndexAfter.toNumber()).to.be.equal(3);
76 // TokenLimit = 4. The first transaction is successful. The second should fail.79 // TokenLimit = 4. The first transaction is successful. The second should fail.
77 await waitNewBlocks(2);80 await waitNewBlocks(2);
78 });81 });
79 });82 });
80});83});
81*/84*/
8285
modifiedtests/src/collision-tests/turnsOffMinting.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/turnsOffMinting.test.ts
+++ b/tests/src/collision-tests/turnsOffMinting.test.ts
@@ -1,3 +1,7 @@
+/* broken by design
+// substrate transactions are sequential, not parallel
+// the order of execution is indeterminate
+
 import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -45,3 +49,4 @@
     });
   });
 });
+*/
\ No newline at end of file