difftreelog
fix RMRK disconnect
in: master
20 files changed
tests/src/rmrk/acceptNft.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/acceptNft.test.ts
+++ b/tests/src/rmrk/acceptNft.test.ts
@@ -103,5 +103,5 @@
expect(isChild).to.be.false;
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/addResource.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/addResource.test.ts
+++ b/tests/src/rmrk/addResource.test.ts
@@ -432,6 +432,6 @@
after(() => {
- api.disconnect();
+ after(async() => { await api.disconnect(); });
});
});
tests/src/rmrk/addTheme.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/addTheme.test.ts
+++ b/tests/src/rmrk/addTheme.test.ts
@@ -125,5 +125,5 @@
await expectTxFailure(/rmrkEquip\.PermissionError/, tx);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/burnNft.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/burnNft.test.ts
+++ b/tests/src/rmrk/burnNft.test.ts
@@ -166,7 +166,5 @@
});
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/changeCollectionIssuer.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/changeCollectionIssuer.test.ts
+++ b/tests/src/rmrk/changeCollectionIssuer.test.ts
@@ -49,7 +49,5 @@
});
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/createBase.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/createBase.test.ts
+++ b/tests/src/rmrk/createBase.test.ts
@@ -84,5 +84,5 @@
]);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/createCollection.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/createCollection.test.ts
+++ b/tests/src/rmrk/createCollection.test.ts
@@ -21,5 +21,5 @@
await createCollection(api, alice, 'no-limit-metadata', null, 'no-limit-symbol');
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/deleteCollection.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/deleteCollection.test.ts
+++ b/tests/src/rmrk/deleteCollection.test.ts
@@ -42,7 +42,5 @@
});
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/equipNft.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/equipNft.test.ts
+++ b/tests/src/rmrk/equipNft.test.ts
@@ -336,7 +336,5 @@
await expectTxFailure(/rmrkEquip\.CollectionNotEquippable/, tx);
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/getOwnedNfts.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/getOwnedNfts.test.ts
+++ b/tests/src/rmrk/getOwnedNfts.test.ts
@@ -76,5 +76,5 @@
});
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/lockCollection.test.tsdiffbeforeafterboth1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure, requirePallets, Pallets} from './util/helpers';3import {createCollection, lockCollection, mintNft} from './util/tx';45describe('integration test: lock collection', () => {6 const Alice = '//Alice';7 const Bob = '//Bob';8 const Max = 5;910 let api: any;11 before(async function () {12 api = await getApiConnection();13 await requirePallets(this, [Pallets.RmrkCore]);14 });1516 it('lock collection', async () => {17 await createCollection(18 api,19 Alice,20 'test-metadata',21 null,22 'test-symbol',23 ).then(async (collectionId) => {24 await lockCollection(api, Alice, collectionId);25 });26 });2728 it('[negative] lock non-existing NFT collection', async () => {29 const tx = lockCollection(api, Alice, 99999);30 await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);31 });3233 it('[negative] lock not an owner NFT collection issuer', async () => {34 await createCollection(35 api,36 Alice,37 'test-metadata',38 null,39 'test-symbol',40 ).then(async (collectionId) => {41 const tx = lockCollection(api, Bob, collectionId);42 await expectTxFailure(/rmrkCore\.NoPermission/, tx);43 });44 });4546 it('lock collection with minting', async () => {47 await createCollection(48 api,49 Alice,50 'test-metadata',51 Max,52 'test-symbol',53 ).then(async (collectionId) => {54 for (let i = 0; i < 5; i++) {55 await mintNft(56 api,57 Alice,58 Alice,59 collectionId,60 'test-metadata',61 null,62 null,63 );64 }65 await lockCollection(api, Alice, collectionId, Max);66 });67 });6869 it('[negative] unable to mint NFT inside a locked collection', async () => {70 await createCollection(71 api,72 Alice,73 'test-metadata',74 Max,75 'test-symbol',76 ).then(async (collectionId) => {77 await lockCollection(api, Alice, collectionId);78 const tx = mintNft(79 api,80 Alice,81 Alice,82 collectionId,83 'test-metadata',84 null,85 null,86 );87 await expectTxFailure(/rmrkCore\.CollectionFullOrLocked/, tx);88 });89 });9091 it('[negative] unable to mint NFT inside a full collection', async () => {92 await createCollection(api, Alice, 'test-metadata', 1, 'test-symbol').then(async (collectionId) => {93 await mintNft(94 api,95 Alice,96 Alice,97 collectionId,98 'test-metadata',99 null,100 null,101 );102 const tx = mintNft(103 api,104 Alice,105 Alice,106 collectionId,107 'test-metadata',108 null,109 null,110 );111 await expectTxFailure(/rmrkCore\.CollectionFullOrLocked/, tx);112 });113 });114115 after(() => {116 api.disconnect();117 });118});1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure, requirePallets, Pallets} from './util/helpers';3import {createCollection, lockCollection, mintNft} from './util/tx';45describe('integration test: lock collection', () => {6 const Alice = '//Alice';7 const Bob = '//Bob';8 const Max = 5;910 let api: any;11 before(async function () {12 api = await getApiConnection();13 await requirePallets(this, [Pallets.RmrkCore]);14 });1516 it('lock collection', async () => {17 await createCollection(18 api,19 Alice,20 'test-metadata',21 null,22 'test-symbol',23 ).then(async (collectionId) => {24 await lockCollection(api, Alice, collectionId);25 });26 });2728 it('[negative] lock non-existing NFT collection', async () => {29 const tx = lockCollection(api, Alice, 99999);30 await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);31 });3233 it('[negative] lock not an owner NFT collection issuer', async () => {34 await createCollection(35 api,36 Alice,37 'test-metadata',38 null,39 'test-symbol',40 ).then(async (collectionId) => {41 const tx = lockCollection(api, Bob, collectionId);42 await expectTxFailure(/rmrkCore\.NoPermission/, tx);43 });44 });4546 it('lock collection with minting', async () => {47 await createCollection(48 api,49 Alice,50 'test-metadata',51 Max,52 'test-symbol',53 ).then(async (collectionId) => {54 for (let i = 0; i < 5; i++) {55 await mintNft(56 api,57 Alice,58 Alice,59 collectionId,60 'test-metadata',61 null,62 null,63 );64 }65 await lockCollection(api, Alice, collectionId, Max);66 });67 });6869 it('[negative] unable to mint NFT inside a locked collection', async () => {70 await createCollection(71 api,72 Alice,73 'test-metadata',74 Max,75 'test-symbol',76 ).then(async (collectionId) => {77 await lockCollection(api, Alice, collectionId);78 const tx = mintNft(79 api,80 Alice,81 Alice,82 collectionId,83 'test-metadata',84 null,85 null,86 );87 await expectTxFailure(/rmrkCore\.CollectionFullOrLocked/, tx);88 });89 });9091 it('[negative] unable to mint NFT inside a full collection', async () => {92 await createCollection(api, Alice, 'test-metadata', 1, 'test-symbol').then(async (collectionId) => {93 await mintNft(94 api,95 Alice,96 Alice,97 collectionId,98 'test-metadata',99 null,100 null,101 );102 const tx = mintNft(103 api,104 Alice,105 Alice,106 collectionId,107 'test-metadata',108 null,109 null,110 );111 await expectTxFailure(/rmrkCore\.CollectionFullOrLocked/, tx);112 });113 });114115 after(async() => { await api.disconnect(); });116});tests/src/rmrk/mintNft.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/mintNft.test.ts
+++ b/tests/src/rmrk/mintNft.test.ts
@@ -207,5 +207,5 @@
expect(nft.isSome).to.be.false;
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/rejectNft.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/rejectNft.test.ts
+++ b/tests/src/rmrk/rejectNft.test.ts
@@ -90,5 +90,5 @@
await expectTxFailure(/rmrkCore\.CannotRejectNonPendingNft/, tx);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/removeResource.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/removeResource.test.ts
+++ b/tests/src/rmrk/removeResource.test.ts
@@ -343,7 +343,5 @@
await expectTxFailure(/rmrkCore\.NoPermission/, tx);
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/rmrkIsolation.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/rmrkIsolation.test.ts
+++ b/tests/src/rmrk/rmrkIsolation.test.ts
@@ -90,7 +90,7 @@
bob = privateKey('//Bob');
normalizedAlice = {Substrate: helper.address.normalizeSubstrateToChainFormat(alice.address)};
- requirePalletsOrSkip(this, helper, [Pallets.RmrkCore]);
+ await requirePalletsOrSkip(this, helper, [Pallets.RmrkCore]);
const collectionIds = await createRmrkCollection(helper, alice);
uniqueCollectionId = collectionIds.uniqueId;
tests/src/rmrk/sendNft.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/sendNft.test.ts
+++ b/tests/src/rmrk/sendNft.test.ts
@@ -251,5 +251,5 @@
await expectTxFailure(/rmrkCore\.NoPermission/, tx);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/setCollectionProperty.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/setCollectionProperty.test.ts
+++ b/tests/src/rmrk/setCollectionProperty.test.ts
@@ -62,7 +62,5 @@
});
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/setEquippableList.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/setEquippableList.test.ts
+++ b/tests/src/rmrk/setEquippableList.test.ts
@@ -110,5 +110,5 @@
await expectTxFailure(/rmrkEquip\.PartDoesntExist/, tx);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/setNftProperty.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/setNftProperty.test.ts
+++ b/tests/src/rmrk/setNftProperty.test.ts
@@ -84,5 +84,5 @@
await expectTxFailure(/rmrkCore\.NoPermission/, tx);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});
tests/src/rmrk/setResourcePriorities.test.tsdiffbeforeafterboth--- a/tests/src/rmrk/setResourcePriorities.test.ts
+++ b/tests/src/rmrk/setResourcePriorities.test.ts
@@ -54,5 +54,5 @@
await expectTxFailure(/rmrkCore\.NoAvailableNftId/, tx);
});
- after(() => { api.disconnect(); });
+ after(async() => { await api.disconnect(); });
});