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.tsdiffbeforeafterboth1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure, requirePallets, Pallets} from './util/helpers';3import {createCollection, deleteCollection} from './util/tx';45describe('integration test: delete collection', () => {6 let api: any;7 before(async function () {8 api = await getApiConnection();9 await requirePallets(this, [Pallets.RmrkCore]);10 });1112 const Alice = '//Alice';13 const Bob = '//Bob';1415 it('delete NFT collection', async () => {16 await createCollection(17 api,18 Alice,19 'test-metadata',20 null,21 'test-symbol',22 ).then(async (collectionId) => {23 await deleteCollection(api, Alice, collectionId.toString());24 });25 });2627 it('[negative] delete non-existing NFT collection', async () => {28 const tx = deleteCollection(api, Alice, '99999');29 await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);30 });3132 it('[negative] delete not an owner NFT collection', async () => {33 await createCollection(34 api,35 Alice,36 'test-metadata',37 null,38 'test-symbol',39 ).then(async (collectionId) => {40 const tx = deleteCollection(api, Bob, collectionId.toString());41 await expectTxFailure(/rmrkCore.NoPermission/, tx);42 });43 });4445 after(() => {46 api.disconnect();47 });48});1import {getApiConnection} from '../substrate/substrate-api';2import {expectTxFailure, requirePallets, Pallets} from './util/helpers';3import {createCollection, deleteCollection} from './util/tx';45describe('integration test: delete collection', () => {6 let api: any;7 before(async function () {8 api = await getApiConnection();9 await requirePallets(this, [Pallets.RmrkCore]);10 });1112 const Alice = '//Alice';13 const Bob = '//Bob';1415 it('delete NFT collection', async () => {16 await createCollection(17 api,18 Alice,19 'test-metadata',20 null,21 'test-symbol',22 ).then(async (collectionId) => {23 await deleteCollection(api, Alice, collectionId.toString());24 });25 });2627 it('[negative] delete non-existing NFT collection', async () => {28 const tx = deleteCollection(api, Alice, '99999');29 await expectTxFailure(/rmrkCore\.CollectionUnknown/, tx);30 });3132 it('[negative] delete not an owner NFT collection', async () => {33 await createCollection(34 api,35 Alice,36 'test-metadata',37 null,38 'test-symbol',39 ).then(async (collectionId) => {40 const tx = deleteCollection(api, Bob, collectionId.toString());41 await expectTxFailure(/rmrkCore.NoPermission/, tx);42 });43 });4445 after(async() => { await api.disconnect(); });46});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.tsdiffbeforeafterboth--- a/tests/src/rmrk/lockCollection.test.ts
+++ b/tests/src/rmrk/lockCollection.test.ts
@@ -112,7 +112,5 @@
});
});
- after(() => {
- api.disconnect();
- });
+ after(async() => { await api.disconnect(); });
});
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(); });
});