git.delta.rocks / unique-network / refs/commits / 4e76702c569f

difftreelog

ES lint issues fixed

Greg Zaitsev2021-06-28parent: #25b82cf.patch.diff
in: master

58 files changed

modifiedtests/src/addToContractWhiteList.test.tsdiffbeforeafterboth
--- a/tests/src/addToContractWhiteList.test.ts
+++ b/tests/src/addToContractWhiteList.test.ts
@@ -3,25 +3,25 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import chai from "chai";
+import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import privateKey from "./substrate/privateKey";
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import privateKey from './substrate/privateKey';
 import {
-  deployFlipper
-} from "./util/contracthelpers";
+  deployFlipper,
+} from './util/contracthelpers';
 import {
-  getGenericResult, normalizeAccountId
-} from "./util/helpers"
+  getGenericResult,
+} from './util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
 
 describe('Integration Test addToContractWhiteList', () => {
 
-  it(`Add an address to a contract white list`, async () => {
+  it('Add an address to a contract white list', async () => {
     await usingApi(async api => {
-      const bob = privateKey("//Bob");
+      const bob = privateKey('//Bob');
       const [contract, deployer] = await deployFlipper(api);
 
       const whiteListedBefore = (await api.query.nft.contractWhiteList(contract.address, bob.address)).toJSON();
@@ -35,9 +35,9 @@
     });
   });
 
-  it(`Adding same address to white list repeatedly should not produce errors`, async () => {
+  it('Adding same address to white list repeatedly should not produce errors', async () => {
     await usingApi(async api => {
-      const bob = privateKey("//Bob");
+      const bob = privateKey('//Bob');
       const [contract, deployer] = await deployFlipper(api);
 
       const whiteListedBefore = (await api.query.nft.contractWhiteList(contract.address, bob.address)).toJSON();
@@ -58,11 +58,11 @@
 
 describe('Negative Integration Test addToContractWhiteList', () => {
 
-  it(`Add an address to a white list of a non-contract`, async () => {
+  it('Add an address to a white list of a non-contract', async () => {
     await usingApi(async api => {
-      const alice = privateKey("//Bob");
-      const bob = privateKey("//Bob");
-      const charlieGuineaPig = privateKey("//Charlie");
+      const alice = privateKey('//Bob');
+      const bob = privateKey('//Bob');
+      const charlieGuineaPig = privateKey('//Charlie');
 
       const whiteListedBefore = (await api.query.nft.contractWhiteList(charlieGuineaPig.address, bob.address)).toJSON();
       const addTx = api.tx.nft.addToContractWhiteList(charlieGuineaPig.address, bob.address);
@@ -74,10 +74,10 @@
     });
   });
 
-  it(`Add to a contract white list using a non-owner address`, async () => {
+  it('Add to a contract white list using a non-owner address', async () => {
     await usingApi(async api => {
-      const bob = privateKey("//Bob");
-      const [contract, deployer] = await deployFlipper(api);
+      const bob = privateKey('//Bob');
+      const [contract] = await deployFlipper(api);
 
       const whiteListedBefore = (await api.query.nft.contractWhiteList(contract.address, bob.address)).toJSON();
       const addTx = api.tx.nft.addToContractWhiteList(contract.address, bob.address);
modifiedtests/src/addToWhiteList.test.tsdiffbeforeafterboth
--- a/tests/src/addToWhiteList.test.ts
+++ b/tests/src/addToWhiteList.test.ts
@@ -1,87 +1,87 @@
-//
-// This file is subject to the terms and conditions defined in
-// file 'LICENSE', which is part of this source code package.
-//
-
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
-import usingApi, { submitTransactionExpectFailAsync } from './substrate/substrate-api';
-import {
-  addToWhiteListExpectSuccess,
-  createCollectionExpectSuccess,
-  createItemExpectSuccess,
-  destroyCollectionExpectSuccess,
-  enablePublicMintingExpectSuccess,
-  enableWhiteListExpectSuccess,
-  normalizeAccountId,
-} from './util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-
-describe('Integration Test ext. addToWhiteList()', () => {
-
-  before(async () => {
-    await usingApi(async (api) => {
-      Alice = privateKey('//Alice');
-      Bob = privateKey('//Bob');
-    });
-  });
-
-  it('Execute the extrinsic with parameters: Collection ID and address to add to the white list', async () => {
-    const collectionId = await createCollectionExpectSuccess();
-    await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
-  });
-
-  it('Whitelisted minting: list restrictions', async () => {
-    const collectionId = await createCollectionExpectSuccess();
-    await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
-    await enableWhiteListExpectSuccess(Alice, collectionId);
-    await enablePublicMintingExpectSuccess(Alice, collectionId);
-    await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
-  });
-});
-
-describe('Negative Integration Test ext. addToWhiteList()', () => {
-
-  it('White list an address in the collection that does not exist', async () => {
-    await usingApi(async (api) => {
-      // tslint:disable-next-line: no-bitwise
-      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
-      const Bob = privateKey('//Bob');
-
-      const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
-      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
-    });
-  });
-
-  it('White list an address in the collection that was destroyed', async () => {
-    await usingApi(async (api) => {
-      const Alice = privateKey('//Alice');
-      const Bob = privateKey('//Bob');
-      // tslint:disable-next-line: no-bitwise
-      const collectionId = await createCollectionExpectSuccess();
-      await destroyCollectionExpectSuccess(collectionId);
-      const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
-      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
-    });
-  });
-
-  it('White list an address in the collection that does not have white list access enabled', async () => {
-    await usingApi(async (api) => {
-      const Alice = privateKey('//Alice');
-      const Ferdie = privateKey('//Ferdie');
-      const collectionId = await createCollectionExpectSuccess();
-      await enableWhiteListExpectSuccess(Alice, collectionId);
-      await enablePublicMintingExpectSuccess(Alice, collectionId);
-      const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Ferdie.address), 'NFT');
-      await expect(submitTransactionExpectFailAsync(Ferdie, tx)).to.be.rejected;
-    });
-  });
-
-});
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import usingApi, { submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import {
+  addToWhiteListExpectSuccess,
+  createCollectionExpectSuccess,
+  createItemExpectSuccess,
+  destroyCollectionExpectSuccess,
+  enablePublicMintingExpectSuccess,
+  enableWhiteListExpectSuccess,
+  normalizeAccountId,
+} from './util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+describe('Integration Test ext. addToWhiteList()', () => {
+
+  before(async () => {
+    await usingApi(async () => {
+      Alice = privateKey('//Alice');
+      Bob = privateKey('//Bob');
+    });
+  });
+
+  it('Execute the extrinsic with parameters: Collection ID and address to add to the white list', async () => {
+    const collectionId = await createCollectionExpectSuccess();
+    await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+  });
+
+  it('Whitelisted minting: list restrictions', async () => {
+    const collectionId = await createCollectionExpectSuccess();
+    await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+    await enableWhiteListExpectSuccess(Alice, collectionId);
+    await enablePublicMintingExpectSuccess(Alice, collectionId);
+    await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
+  });
+});
+
+describe('Negative Integration Test ext. addToWhiteList()', () => {
+
+  it('White list an address in the collection that does not exist', async () => {
+    await usingApi(async (api) => {
+      // tslint:disable-next-line: no-bitwise
+      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+      const Bob = privateKey('//Bob');
+
+      const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
+      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+    });
+  });
+
+  it('White list an address in the collection that was destroyed', async () => {
+    await usingApi(async (api) => {
+      const Alice = privateKey('//Alice');
+      const Bob = privateKey('//Bob');
+      // tslint:disable-next-line: no-bitwise
+      const collectionId = await createCollectionExpectSuccess();
+      await destroyCollectionExpectSuccess(collectionId);
+      const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(Bob.address));
+      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+    });
+  });
+
+  it('White list an address in the collection that does not have white list access enabled', async () => {
+    await usingApi(async (api) => {
+      const Alice = privateKey('//Alice');
+      const Ferdie = privateKey('//Ferdie');
+      const collectionId = await createCollectionExpectSuccess();
+      await enableWhiteListExpectSuccess(Alice, collectionId);
+      await enablePublicMintingExpectSuccess(Alice, collectionId);
+      const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Ferdie.address), 'NFT');
+      await expect(submitTransactionExpectFailAsync(Ferdie, tx)).to.be.rejected;
+    });
+  });
+
+});
modifiedtests/src/approve.test.tsdiffbeforeafterboth
--- a/tests/src/approve.test.ts
+++ b/tests/src/approve.test.ts
@@ -82,7 +82,7 @@
   let Charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       Alice = privateKey('//Alice');
       Bob = privateKey('//Bob');
       Charlie = privateKey('//Charlie');
modifiedtests/src/block-production.test.tsdiffbeforeafterboth
--- a/tests/src/block-production.test.ts
+++ b/tests/src/block-production.test.ts
@@ -3,14 +3,15 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import usingApi from "./substrate/substrate-api";
-import { expect } from "chai";
-import { ApiPromise } from "@polkadot/api";
+import usingApi from './substrate/substrate-api';
+import { expect } from 'chai';
+import { ApiPromise } from '@polkadot/api';
 
 const BlockTimeMs = 12000;
 const ToleranceMs = 1000;
 
-async function getBlocks(api: ApiPromise): Promise<number[]> {
+/* eslint no-async-promise-executor: "off" */
+function getBlocks(api: ApiPromise): Promise<number[]> {
   return new Promise<number[]>(async (resolve, reject) => {
     const blockNumbers: number[] = [];
     setTimeout(() => reject('Block production test failed due to timeout.'), BlockTimeMs + ToleranceMs);
@@ -27,7 +28,7 @@
 describe('Block Production smoke test', () => {
   it('Node produces new blocks', async () => {
     await usingApi(async (api) => {
-      let blocks: number[] | undefined = await getBlocks(api);
+      const blocks: number[] | undefined = await getBlocks(api);
       expect(blocks[0]).to.be.lessThan(blocks[1]);
     });
   });
modifiedtests/src/burnItem.test.tsdiffbeforeafterboth
--- a/tests/src/burnItem.test.ts
+++ b/tests/src/burnItem.test.ts
@@ -4,16 +4,15 @@
 //
 
 import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
 import { 
   createCollectionExpectSuccess, 
   createItemExpectSuccess,
   getGenericResult,
   destroyCollectionExpectSuccess,
-  normalizeAccountId
+  normalizeAccountId,
 } from './util/helpers';
-import { nullPublicKey } from "./accounts";
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -25,10 +24,10 @@
 
 describe('integration test: ext. burnItem():', () => {
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-      bob = keyring.addFromUri(`//Bob`);
+      alice = keyring.addFromUri('//Alice');
+      bob = keyring.addFromUri('//Bob');
     });
   });
 
@@ -139,10 +138,10 @@
 
 describe('Negative integration test: ext. burnItem():', () => {
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-      bob = keyring.addFromUri(`//Bob`);
+      alice = keyring.addFromUri('//Alice');
+      bob = keyring.addFromUri('//Bob');
     });
   });
 
modifiedtests/src/change-collection-owner.test.tsdiffbeforeafterboth
--- a/tests/src/change-collection-owner.test.ts
+++ b/tests/src/change-collection-owner.test.ts
@@ -6,8 +6,8 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from './substrate/privateKey';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import { createCollectionExpectSuccess, createCollectionExpectFailure, normalizeAccountId } from "./util/helpers";
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import { createCollectionExpectSuccess, normalizeAccountId } from './util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -32,7 +32,7 @@
 });
 
 describe('Negative Integration Test changeCollectionOwner(collection_id, new_owner):', () => {
-  it(`Not owner can't change owner.`, async () => {
+  it('Not owner can\'t change owner.', async () => {
     await usingApi(async api => {
       const collectionId = await createCollectionExpectSuccess();
       const alice = privateKey('//Alice');
@@ -48,7 +48,7 @@
       await createCollectionExpectSuccess();
     });
   });
-  it(`Can't change owner of not existing collection.`, async () => {
+  it('Can\'t change owner of not existing collection.', async () => {
     await usingApi(async api => {
       const collectionId = (1<<32) - 1;
       const alice = privateKey('//Alice');
modifiedtests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/createItemEvent.test.ts
+++ b/tests/src/check-event/createItemEvent.test.ts
@@ -10,7 +10,7 @@
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
 import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
modifiedtests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/createMultipleItemsEvent.test.ts
+++ b/tests/src/check-event/createMultipleItemsEvent.test.ts
@@ -10,7 +10,7 @@
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
 import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
-import { createCollectionExpectSuccess, createItemExpectSuccess, nftEventMessage } from '../util/helpers';
+import { createCollectionExpectSuccess, nftEventMessage } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
modifiedtests/src/collision-tests/admVsOwnerChanges.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/admVsOwnerChanges.test.ts
+++ b/tests/src/collision-tests/admVsOwnerChanges.test.ts
@@ -1,55 +1,50 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
-  createCollectionExpectSuccess,
-  createItemExpectSuccess,
-  setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
-  await usingApi(async () => {
-    Alice = privateKey('//Alice');
-    Bob = privateKey('//Bob');
-    Ferdie = privateKey('//Ferdie');
-  });
-});
-
-describe('Admin vs Owner changes token: ', () => {
-  // tslint:disable-next-line: max-line-length
-  it('The collection admin changes the owner of the token and in the same block the current owner transfers the token to another address ', async () => {
-    await usingApi(async (api) => {
-      const collectionId = await createCollectionExpectSuccess();
-      const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
-      await submitTransactionAsync(Alice, changeAdminTxBob);
-      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
-      const changeAdminTxFerdie = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
-      await submitTransactionAsync(Bob, changeAdminTxFerdie);
-      const itemId = await createItemExpectSuccess(Ferdie, collectionId, 'NFT');
-      //
-      const changeOwner = api.tx.nft.transferFrom(Ferdie.address, Bob.address, collectionId, itemId, 1);
-      const approve = api.tx.nft.approve(Bob.address, collectionId, itemId, 1);
-      const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
-      await Promise.all
-      ([
-        changeOwner.signAndSend(Alice),
-        approve.signAndSend(Bob),
-        sendItem.signAndSend(Ferdie),
-      ]);
-      const itemBefore: any = await api.query.nft.nftItemList(collectionId, itemId);
-      expect(itemBefore.Owner).not.to.be.eq(Bob.address);
-      await timeoutPromise(20000);
-    });
-  });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+  createCollectionExpectSuccess,
+  createItemExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+  await usingApi(async () => {
+    Alice = privateKey('//Alice');
+    Bob = privateKey('//Bob');
+    Ferdie = privateKey('//Ferdie');
+  });
+});
+
+describe('Admin vs Owner changes token: ', () => {
+  // tslint:disable-next-line: max-line-length
+  it('The collection admin changes the owner of the token and in the same block the current owner transfers the token to another address ', async () => {
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess();
+      const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+      await submitTransactionAsync(Alice, changeAdminTxBob);
+      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+      const changeAdminTxFerdie = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
+      await submitTransactionAsync(Bob, changeAdminTxFerdie);
+      const itemId = await createItemExpectSuccess(Ferdie, collectionId, 'NFT');
+      //
+      const changeOwner = api.tx.nft.transferFrom(Ferdie.address, Bob.address, collectionId, itemId, 1);
+      const approve = api.tx.nft.approve(Bob.address, collectionId, itemId, 1);
+      const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
+      await Promise.all([
+        changeOwner.signAndSend(Alice),
+        approve.signAndSend(Bob),
+        sendItem.signAndSend(Ferdie),
+      ]);
+      const itemBefore: any = await api.query.nft.nftItemList(collectionId, itemId);
+      expect(itemBefore.Owner).not.to.be.eq(Bob.address);
+      await timeoutPromise(20000);
+    });
+  });
+});
modifiedtests/src/collision-tests/admVsOwnerData.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/admVsOwnerData.test.ts
+++ b/tests/src/collision-tests/admVsOwnerData.test.ts
@@ -1,54 +1,47 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
-  createCollectionExpectSuccess,
-  createItemExpectSuccess,
-  setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
-  await usingApi(async () => {
-    Alice = privateKey('//Alice');
-    Bob = privateKey('//Bob');
-    Ferdie = privateKey('//Ferdie');
-  });
-});
-
-describe('Admin vs Owner changes the data in the token: ', () => {
-  it('The collection admin changes the data in the token and in the same block the token owner also changes the data in it ', async () => {
-    await usingApi(async (api) => {
-      const AliceData = 1;
-      const BobData = 2;
-      const collectionId = await createCollectionExpectSuccess();
-      const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
-      await submitTransactionAsync(Alice, changeAdminTx);
-      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
-      const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
-      //
-      // tslint:disable-next-line: max-line-length
-      const AliceTx = api.tx.nft.setVariableMetaData(collectionId, itemId, AliceData.toString());
-      // tslint:disable-next-line: max-line-length
-      const BobTx = api.tx.nft.setVariableMetaData(collectionId, itemId, BobData.toString());
-      await Promise.all
-      ([
-        AliceTx.signAndSend(Alice),
-        BobTx.signAndSend(Bob),
-      ]);
-      const item: any = await api.query.nft.nftItemList(collectionId, itemId);
-      expect(item.VariableData).not.to.be.eq(null); // Pseudo-random selection of one of two values
-      await timeoutPromise(20000);
-    });
-  });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+  createCollectionExpectSuccess,
+  createItemExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+before(async () => {
+  await usingApi(async () => {
+    Alice = privateKey('//Alice');
+    Bob = privateKey('//Bob');
+  });
+});
+
+describe('Admin vs Owner changes the data in the token: ', () => {
+  it('The collection admin changes the data in the token and in the same block the token owner also changes the data in it ', async () => {
+    await usingApi(async (api) => {
+      const AliceData = 1;
+      const BobData = 2;
+      const collectionId = await createCollectionExpectSuccess();
+      const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+      await submitTransactionAsync(Alice, changeAdminTx);
+      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+      const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+      //
+      // tslint:disable-next-line: max-line-length
+      const AliceTx = api.tx.nft.setVariableMetaData(collectionId, itemId, AliceData.toString());
+      // tslint:disable-next-line: max-line-length
+      const BobTx = api.tx.nft.setVariableMetaData(collectionId, itemId, BobData.toString());
+      await Promise.all([
+        AliceTx.signAndSend(Alice),
+        BobTx.signAndSend(Bob),
+      ]);
+      const item: any = await api.query.nft.nftItemList(collectionId, itemId);
+      expect(item.VariableData).not.to.be.eq(null); // Pseudo-random selection of one of two values
+      await timeoutPromise(20000);
+    });
+  });
+});
modifiedtests/src/collision-tests/admVsOwnerTake.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/admVsOwnerTake.test.ts
+++ b/tests/src/collision-tests/admVsOwnerTake.test.ts
@@ -1,54 +1,49 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
-  createCollectionExpectSuccess,
-  createItemExpectSuccess,
-  setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
-  await usingApi(async () => {
-    Alice = privateKey('//Alice');
-    Bob = privateKey('//Bob');
-    Ferdie = privateKey('//Ferdie');
-  });
-});
-
-describe('Admin vs Owner take token: ', () => {
-  // tslint:disable-next-line: max-line-length
-  it('The collection admin burns the token and in the same block the token owner performs a transaction on it ', async () => {
-    await usingApi(async (api) => {
-      const collectionId = await createCollectionExpectSuccess();
-      const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
-      await submitTransactionAsync(Alice, changeAdminTx);
-      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
-      const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
-      //
-      const sendItem = api.tx.nft.transfer(Ferdie.address, collectionId, itemId, 1);
-      const burnItem = api.tx.nft.burnItem(collectionId, itemId, 1);
-      await Promise.all
-      ([
-        sendItem.signAndSend(Bob),
-        burnItem.signAndSend(Alice),
-      ]);
-      await timeoutPromise(10000);
-      let itemBurn: boolean = false;
-      itemBurn = (await (api.query.nft.nftItemList(collectionId, itemId))).toJSON() as boolean;
-      // tslint:disable-next-line: no-unused-expression
-      expect(itemBurn).to.be.null;
-      await timeoutPromise(20000);
-    });
-  });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+  createCollectionExpectSuccess,
+  createItemExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+  await usingApi(async () => {
+    Alice = privateKey('//Alice');
+    Bob = privateKey('//Bob');
+    Ferdie = privateKey('//Ferdie');
+  });
+});
+
+describe('Admin vs Owner take token: ', () => {
+  // tslint:disable-next-line: max-line-length
+  it('The collection admin burns the token and in the same block the token owner performs a transaction on it ', async () => {
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess();
+      const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+      await submitTransactionAsync(Alice, changeAdminTx);
+      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+      const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+      //
+      const sendItem = api.tx.nft.transfer(Ferdie.address, collectionId, itemId, 1);
+      const burnItem = api.tx.nft.burnItem(collectionId, itemId, 1);
+      await Promise.all([
+        sendItem.signAndSend(Bob),
+        burnItem.signAndSend(Alice),
+      ]);
+      await timeoutPromise(10000);
+      let itemBurn = false;
+      itemBurn = (await (api.query.nft.nftItemList(collectionId, itemId))).toJSON() as boolean;
+      // tslint:disable-next-line: no-unused-expression
+      expect(itemBurn).to.be.null;
+      await timeoutPromise(20000);
+    });
+  });
+});
modifiedtests/src/collision-tests/adminDestroyCollection.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminDestroyCollection.test.ts
+++ b/tests/src/collision-tests/adminDestroyCollection.test.ts
@@ -1,35 +1,23 @@
 import { IKeyringPair } from '@polkadot/types/types';
-import BN from 'bn.js';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
 import {
   createCollectionExpectSuccess,
 } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
-interface ITokenDataType {
-  Owner: number[];
-  ConstData: number[];
-  VariableData: number[];
-}
 let Alice: IKeyringPair;
 let Bob: IKeyringPair;
 let Ferdie: IKeyringPair;
-let Charlie: IKeyringPair;
-let Eve: IKeyringPair;
-let Dave: IKeyringPair;
 
 before(async () => {
   await usingApi(async () => {
     Alice = privateKey('//Alice');
     Bob = privateKey('//Bob');
     Ferdie = privateKey('//Ferdie');
-    Charlie = privateKey('//Charlie');
-    Eve = privateKey('//Eve');
-    Dave = privateKey('//Dave');
   });
 });
 
@@ -45,13 +33,12 @@
       //
       const addWhitelistAdm = api.tx.nft.addToWhiteList(collectionId, Ferdie.address);
       const destroyCollection = api.tx.nft.destroyCollection(collectionId);
-      await Promise.all
-      ([
+      await Promise.all([
         addWhitelistAdm.signAndSend(Bob),
         destroyCollection.signAndSend(Alice),
       ]);
       await timeoutPromise(10000);
-      let whiteList: boolean = false;
+      let whiteList = false;
       whiteList = (await api.query.nft.whiteList(collectionId, Ferdie.address)).toJSON() as boolean;
       // tslint:disable-next-line: no-unused-expression
       expect(whiteList).to.be.false;
modifiedtests/src/collision-tests/adminLimitsOff.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminLimitsOff.test.ts
+++ b/tests/src/collision-tests/adminLimitsOff.test.ts
@@ -10,11 +10,6 @@
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
-interface ITokenDataType {
-  Owner: number[];
-  ConstData: number[];
-  VariableData: number[];
-}
 let Alice: IKeyringPair;
 let Bob: IKeyringPair;
 let Ferdie: IKeyringPair;
@@ -51,11 +46,9 @@
       await submitTransactionAsync(Alice, changeAdminTx3);
 
       const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
-      //
       const addAdmOne = api.tx.nft.addCollectionAdmin(collectionId, Ferdie.address);
       const addAdmTwo = api.tx.nft.addCollectionAdmin(collectionId, Charlie.address);
-      await Promise.all
-      ([
+      await Promise.all([
         addAdmOne.signAndSend(Bob),
         addAdmTwo.signAndSend(Alice),
       ]);
modifiedtests/src/collision-tests/adminRightsOff.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminRightsOff.test.ts
+++ b/tests/src/collision-tests/adminRightsOff.test.ts
@@ -3,33 +3,20 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
 import {
   createCollectionExpectSuccess,
 } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
-interface ITokenDataType {
-  Owner: number[];
-  ConstData: number[];
-  VariableData: number[];
-}
 let Alice: IKeyringPair;
 let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-let Charlie: IKeyringPair;
-let Eve: IKeyringPair;
-let Dave: IKeyringPair;
 
 before(async () => {
   await usingApi(async () => {
     Alice = privateKey('//Alice');
     Bob = privateKey('//Bob');
-    Ferdie = privateKey('//Ferdie');
-    Charlie = privateKey('//Charlie');
-    Eve = privateKey('//Eve');
-    Dave = privateKey('//Dave');
   });
 });
 
@@ -42,12 +29,10 @@
       await submitTransactionAsync(Alice, changeAdminTx);
       const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
       await timeoutPromise(10000);
-      //
       const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
       const addItemAdm = api.tx.nft.createMultipleItems(collectionId, Bob.address, args);
       const removeAdm = api.tx.nft.removeCollectionAdmin(collectionId, Bob.address);
-      await Promise.all
-      ([
+      await Promise.all([
         addItemAdm.signAndSend(Bob),
         removeAdm.signAndSend(Alice),
       ]);
modifiedtests/src/collision-tests/setSponsorNewOwner.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/setSponsorNewOwner.test.ts
+++ b/tests/src/collision-tests/setSponsorNewOwner.test.ts
@@ -1,20 +1,14 @@
 import { IKeyringPair } from '@polkadot/types/types';
-import BN from 'bn.js';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import usingApi from '../substrate/substrate-api';
 import {
-  createCollectionExpectSuccess, createItemExpectSuccess, setCollectionSponsorExpectSuccess,
+  createCollectionExpectSuccess, setCollectionSponsorExpectSuccess,
 } from '../util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
-interface ITokenDataType {
-  Owner: number[];
-  ConstData: number[];
-  VariableData: number[];
-}
 let Alice: IKeyringPair;
 let Bob: IKeyringPair;
 let Ferdie: IKeyringPair;
@@ -35,11 +29,9 @@
       await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
       const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
       await timeoutPromise(10000);
-      //
       const confirmSponsorship = api.tx.nft.confirmSponsorship(collectionId);
       const changeCollectionOwner = api.tx.nft.changeCollectionOwner(collectionId, Ferdie.address);
-      await Promise.all
-      ([
+      await Promise.all([
         confirmSponsorship.signAndSend(Bob),
         changeCollectionOwner.signAndSend(Alice),
       ]);
modifiedtests/src/collision-tests/sponsorPayments.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/sponsorPayments.test.ts
+++ b/tests/src/collision-tests/sponsorPayments.test.ts
@@ -1,58 +1,54 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import { alicesPublicKey, bobsPublicKey } from '../accounts';
-import getBalance from '../substrate/get-balance';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
-  confirmSponsorshipExpectSuccess,
-  createCollectionExpectSuccess,
-  createItemExpectSuccess,
-  setCollectionSponsorExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
-  await usingApi(async () => {
-    Alice = privateKey('//Alice');
-    Bob = privateKey('//Bob');
-    Ferdie = privateKey('//Ferdie');
-  });
-});
-
-describe('Payment of commission if one block: ', () => {
-  // tslint:disable-next-line: max-line-length
-  it('Payment of commission if one block contains transactions for payment from the sponsor\'s balance and his (sponsor\'s) exclusion from the collection ', async () => {
-    await usingApi(async (api) => {
-      const collectionId = await createCollectionExpectSuccess();
-      const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
-      await submitTransactionAsync(Alice, changeAdminTxBob);
-      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
-      const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
-      await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
-      await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
-      //
-      const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
-      const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
-      const revokeSponsor = api.tx.nft.removeCollectionSponsor(collectionId);
-      await Promise.all
-      ([
-        sendItem.signAndSend(Bob),
-        revokeSponsor.signAndSend(Alice),
-      ]);
-      const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
-      // tslint:disable-next-line:no-unused-expression
-      expect(alicesBalanceAfter === alicesBalanceBefore).to.be.true;
-      // tslint:disable-next-line:no-unused-expression
-      expect(bobsBalanceAfter === bobsBalanceBefore).to.be.true;
-      await timeoutPromise(20000);
-    });
-  });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import { alicesPublicKey, bobsPublicKey } from '../accounts';
+import getBalance from '../substrate/get-balance';
+import privateKey from '../substrate/privateKey';
+import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
+import {
+  confirmSponsorshipExpectSuccess,
+  createCollectionExpectSuccess,
+  createItemExpectSuccess,
+  setCollectionSponsorExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+before(async () => {
+  await usingApi(async () => {
+    Alice = privateKey('//Alice');
+    Bob = privateKey('//Bob');
+  });
+});
+
+describe('Payment of commission if one block: ', () => {
+  // tslint:disable-next-line: max-line-length
+  it('Payment of commission if one block contains transactions for payment from the sponsor\'s balance and his (sponsor\'s) exclusion from the collection ', async () => {
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess();
+      const changeAdminTxBob = api.tx.nft.addCollectionAdmin(collectionId, Bob.address);
+      await submitTransactionAsync(Alice, changeAdminTxBob);
+      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+      const itemId = await createItemExpectSuccess(Bob, collectionId, 'NFT');
+      await setCollectionSponsorExpectSuccess(collectionId, Bob.address);
+      await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
+
+      const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+      const sendItem = api.tx.nft.transfer(Alice.address, collectionId, itemId, 1);
+      const revokeSponsor = api.tx.nft.removeCollectionSponsor(collectionId);
+      await Promise.all([
+        sendItem.signAndSend(Bob),
+        revokeSponsor.signAndSend(Alice),
+      ]);
+      const [alicesBalanceAfter, bobsBalanceAfter] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
+      // tslint:disable-next-line:no-unused-expression
+      expect(alicesBalanceAfter === alicesBalanceBefore).to.be.true;
+      // tslint:disable-next-line:no-unused-expression
+      expect(bobsBalanceAfter === bobsBalanceBefore).to.be.true;
+      await timeoutPromise(20000);
+    });
+  });
+});
modifiedtests/src/collision-tests/tokenLimitsOff.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/tokenLimitsOff.test.ts
+++ b/tests/src/collision-tests/tokenLimitsOff.test.ts
@@ -13,11 +13,6 @@
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
-interface ITokenDataType {
-  Owner: number[];
-  ConstData: number[];
-  VariableData: number[];
-}
 let Alice: IKeyringPair;
 let Bob: IKeyringPair;
 let Ferdie: IKeyringPair;
@@ -63,14 +58,13 @@
       expect(subTxTesult.success).to.be.true;
       const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
       await timeoutPromise(10000);
-      //
+
       const args = [{ nft: ['0x31', '0x31'] }, { nft: ['0x32', '0x32'] }, { nft: ['0x33', '0x33'] }];
       const mintItemOne = api.tx.nft
         .createMultipleItems(collectionId, Ferdie.address, args);
       const mintItemTwo = api.tx.nft
         .createMultipleItems(collectionId, Bob.address, args);
-      await Promise.all
-      ([
+      await Promise.all([
         mintItemOne.signAndSend(Ferdie),
         mintItemTwo.signAndSend(Bob),
       ]);
modifiedtests/src/collision-tests/turnsOffMinting.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/turnsOffMinting.test.ts
+++ b/tests/src/collision-tests/turnsOffMinting.test.ts
@@ -1,50 +1,46 @@
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import privateKey from '../substrate/privateKey';
-import usingApi, { submitTransactionAsync } from '../substrate/substrate-api';
-import waitNewBlocks from '../substrate/wait-new-blocks';
-import {
-  addToWhiteListExpectSuccess,
-  createCollectionExpectSuccess,
-  setMintPermissionExpectSuccess,
-} from '../util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-let Ferdie: IKeyringPair;
-
-before(async () => {
-  await usingApi(async () => {
-    Alice = privateKey('//Alice');
-    Bob = privateKey('//Bob');
-    Ferdie = privateKey('//Ferdie');
-  });
-});
-
-describe('Turns off minting mode: ', () => {
-  // tslint:disable-next-line: max-line-length
-  it('The collection owner turns off minting mode and there are minting transactions in the same block ', async () => {
-    await usingApi(async (api) => {
-      const collectionId = await createCollectionExpectSuccess();
-      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
-      await setMintPermissionExpectSuccess(Alice, collectionId, true);
-      await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
-      //
-      const mintItem = api.tx.nft.createItem(collectionId, Ferdie.address, 'NFT');
-      const offMinting = api.tx.nft.setMintPermission(collectionId, false);
-      await Promise.all
-      ([
-        mintItem.signAndSend(Ferdie),
-        offMinting.signAndSend(Alice),
-      ]);
-      let itemList: boolean = false;
-      itemList = (await (api.query.nft.nftItemList(collectionId, mintItem))).toJSON() as boolean;
-      // tslint:disable-next-line: no-unused-expression
-      expect(itemList).to.be.null;
-      await timeoutPromise(20000);
-    });
-  });
-});
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from '../substrate/privateKey';
+import usingApi from '../substrate/substrate-api';
+import {
+  addToWhiteListExpectSuccess,
+  createCollectionExpectSuccess,
+  setMintPermissionExpectSuccess,
+} from '../util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+let Alice: IKeyringPair;
+let Ferdie: IKeyringPair;
+
+before(async () => {
+  await usingApi(async () => {
+    Alice = privateKey('//Alice');
+    Ferdie = privateKey('//Ferdie');
+  });
+});
+
+describe('Turns off minting mode: ', () => {
+  // tslint:disable-next-line: max-line-length
+  it('The collection owner turns off minting mode and there are minting transactions in the same block ', async () => {
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess();
+      const timeoutPromise = (timeout: number) => new Promise((resolve) => setTimeout(resolve, timeout));
+      await setMintPermissionExpectSuccess(Alice, collectionId, true);
+      await addToWhiteListExpectSuccess(Alice, collectionId, Ferdie.address);
+
+      const mintItem = api.tx.nft.createItem(collectionId, Ferdie.address, 'NFT');
+      const offMinting = api.tx.nft.setMintPermission(collectionId, false);
+      await Promise.all([
+        mintItem.signAndSend(Ferdie),
+        offMinting.signAndSend(Alice),
+      ]);
+      let itemList = false;
+      itemList = (await (api.query.nft.nftItemList(collectionId, mintItem))).toJSON() as boolean;
+      // tslint:disable-next-line: no-unused-expression
+      expect(itemList).to.be.null;
+      await timeoutPromise(20000);
+    });
+  });
+});
modifiedtests/src/config.tsdiffbeforeafterboth
--- a/tests/src/config.ts
+++ b/tests/src/config.ts
@@ -6,7 +6,7 @@
 import process from 'process';
 
 const config = {
-  substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9844'
-}
+  substrateUrl: process.env.substrateUrl || 'ws://127.0.0.1:9844',
+};
 
 export default config;
\ No newline at end of file
modifiedtests/src/config_docker.tsdiffbeforeafterboth
--- a/tests/src/config_docker.ts
+++ b/tests/src/config_docker.ts
@@ -6,7 +6,7 @@
 import process from 'process';
 
 const config = {
-  substrateUrl: process.env.substrateUrl || 'ws://172.17.0.1:9944'
-}
+  substrateUrl: process.env.substrateUrl || 'ws://172.17.0.1:9944',
+};
 
 export default config;
\ No newline at end of file
modifiedtests/src/confirmSponsorship.test.tsdiffbeforeafterboth
--- a/tests/src/confirmSponsorship.test.ts
+++ b/tests/src/confirmSponsorship.test.ts
@@ -5,12 +5,11 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
 import { 
   createCollectionExpectSuccess, 
   setCollectionSponsorExpectSuccess, 
   destroyCollectionExpectSuccess, 
-  setCollectionSponsorExpectFailure,
   confirmSponsorshipExpectSuccess,
   confirmSponsorshipExpectFailure,
   createItemExpectSuccess,
@@ -20,10 +19,9 @@
   enablePublicMintingExpectSuccess,
   addToWhiteListExpectSuccess,
   normalizeAccountId,
-} from "./util/helpers";
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
-import type { AccountId } from '@polkadot/types/interfaces';
+} from './util/helpers';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
 import { BigNumber } from 'bignumber.js';
 
 chai.use(chaiAsPromised);
@@ -36,11 +34,11 @@
 describe('integration test: ext. confirmSponsorship():', () => {
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-      bob = keyring.addFromUri(`//Bob`);
-      charlie = keyring.addFromUri(`//Charlie`);
+      alice = keyring.addFromUri('//Alice');
+      bob = keyring.addFromUri('//Bob');
+      charlie = keyring.addFromUri('//Charlie');
     });
   });
 
@@ -163,7 +161,7 @@
       await addToWhiteListExpectSuccess(alice, collectionId, zeroBalance.address);
 
       // Mint token using unused address as signer
-      const tokenId = await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address);
+      await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address);
 
       const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
 
@@ -195,7 +193,7 @@
       const badTransaction = async function () { 
         await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
       };
-      await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+      await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
       const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
 
       // Try again after Zero gets some balance - now it should succeed
@@ -228,11 +226,7 @@
       const result1 = getGenericResult(events1);
 
       const AsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
-
-      const badTransaction = async function () { 
-        await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
-      };
-
+      await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
       const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
 
       // Try again after Zero gets some balance - now it should succeed
@@ -271,7 +265,7 @@
       const badTransaction = async function () { 
         await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
       };
-      await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+      await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
       const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
 
       // Try again after Zero gets some balance - now it should succeed
@@ -317,7 +311,7 @@
       const badTransaction = async function () { 
         await createItemExpectSuccess(zeroBalance, collectionId, 'NFT', zeroBalance.address);
       };
-      await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+      await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
       console.error = consoleError;
       console.log = consoleLog;
       const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
@@ -335,19 +329,19 @@
 
 describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-      bob = keyring.addFromUri(`//Bob`);
-      charlie = keyring.addFromUri(`//Charlie`);
+      alice = keyring.addFromUri('//Alice');
+      bob = keyring.addFromUri('//Bob');
+      charlie = keyring.addFromUri('//Charlie');
     });
   });
 
   it('(!negative test!) Confirm sponsorship for a collection that never existed', async () => {
     // Find the collection that never existed
-    const collectionId = 0;
+    let collectionId = 0;
     await usingApi(async (api) => {
-      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+      collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
     });
 
     await confirmSponsorshipExpectFailure(collectionId, '//Bob');
modifiedtests/src/connection.test.tsdiffbeforeafterboth
--- a/tests/src/connection.test.ts
+++ b/tests/src/connection.test.ts
@@ -3,7 +3,7 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import usingApi from "./substrate/substrate-api";
+import usingApi from './substrate/substrate-api';
 import { WsProvider } from '@polkadot/api';
 import * as chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
@@ -29,7 +29,7 @@
     const neverConnectProvider = new WsProvider('ws://255.255.255.255:9944');
     await expect((async () => {
       await usingApi(async api => {
-        const health = await api.rpc.system.health();
+        await api.rpc.system.health();
       }, { provider: neverConnectProvider });
     })()).to.be.eventually.rejected;
 
modifiedtests/src/contracts.test.tsdiffbeforeafterboth
--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -3,17 +3,17 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import chai from "chai";
+import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import fs from "fs";
-import { Abi, ContractPromise as Contract } from "@polkadot/api-contract";
-import privateKey from "./substrate/privateKey";
+import usingApi, { submitTransactionAsync } from './substrate/substrate-api';
+import fs from 'fs';
+import { Abi, ContractPromise as Contract } from '@polkadot/api-contract';
+import privateKey from './substrate/privateKey';
 import {
   deployFlipper,
   getFlipValue,
   deployTransferContract,
-} from "./util/contracthelpers";
+} from './util/contracthelpers';
 
 import {
   addToWhiteListExpectSuccess,
@@ -25,8 +25,8 @@
   getGenericResult,
   normalizeAccountId,
   isWhitelisted,
-  transferFromExpectSuccess
-} from "./util/helpers";
+  transferFromExpectSuccess,
+} from './util/helpers';
 
 
 chai.use(chaiAsPromised);
@@ -37,12 +37,12 @@
 const marketContractAddress = '5CYN9j3YvRkqxewoxeSvRbhAym4465C57uMmX5j4yz99L5H6';
 
 describe('Contracts', () => {
-  it(`Can deploy smart contract Flipper, instantiate it and call it's get and flip messages.`, async () => {
+  it('Can deploy smart contract Flipper, instantiate it and call it\'s get and flip messages.', async () => {
     await usingApi(async api => {
       const [contract, deployer] = await deployFlipper(api);
       const initialGetResponse = await getFlipValue(contract, deployer);
 
-      const bob = privateKey("//Bob");
+      const bob = privateKey('//Bob');
       const flip = contract.tx.flip(value, gasLimit);
       await submitTransactionAsync(bob, flip);
 
@@ -65,13 +65,13 @@
 describe.only('Chain extensions', () => {
   it('Transfer CE', async () => {
     await usingApi(async api => {
-      const alice = privateKey("//Alice");
-      const bob = privateKey("//Bob");
+      const alice = privateKey('//Alice');
+      const bob = privateKey('//Bob');
 
       // Prep work
       const collectionId = await createCollectionExpectSuccess();
       const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT');
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, contract.address);
       await submitTransactionAsync(alice, changeAdminTx);
 
@@ -96,7 +96,7 @@
       const bob = privateKey('//Bob');
 
       const collectionId = await createCollectionExpectSuccess();
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       await enablePublicMintingExpectSuccess(alice, collectionId);
       await enableWhiteListExpectSuccess(alice, collectionId);
       await addToWhiteListExpectSuccess(alice, collectionId, contract.address);
@@ -124,7 +124,7 @@
       const bob = privateKey('//Bob');
 
       const collectionId = await createCollectionExpectSuccess();
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       await enablePublicMintingExpectSuccess(alice, collectionId);
       await enableWhiteListExpectSuccess(alice, collectionId);
       await addToWhiteListExpectSuccess(alice, collectionId, contract.address);
@@ -133,7 +133,7 @@
       const transferTx = contract.tx.createMultipleItems(value, gasLimit, bob.address, collectionId, [
         { Nft: { const_data: '0x010203', variable_data: '0x020304' } },
         { Nft: { const_data: '0x010204', variable_data: '0x020305' } },
-        { Nft: { const_data: '0x010205', variable_data: '0x020306' } }
+        { Nft: { const_data: '0x010205', variable_data: '0x020306' } },
       ]);
       const events = await submitTransactionAsync(alice, transferTx);
       const result = getGenericResult(events);
@@ -169,7 +169,7 @@
       const charlie = privateKey('//Charlie');
 
       const collectionId = await createCollectionExpectSuccess();
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', contract.address.toString());
 
       const transferTx = contract.tx.approve(value, gasLimit, bob.address, collectionId, tokenId, 1);
@@ -188,7 +188,7 @@
       const charlie = privateKey('//Charlie');
 
       const collectionId = await createCollectionExpectSuccess();
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);
       await approveExpectSuccess(collectionId, tokenId, bob, contract.address.toString(), 1);
 
@@ -197,7 +197,7 @@
       const result = getGenericResult(events);
       expect(result.success).to.be.true;
 
-      const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap()
+      const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap();
       expect(token.Owner.toString()).to.be.equal(charlie.address);
     });
   });
@@ -207,7 +207,7 @@
       const alice = privateKey('//Alice');
 
       const collectionId = await createCollectionExpectSuccess();
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', contract.address.toString());
 
       const transferTx = contract.tx.setVariableMetaData(value, gasLimit, collectionId, tokenId, '0x121314');
@@ -215,7 +215,7 @@
       const result = getGenericResult(events);
       expect(result.success).to.be.true;
 
-      const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap()
+      const token: any = (await api.query.nft.nftItemList(collectionId, tokenId) as any).unwrap();
       expect(token.VariableData.toString()).to.be.equal('0x121314');
     });
   });
@@ -226,7 +226,7 @@
       const bob = privateKey('//Bob');
 
       const collectionId = await createCollectionExpectSuccess();
-      const [contract, deployer] = await deployTransferContract(api);
+      const [contract] = await deployTransferContract(api);
       const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, contract.address);
       await submitTransactionAsync(alice, changeAdminTx);      
 
modifiedtests/src/createItem.test.tsdiffbeforeafterboth
--- a/tests/src/createItem.test.ts
+++ b/tests/src/createItem.test.ts
@@ -1,39 +1,39 @@
-//
-// This file is subject to the terms and conditions defined in
-// file 'LICENSE', which is part of this source code package.
-//
-
-import { default as usingApi } from './substrate/substrate-api';
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
-import { 
-  createCollectionExpectSuccess, 
-  createItemExpectSuccess
-} from './util/helpers';
-
-let alice: IKeyringPair;
-
-describe('integration test: ext. createItem():', () => {
-  before(async () => {
-    await usingApi(async (api) => {
-      const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-    });
-  });
-
-  it('Create new item in NFT collection', async () => {
-    const createMode = 'NFT';
-    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
-    await createItemExpectSuccess(alice, newCollectionID, createMode);
-  });
-  it('Create new item in Fungible collection', async () => {
-    const createMode = 'Fungible';
-    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}});
-    await createItemExpectSuccess(alice, newCollectionID, createMode);
-  });
-  it('Create new item in ReFungible collection', async () => {
-    const createMode = 'ReFungible';
-    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
-    await createItemExpectSuccess(alice, newCollectionID, createMode);
-  });
-});
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { default as usingApi } from './substrate/substrate-api';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
+import { 
+  createCollectionExpectSuccess, 
+  createItemExpectSuccess,
+} from './util/helpers';
+
+let alice: IKeyringPair;
+
+describe('integration test: ext. createItem():', () => {
+  before(async () => {
+    await usingApi(async () => {
+      const keyring = new Keyring({ type: 'sr25519' });
+      alice = keyring.addFromUri('//Alice');
+    });
+  });
+
+  it('Create new item in NFT collection', async () => {
+    const createMode = 'NFT';
+    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
+    await createItemExpectSuccess(alice, newCollectionID, createMode);
+  });
+  it('Create new item in Fungible collection', async () => {
+    const createMode = 'Fungible';
+    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}});
+    await createItemExpectSuccess(alice, newCollectionID, createMode);
+  });
+  it('Create new item in ReFungible collection', async () => {
+    const createMode = 'ReFungible';
+    const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
+    await createItemExpectSuccess(alice, newCollectionID, createMode);
+  });
+});
modifiedtests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth
--- a/tests/src/creditFeesToTreasury.test.ts
+++ b/tests/src/creditFeesToTreasury.test.ts
@@ -5,16 +5,16 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import { alicesPublicKey, bobsPublicKey } from "./accounts";
-import privateKey from "./substrate/privateKey";
+import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import { alicesPublicKey, bobsPublicKey } from './accounts';
+import privateKey from './substrate/privateKey';
 import { BigNumber } from 'bignumber.js';
 import { IKeyringPair } from '@polkadot/types/types';
 import { 
   createCollectionExpectSuccess, 
   createItemExpectSuccess,
   getGenericResult,
-  transferExpectSuccess
+  transferExpectSuccess,
 } from './util/helpers';
 
 import { default as waitNewBlocks } from './substrate/wait-new-blocks';
@@ -23,7 +23,7 @@
 chai.use(chaiAsPromised);
 const expect = chai.expect;
 
-const Treasury = "5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z";
+const Treasury = '5EYCAe5ijiYfyeZ2JJCGq56LmPyNRAKzpG4QkoQkkQNB5e6Z';
 const saneMinimumFee = 0.05;
 const saneMaximumFee = 0.5;
 const createCollectionDeposit = 100;
@@ -33,8 +33,9 @@
 
 // Skip the inflation block pauses if the block is close to inflation block 
 // until the inflation happens
+/*eslint no-async-promise-executor: "off"*/
 function skipInflationBlock(api: ApiPromise): Promise<void> {
-  const promise = new Promise<void>(async (resolve, reject) => {
+  const promise = new Promise<void>(async (resolve) => {
     const blockInterval = parseInt((await api.consts.inflation.inflationBlockInterval).toString());
     const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
       const currentBlock = parseInt(head.number.toString());
@@ -52,7 +53,7 @@
 
 describe('integration test: Fees must be credited to Treasury:', () => {
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       alice = privateKey('//Alice');
       bob = privateKey('//Bob');
     });
modifiedtests/src/destroyCollection.test.tsdiffbeforeafterboth
--- a/tests/src/destroyCollection.test.ts
+++ b/tests/src/destroyCollection.test.ts
@@ -7,8 +7,8 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from './substrate/privateKey';
-import { default as usingApi } from "./substrate/substrate-api";
-import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure, setCollectionLimitsExpectSuccess } from "./util/helpers";
+import { default as usingApi } from './substrate/substrate-api';
+import { createCollectionExpectSuccess, destroyCollectionExpectSuccess, destroyCollectionExpectFailure, setCollectionLimitsExpectSuccess } from './util/helpers';
 
 chai.use(chaiAsPromised);
 
@@ -31,7 +31,7 @@
   let alice: IKeyringPair;
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       alice = privateKey('//Alice');
     });
   });
modifiedtests/src/enableContractSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/enableContractSponsoring.test.ts
+++ b/tests/src/enableContractSponsoring.test.ts
@@ -81,7 +81,7 @@
 
   it('fails when called by non-owning user', async () => {
     await usingApi(async (api) => {
-      const [flipper, _] = await deployFlipper(api);
+      const [flipper] = await deployFlipper(api);
 
       await enableContractSponsoringExpectFailure(alice, flipper.address, true);
     });
modifiedtests/src/eth/fungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -1,289 +1,294 @@
-import privateKey from "../substrate/privateKey";
-import { approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from "../util/helpers";
-import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from "./util/helpers"
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import privateKey from '../substrate/privateKey';
+import { approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from '../util/helpers';
+import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from './util/helpers';
 import fungibleAbi from './fungibleAbi.json';
-import { expect } from "chai";
+import { expect } from 'chai';
 
 describe('Information getting', () => {
-    itWeb3('totalSupply', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            name: 'token name',
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
+  itWeb3('totalSupply', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: { type: 'Fungible', decimalPoints: 0 },
+    });
+    const alice = privateKey('//Alice');
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address });
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { substrate: alice.address });
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
-        const totalSupply = await contract.methods.totalSupply().call();
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    const totalSupply = await contract.methods.totalSupply().call();
+
+    // FIXME: always equals to 0, because this method is not implemented
+    expect(totalSupply).to.equal('0');
+  });
 
-        // FIXME: always equals to 0, because this method is not implemented
-        expect(totalSupply).to.equal('0');
+  itWeb3('balanceOf', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: { type: 'Fungible', decimalPoints: 0 },
     });
+    const alice = privateKey('//Alice');
 
-    itWeb3('balanceOf', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            name: 'token name',
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
+    const caller = createEthAccount(web3);
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: caller });
 
-        const caller = createEthAccount(web3);
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: caller });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    const balance = await contract.methods.balanceOf(caller).call();
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
-        const balance = await contract.methods.balanceOf(caller).call();
-
-        expect(balance).to.equal('200');
-    });
+    expect(balance).to.equal('200');
+  });
 });
 
 describe('Plain calls', () => {
-    itWeb3('Can perform approve()', async ({ web3, api }) => {
-        const collection = await createCollectionExpectSuccess({
-            name: 'token name',
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
+  itWeb3('Can perform approve()', async ({ web3, api }) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: { type: 'Fungible', decimalPoints: 0 },
+    });
+    const alice = privateKey('//Alice');
 
-        const owner = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, owner, 999999999999999);
+    const owner = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, owner, 999999999999999);
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
 
-        const spender = createEthAccount(web3);
+    const spender = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
+
+    {
+      const result = await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+      const events = normalizeEvents(result.events);
 
+      expect(events).to.be.deep.equal([
         {
-            const result = await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
-            const events = normalizeEvents(result.events);
+          address,
+          event: 'Approval',
+          args: {
+            owner,
+            spender,
+            value: '100',
+          },
+        },
+      ]);
+    }
 
-            expect(events).to.be.deep.equal([
-                {
-                    address,
-                    event: 'Approval',
-                    args: {
-                        owner,
-                        spender,
-                        value: '100',
-                    }
-                }
-            ]);
-        }
+    {
+      const allowance = await contract.methods.allowance(owner, spender).call();
+      expect(+allowance).to.equal(100);
+    }
+  });
 
-        {
-            const allowance = await contract.methods.allowance(owner, spender).call();
-            expect(+allowance).to.equal(100);
-        }
+  itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: { type: 'Fungible', decimalPoints: 0 },
     });
+    const alice = privateKey('//Alice');
 
-    itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
-        const collection = await createCollectionExpectSuccess({
-            name: 'token name',
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
-
-        const owner = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, owner, 999999999999999);
+    const owner = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, owner, 999999999999999);
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
 
-        const spender = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, spender, 999999999999999);
+    const spender = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, spender, 999999999999999);
 
-        const receiver = createEthAccount(web3);
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
 
-        await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+    await contract.methods.approve(spender, 100).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
 
+    {
+      const result = await contract.methods.transferFrom(owner, receiver, 49).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
+      const events = normalizeEvents(result.events);
+      expect(events).to.be.deep.equal([
         {
-            const result = await contract.methods.transferFrom(owner, receiver, 49).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
-            const events = normalizeEvents(result.events);
-            expect(events).to.be.deep.equal([
-                {
-                    address,
-                    event: 'Transfer',
-                    args: {
-                        from: owner,
-                        to: receiver,
-                        value: '49',
-                    }
-                },
-                {
-                    address,
-                    event: 'Approval',
-                    args: {
-                        owner,
-                        spender,
-                        value: '51',
-                    }
-                }
-            ]);
-        }
-
+          address,
+          event: 'Transfer',
+          args: {
+            from: owner,
+            to: receiver,
+            value: '49',
+          },
+        },
         {
-            const balance = await contract.methods.balanceOf(receiver).call();
-            expect(+balance).to.equal(49);
-        }
+          address,
+          event: 'Approval',
+          args: {
+            owner,
+            spender,
+            value: '51',
+          },
+        },
+      ]);
+    }
 
-        {
-            const balance = await contract.methods.balanceOf(owner).call();
-            expect(+balance).to.equal(151);
-        }
-    });
+    {
+      const balance = await contract.methods.balanceOf(receiver).call();
+      expect(+balance).to.equal(49);
+    }
 
-    itWeb3('Can perform transfer()', async ({ web3, api }) => {
-        const collection = await createCollectionExpectSuccess({
-            name: 'token name',
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
+    {
+      const balance = await contract.methods.balanceOf(owner).call();
+      expect(+balance).to.equal(151);
+    }
+  });
 
-        const owner = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, owner, 999999999999999);
+  itWeb3('Can perform transfer()', async ({ web3, api }) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: { type: 'Fungible', decimalPoints: 0 },
+    });
+    const alice = privateKey('//Alice');
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
+    const owner = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, owner, 999999999999999);
 
-        const receiver = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, receiver, 999999999999999);
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n }, { ethereum: owner });
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    const receiver = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, receiver, 999999999999999);
 
-        {
-            const result = await contract.methods.transfer(receiver, 50).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
-            const events = normalizeEvents(result.events);
-            expect(events).to.be.deep.equal([
-                {
-                    address,
-                    event: 'Transfer',
-                    args: {
-                        from: owner,
-                        to: receiver,
-                        value: '50',
-                    }
-                },
-            ])
-        }
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
 
+    {
+      const result = await contract.methods.transfer(receiver, 50).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+      const events = normalizeEvents(result.events);
+      expect(events).to.be.deep.equal([
         {
-            const balance = await contract.methods.balanceOf(owner).call();
-            expect(+balance).to.equal(150);
-        }
+          address,
+          event: 'Transfer',
+          args: {
+            from: owner,
+            to: receiver,
+            value: '50',
+          },
+        },
+      ]);
+    }
+
+    {
+      const balance = await contract.methods.balanceOf(owner).call();
+      expect(+balance).to.equal(150);
+    }
 
-        {
-            const balance = await contract.methods.balanceOf(receiver).call();
-            expect(+balance).to.equal(50);
-        }
-    });
+    {
+      const balance = await contract.methods.balanceOf(receiver).call();
+      expect(+balance).to.equal(50);
+    }
+  });
 });
 
 describe('Substrate calls', () => {
-    itWeb3('Events emitted for approve()', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
-
-        const receiver = createEthAccount(web3);
+  itWeb3('Events emitted for approve()', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'Fungible', decimalPoints: 0 },
+    });
+    const alice = privateKey('//Alice');
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
 
-        const events = await recordEvents(contract, async () => {
-            await approveExpectSuccess(collection, 1, alice, { ethereum: receiver }, 100);
-        });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
 
-        expect(events).to.be.deep.equal([
-            {
-                address,
-                event: 'Approval',
-                args: {
-                    owner: subToEth(alice.address),
-                    spender: receiver,
-                    value: '100',
-                }
-            }
-        ]);
+    const events = await recordEvents(contract, async () => {
+      await approveExpectSuccess(collection, 1, alice, { ethereum: receiver }, 100);
     });
 
-    itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
-        const bob = privateKey('//Bob');
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Approval',
+        args: {
+          owner: subToEth(alice.address),
+          spender: receiver,
+          value: '100',
+        },
+      },
+    ]);
+  });
 
-        const receiver = createEthAccount(web3);
+  itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'Fungible', decimalPoints: 0 },
+    });
+    const alice = privateKey('//Alice');
+    const bob = privateKey('//Bob');
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
-        await approveExpectSuccess(collection, 1, alice, bob, 100);
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
+    await approveExpectSuccess(collection, 1, alice, bob, 100);
 
-        const events = await recordEvents(contract, async () => {
-            await transferFromExpectSuccess(collection, 1, bob, alice, { ethereum: receiver }, 51, 'Fungible');
-        });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
 
-        expect(events).to.be.deep.equal([
-            {
-                address,
-                event: 'Transfer',
-                args: {
-                    from: subToEth(alice.address),
-                    to: receiver,
-                    value: '51',
-                }
-            },
-            {
-                address,
-                event: 'Approval',
-                args: {
-                    owner: subToEth(alice.address),
-                    spender: subToEth(bob.address),
-                    value: '49',
-                }
-            }
-        ]);
+    const events = await recordEvents(contract, async () => {
+      await transferFromExpectSuccess(collection, 1, bob, alice, { ethereum: receiver }, 51, 'Fungible');
     });
 
-    itWeb3('Events emitted for transfer()', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'Fungible', decimalPoints: 0 }
-        });
-        const alice = privateKey('//Alice');
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Transfer',
+        args: {
+          from: subToEth(alice.address),
+          to: receiver,
+          value: '51',
+        },
+      },
+      {
+        address,
+        event: 'Approval',
+        args: {
+          owner: subToEth(alice.address),
+          spender: subToEth(bob.address),
+          value: '49',
+        },
+      },
+    ]);
+  });
 
-        const receiver = createEthAccount(web3);
+  itWeb3('Events emitted for transfer()', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'Fungible', decimalPoints: 0 },
+    });
+    const alice = privateKey('//Alice');
 
-        await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleAbi as any, address);
+    await createFungibleItemExpectSuccess(alice, collection, { Value: 200n });
 
-        const events = await recordEvents(contract, async () => {
-            await transferExpectSuccess(collection, 1, alice, { ethereum: receiver }, 51, 'Fungible');
-        });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleAbi as any, address);
 
-        expect(events).to.be.deep.equal([
-            {
-                address,
-                event: 'Transfer',
-                args: {
-                    from: subToEth(alice.address),
-                    to: receiver,
-                    value: '51',
-                }
-            },
-        ]);
+    const events = await recordEvents(contract, async () => {
+      await transferExpectSuccess(collection, 1, alice, { ethereum: receiver }, 51, 'Fungible');
     });
+
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Transfer',
+        args: {
+          from: subToEth(alice.address),
+          to: receiver,
+          value: '51',
+        },
+      },
+    ]);
+  });
 });
\ No newline at end of file
modifiedtests/src/eth/metadata.test.tsdiffbeforeafterboth
--- a/tests/src/eth/metadata.test.ts
+++ b/tests/src/eth/metadata.test.ts
@@ -1,53 +1,58 @@
-import { expect } from "chai";
-import privateKey from "../substrate/privateKey";
-import { createCollectionExpectSuccess } from "../util/helpers";
-import { collectionIdToAddress, createEthAccount, itWeb3, transferBalanceToEth } from "./util/helpers";
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { expect } from 'chai';
+import privateKey from '../substrate/privateKey';
+import { createCollectionExpectSuccess } from '../util/helpers';
+import { collectionIdToAddress, createEthAccount, itWeb3, transferBalanceToEth } from './util/helpers';
 import fungibleMetadataAbi from './fungibleMetadataAbi.json';
 
 describe('Common metadata', () => {
-    itWeb3('Returns collection name', async ({ api, web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            name: 'token name',
-            mode: { type: 'NFT' }
-        });
-        const caller = createEthAccount(web3);
-        await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
-
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
-        const name = await contract.methods.name().call({ from: caller });
-
-        expect(name).to.equal('token name');
+  itWeb3('Returns collection name', async ({ api, web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      name: 'token name',
+      mode: { type: 'NFT' },
     });
+    const caller = createEthAccount(web3);
+    await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
 
-    itWeb3('Returns symbol name', async ({ api, web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            tokenPrefix: 'TOK',
-            mode: { type: 'NFT' }
-        });
-        const caller = createEthAccount(web3);
-        await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
+    const name = await contract.methods.name().call({ from: caller });
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
-        const symbol = await contract.methods.symbol().call({ from: caller });
+    expect(name).to.equal('token name');
+  });
 
-        expect(symbol).to.equal('TOK');
+  itWeb3('Returns symbol name', async ({ api, web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      tokenPrefix: 'TOK',
+      mode: { type: 'NFT' },
     });
+    const caller = createEthAccount(web3);
+    await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
+
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
+    const symbol = await contract.methods.symbol().call({ from: caller });
+
+    expect(symbol).to.equal('TOK');
+  });
 });
 
 describe('Fungible metadata', () => {
-    itWeb3('Returns fungible decimals', async ({ api, web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'Fungible', decimalPoints: 6 }
-        });
-        const caller = createEthAccount(web3);
-        await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
+  itWeb3('Returns fungible decimals', async ({ api, web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'Fungible', decimalPoints: 6 },
+    });
+    const caller = createEthAccount(web3);
+    await transferBalanceToEth(api, privateKey('//Alice'), caller, 999999);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
-        const decimals = await contract.methods.decimals().call({ from: caller });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(fungibleMetadataAbi as any, address);
+    const decimals = await contract.methods.decimals().call({ from: caller });
 
-        expect(+decimals).to.equal(6);
-    })
-})
\ No newline at end of file
+    expect(+decimals).to.equal(6);
+  });
+});
\ No newline at end of file
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -1,280 +1,285 @@
-import privateKey from "../substrate/privateKey";
-import { approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from "../util/helpers";
-import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from "./util/helpers"
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import privateKey from '../substrate/privateKey';
+import { approveExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess } from '../util/helpers';
+import { collectionIdToAddress, createEthAccount, itWeb3, normalizeEvents, recordEvents, subToEth, transferBalanceToEth } from './util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
-import { expect } from "chai";
+import { expect } from 'chai';
 
 describe('Information getting', () => {
-    itWeb3('totalSupply', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+  itWeb3('totalSupply', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
+    });
+    const alice = privateKey('//Alice');
+
+    await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address });
 
-        await createItemExpectSuccess(alice, collection, 'NFT', { substrate: alice.address });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const totalSupply = await contract.methods.totalSupply().call();
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
-        const totalSupply = await contract.methods.totalSupply().call();
+    // FIXME: always equals to 0, because this method is not implemented
+    expect(totalSupply).to.equal('0');
+  });
 
-        // FIXME: always equals to 0, because this method is not implemented
-        expect(totalSupply).to.equal('0');
+  itWeb3('balanceOf', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
     });
+    const alice = privateKey('//Alice');
 
-    itWeb3('balanceOf', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+    const caller = createEthAccount(web3);
+    await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+    await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+    await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
 
-        const caller = createEthAccount(web3);
-        await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
-        await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
-        await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const balance = await contract.methods.balanceOf(caller).call();
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
-        const balance = await contract.methods.balanceOf(caller).call();
+    expect(balance).to.equal('3');
+  });
 
-        expect(balance).to.equal('3');
+  itWeb3('ownerOf', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
     });
+    const alice = privateKey('//Alice');
 
-    itWeb3('ownerOf', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+    const caller = createEthAccount(web3);
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
 
-        const caller = createEthAccount(web3);
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: caller });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const owner = await contract.methods.ownerOf(tokenId).call();
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
-        const owner = await contract.methods.ownerOf(tokenId).call();
-
-        expect(owner).to.equal(caller);
-    });
+    expect(owner).to.equal(caller);
+  });
 });
 
 describe.only('Plain calls', () => {
-    itWeb3('Can perform approve()', async ({ web3, api }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+  itWeb3('Can perform approve()', async ({ web3, api }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
+    });
+    const alice = privateKey('//Alice');
 
-        const owner = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, owner, 999999999999999);
+    const owner = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, owner, 999999999999999);
 
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
 
-        const spender = createEthAccount(web3);
+    const spender = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
 
+    {
+      const result = await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+      const events = normalizeEvents(result.events);
+
+      expect(events).to.be.deep.equal([
         {
-            const result = await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
-            const events = normalizeEvents(result.events);
+          address,
+          event: 'Approval',
+          args: {
+            owner,
+            approved: spender,
+            tokenId: tokenId.toString(),
+          },
+        },
+      ]);
+    }
+  });
 
-            expect(events).to.be.deep.equal([
-                {
-                    address,
-                    event: 'Approval',
-                    args: {
-                        owner,
-                        approved: spender,
-                        tokenId: tokenId.toString(),
-                    }
-                }
-            ]);
-        }
+  itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
     });
-
-    itWeb3('Can perform transferFrom()', async ({ web3, api }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+    const alice = privateKey('//Alice');
 
-        const owner = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, owner, 999999999999999);
+    const owner = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, owner, 999999999999999);
 
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
 
-        const spender = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, spender, 999999999999999);
+    const spender = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, spender, 999999999999999);
 
-        const receiver = createEthAccount(web3);
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
 
-        await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+    await contract.methods.approve(spender, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
 
+    {
+      const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
+      const events = normalizeEvents(result.events);
+      expect(events).to.be.deep.equal([
         {
-            const result = await contract.methods.transferFrom(owner, receiver, tokenId).send({ from: spender, gas: '0x1000000', gasPrice: '0x01' });
-            const events = normalizeEvents(result.events);
-            expect(events).to.be.deep.equal([
-                {
-                    address,
-                    event: 'Transfer',
-                    args: {
-                        from: owner,
-                        to: receiver,
-                        tokenId: tokenId.toString(),
-                    },
-                },
-            ]);
-        }
+          address,
+          event: 'Transfer',
+          args: {
+            from: owner,
+            to: receiver,
+            tokenId: tokenId.toString(),
+          },
+        },
+      ]);
+    }
 
-        {
-            const balance = await contract.methods.balanceOf(receiver).call();
-            expect(+balance).to.equal(1);
-        }
+    {
+      const balance = await contract.methods.balanceOf(receiver).call();
+      expect(+balance).to.equal(1);
+    }
 
-        {
-            const balance = await contract.methods.balanceOf(owner).call();
-            expect(+balance).to.equal(0);
-        }
-    });
+    {
+      const balance = await contract.methods.balanceOf(owner).call();
+      expect(+balance).to.equal(0);
+    }
+  });
 
-    itWeb3('Can perform transfer()', async ({ web3, api }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+  itWeb3('Can perform transfer()', async ({ web3, api }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
+    });
+    const alice = privateKey('//Alice');
 
-        const owner = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, owner, 999999999999999);
+    const owner = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, owner, 999999999999999);
 
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', { ethereum: owner });
 
-        const receiver = createEthAccount(web3);
-        await transferBalanceToEth(api, alice, receiver, 999999999999999);
+    const receiver = createEthAccount(web3);
+    await transferBalanceToEth(api, alice, receiver, 999999999999999);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
 
+    {
+      const result = await contract.methods.transfer(receiver, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
+      console.log(result);
+      const events = normalizeEvents(result.events);
+      expect(events).to.be.deep.equal([
         {
-            const result = await contract.methods.transfer(receiver, tokenId).send({ from: owner, gas: '0x1000000', gasPrice: '0x01' });
-            console.log(result);
-            const events = normalizeEvents(result.events);
-            expect(events).to.be.deep.equal([
-                {
-                    address,
-                    event: 'Transfer',
-                    args: {
-                        from: owner,
-                        to: receiver,
-                        tokenId: tokenId.toString(),
-                    }
-                },
-            ])
-        }
+          address,
+          event: 'Transfer',
+          args: {
+            from: owner,
+            to: receiver,
+            tokenId: tokenId.toString(),
+          },
+        },
+      ]);
+    }
 
-        {
-            const balance = await contract.methods.balanceOf(owner).call();
-            expect(+balance).to.equal(0);
-        }
+    {
+      const balance = await contract.methods.balanceOf(owner).call();
+      expect(+balance).to.equal(0);
+    }
 
-        {
-            const balance = await contract.methods.balanceOf(receiver).call();
-            expect(+balance).to.equal(1);
-        }
-    });
+    {
+      const balance = await contract.methods.balanceOf(receiver).call();
+      expect(+balance).to.equal(1);
+    }
+  });
 });
 
 describe('Substrate calls', () => {
-    itWeb3('Events emitted for approve()', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
-
-        const receiver = createEthAccount(web3);
+  itWeb3('Events emitted for approve()', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
+    });
+    const alice = privateKey('//Alice');
 
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
 
-        const events = await recordEvents(contract, async () => {
-            await approveExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1);
-        });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
 
-        expect(events).to.be.deep.equal([
-            {
-                address,
-                event: 'Approval',
-                args: {
-                    owner: subToEth(alice.address),
-                    approved: receiver,
-                    tokenId: tokenId.toString(),
-                }
-            }
-        ]);
+    const events = await recordEvents(contract, async () => {
+      await approveExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1);
     });
 
-    itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
-        const bob = privateKey('//Bob');
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Approval',
+        args: {
+          owner: subToEth(alice.address),
+          approved: receiver,
+          tokenId: tokenId.toString(),
+        },
+      },
+    ]);
+  });
 
-        const receiver = createEthAccount(web3);
+  itWeb3('Events emitted for transferFrom()', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
+    });
+    const alice = privateKey('//Alice');
+    const bob = privateKey('//Bob');
 
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
-        await approveExpectSuccess(collection, tokenId, alice, bob, 1);
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
+    await approveExpectSuccess(collection, tokenId, alice, bob, 1);
 
-        const events = await recordEvents(contract, async () => {
-            await transferFromExpectSuccess(collection, tokenId, bob, alice, { ethereum: receiver }, 1, 'NFT');
-        });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
 
-        expect(events).to.be.deep.equal([
-            {
-                address,
-                event: 'Transfer',
-                args: {
-                    from: subToEth(alice.address),
-                    to: receiver,
-                    tokenId: tokenId.toString(),
-                }
-            },
-        ]);
+    const events = await recordEvents(contract, async () => {
+      await transferFromExpectSuccess(collection, tokenId, bob, alice, { ethereum: receiver }, 1, 'NFT');
     });
 
-    itWeb3('Events emitted for transfer()', async ({ web3 }) => {
-        const collection = await createCollectionExpectSuccess({
-            mode: { type: 'NFT' }
-        });
-        const alice = privateKey('//Alice');
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Transfer',
+        args: {
+          from: subToEth(alice.address),
+          to: receiver,
+          tokenId: tokenId.toString(),
+        },
+      },
+    ]);
+  });
 
-        const receiver = createEthAccount(web3);
+  itWeb3('Events emitted for transfer()', async ({ web3 }) => {
+    const collection = await createCollectionExpectSuccess({
+      mode: { type: 'NFT' },
+    });
+    const alice = privateKey('//Alice');
 
-        const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
+    const receiver = createEthAccount(web3);
 
-        const address = collectionIdToAddress(collection);
-        const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
+    const tokenId = await createItemExpectSuccess(alice, collection, 'NFT');
 
-        const events = await recordEvents(contract, async () => {
-            await transferExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1, 'NFT');
-        });
+    const address = collectionIdToAddress(collection);
+    const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
 
-        expect(events).to.be.deep.equal([
-            {
-                address,
-                event: 'Transfer',
-                args: {
-                    from: subToEth(alice.address),
-                    to: receiver,
-                    tokenId: tokenId.toString(),
-                }
-            },
-        ]);
+    const events = await recordEvents(contract, async () => {
+      await transferExpectSuccess(collection, tokenId, alice, { ethereum: receiver }, 1, 'NFT');
     });
+
+    expect(events).to.be.deep.equal([
+      {
+        address,
+        event: 'Transfer',
+        args: {
+          from: subToEth(alice.address),
+          to: receiver,
+          tokenId: tokenId.toString(),
+        },
+      },
+    ]);
+  });
 });
\ No newline at end of file
modifiedtests/src/eth/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -1,70 +1,75 @@
-import { ApiPromise } from "@polkadot/api";
-import { addressToEvm, evmToAddress } from "@polkadot/util-crypto";
-import Web3 from "web3";
-import usingApi, { submitTransactionAsync } from "../../substrate/substrate-api";
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { ApiPromise } from '@polkadot/api';
+import { addressToEvm, evmToAddress } from '@polkadot/util-crypto';
+import Web3 from 'web3';
+import usingApi, { submitTransactionAsync } from '../../substrate/substrate-api';
 import { IKeyringPair } from '@polkadot/types/types';
-import { expect } from "chai";
-import { getGenericResult } from "../../util/helpers";
+import { expect } from 'chai';
+import { getGenericResult } from '../../util/helpers';
 
 let web3Connected = false;
 export async function usingWeb3<T>(cb: (web3: Web3) => Promise<T> | T): Promise<T> {
-    if (web3Connected) throw new Error('do not nest usingWeb3 calls');
-    web3Connected = true;
+  if (web3Connected) throw new Error('do not nest usingWeb3 calls');
+  web3Connected = true;
 
-    const provider = new Web3.providers.WebsocketProvider("http://localhost:9944");
-    const web3 = new Web3(provider);
+  const provider = new Web3.providers.WebsocketProvider('http://localhost:9944');
+  const web3 = new Web3(provider);
 
-    try {
-        return await cb(web3);
-    } finally {
-        // provider.disconnect(3000, 'normal disconnect');
-        provider.connection.close();
-        web3Connected = false;
-    }
+  try {
+    return await cb(web3);
+  } finally {
+    // provider.disconnect(3000, 'normal disconnect');
+    provider.connection.close();
+    web3Connected = false;
+  }
 }
 
 export function collectionIdToAddress(address: number): string {
-    if (address >= 0xffffffff || address < 0) throw new Error('id overflow');
-    const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,
-        address >> 24,
-        (address >> 16) & 0xff,
-        (address >> 8) & 0xff,
-        address & 0xff,
-    ]);
-    return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));
+  if (address >= 0xffffffff || address < 0) throw new Error('id overflow');
+  const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,
+    address >> 24,
+    (address >> 16) & 0xff,
+    (address >> 8) & 0xff,
+    address & 0xff,
+  ]);
+  return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));
 }
 
 export function createEthAccount(web3: Web3) {
-    const account = web3.eth.accounts.create();
-    web3.eth.accounts.wallet.add(account.privateKey);
-    return account.address;
+  const account = web3.eth.accounts.create();
+  web3.eth.accounts.wallet.add(account.privateKey);
+  return account.address;
 }
 
 export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair, target: string, amount: number) {
-    const tx = api.tx.balances.transfer(evmToAddress(target), amount);
-    const events = await submitTransactionAsync(source, tx);
-    const result = getGenericResult(events);
-    expect(result.success).to.be.true;
+  const tx = api.tx.balances.transfer(evmToAddress(target), amount);
+  const events = await submitTransactionAsync(source, tx);
+  const result = getGenericResult(events);
+  expect(result.success).to.be.true;
 }
 
 export async function itWeb3(name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any, opts: { only?: boolean, skip?: boolean } = {}) {
-    let i: any = it;
-    if (opts.only) i = i.only;
-    else if (opts.skip) i = i.skip;
-    i(name, async () => {
-        await usingApi(async api => {
-            await usingWeb3(async web3 => {
-                await cb({ api, web3 });
-            });
-        });
+  let i: any = it;
+  if (opts.only) i = i.only;
+  else if (opts.skip) i = i.skip;
+  i(name, async () => {
+    await usingApi(async api => {
+      await usingWeb3(async web3 => {
+        await cb({ api, web3 });
+      });
     });
+  });
 }
 itWeb3.only = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, { only: true });
 itWeb3.skip = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, { skip: true });
 
 export async function generateSubstrateEthPair(web3: Web3) {
-    let account = web3.eth.accounts.create();
-    const evm = evmToAddress(account.address);
+  const account = web3.eth.accounts.create();
+  evmToAddress(account.address);
 }
 
 type NormalizedEvent = {
@@ -74,43 +79,43 @@
 };
 
 export function normalizeEvents(events: any): NormalizedEvent[] {
-    const output = [];
-    for (let key of Object.keys(events)) {
-        if (key.match(/^[0-9]+$/)) {
-            output.push(events[key]);
-        } else if (Array.isArray(events[key])) {
-            output.push(...events[key]);
-        } else {
-            output.push(events[key]);
-        }
+  const output = [];
+  for (const key of Object.keys(events)) {
+    if (key.match(/^[0-9]+$/)) {
+      output.push(events[key]);
+    } else if (Array.isArray(events[key])) {
+      output.push(...events[key]);
+    } else {
+      output.push(events[key]);
     }
-    output.sort((a, b) => a.logIndex - b.logIndex);
-    return output.map(({ address, event, returnValues }) => {
-        const args: { [key: string]: string } = {};
-        for (let key of Object.keys(returnValues)) {
-            if (!key.match(/^[0-9]+$/)) {
-                args[key] = returnValues[key];
-            }
-        }
-        return {
-            address,
-            event,
-            args,
-        };
-    });
+  }
+  output.sort((a, b) => a.logIndex - b.logIndex);
+  return output.map(({ address, event, returnValues }) => {
+    const args: { [key: string]: string } = {};
+    for (const key of Object.keys(returnValues)) {
+      if (!key.match(/^[0-9]+$/)) {
+        args[key] = returnValues[key];
+      }
+    }
+    return {
+      address,
+      event,
+      args,
+    };
+  });
 }
 
 export async function recordEvents(contract: any, action: () => Promise<void>): Promise<NormalizedEvent[]> {
-    const out: any = [];
-    contract.events.allEvents((_: any, event: any) => {
-        out.push(event);
-    });
-    await action();
-    return normalizeEvents(out);
+  const out: any = [];
+  contract.events.allEvents((_: any, event: any) => {
+    out.push(event);
+  });
+  await action();
+  return normalizeEvents(out);
 }
 
 export function subToEth(eth: string): string {
-    const bytes = addressToEvm(eth);
-    const string = '0x' + Buffer.from(bytes).toString('hex');
-    return Web3.utils.toChecksumAddress(string);
+  const bytes = addressToEvm(eth);
+  const string = '0x' + Buffer.from(bytes).toString('hex');
+  return Web3.utils.toChecksumAddress(string);
 }
\ No newline at end of file
modifiedtests/src/inflation.test.tsdiffbeforeafterboth
--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -5,25 +5,13 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi } from "./substrate/substrate-api";
-import privateKey from "./substrate/privateKey";
+import { default as usingApi } from './substrate/substrate-api';
 import { BigNumber } from 'bignumber.js';
-import { IKeyringPair } from '@polkadot/types/types';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
-
-let alice: IKeyringPair;
-let bob: IKeyringPair;
 
 describe('integration test: Inflation', () => {
-  before(async () => {
-    await usingApi(async (api) => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-    });
-  });
-
   it('First year inflation is 10%', async () => {
     await usingApi(async (api) => {
 
modifiedtests/src/overflow.test.tsdiffbeforeafterboth
--- a/tests/src/overflow.test.ts
+++ b/tests/src/overflow.test.ts
@@ -3,65 +3,65 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { IKeyringPair } from "@polkadot/types/types";
+import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
-import chaiAsPromised from "chai-as-promised";
-import privateKey from "./substrate/privateKey";
-import usingApi from "./substrate/substrate-api";
-import { approveExpectFail, approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getFungibleBalance, transferExpectFail, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX } from "./util/helpers";
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import usingApi from './substrate/substrate-api';
+import { approveExpectFail, approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getFungibleBalance, transferExpectFail, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX } from './util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
 
 describe('Integration Test fungible overflows', () => {
-    let alice: IKeyringPair;
-    let bob: IKeyringPair;
-    let charlie: IKeyringPair;
+  let alice: IKeyringPair;
+  let bob: IKeyringPair;
+  let charlie: IKeyringPair;
 
-    before(async () => {
-        await usingApi(async () => {
-            alice = privateKey('//Alice');
-            bob = privateKey('//Bob');
-            charlie = privateKey('//Charlie');
-        });
+  before(async () => {
+    await usingApi(async () => {
+      alice = privateKey('//Alice');
+      bob = privateKey('//Bob');
+      charlie = privateKey('//Charlie');
     });
+  });
 
-    it('fails when overflows on transfer', async () => {
-        const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
+  it('fails when overflows on transfer', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
 
-        await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
-        await transferExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX, 'Fungible');
+    await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+    await transferExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX, 'Fungible');
 
-        await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: 1n });
-        await transferExpectFail(fungibleCollectionId, 0, alice, bob, 1, 'Fungible');
+    await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: 1n });
+    await transferExpectFail(fungibleCollectionId, 0, alice, bob, 1, 'Fungible');
 
-        expect(await getFungibleBalance(fungibleCollectionId, alice.address)).to.equal(1n);
-        expect(await getFungibleBalance(fungibleCollectionId, bob.address)).to.equal(U128_MAX);
-    });
+    expect(await getFungibleBalance(fungibleCollectionId, alice.address)).to.equal(1n);
+    expect(await getFungibleBalance(fungibleCollectionId, bob.address)).to.equal(U128_MAX);
+  });
 
-    it('fails on allowance overflow', async () => {
-        const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
+  it('fails on allowance overflow', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
 
-        await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
-        await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
-        await approveExpectFail(fungibleCollectionId, 0, alice, bob, U128_MAX);
-    });
+    await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+    await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
+    await approveExpectFail(fungibleCollectionId, 0, alice, bob, U128_MAX);
+  });
 
-    it('fails when overflows on transferFrom', async () => {
-        const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
+  it('fails when overflows on transferFrom', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({ mode: { type: 'Fungible', decimalPoints: 0 } });
 
-        await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
-        await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
-        await transferFromExpectSuccess(fungibleCollectionId, 0, bob, alice, charlie, U128_MAX, 'Fungible');
+    await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+    await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, U128_MAX);
+    await transferFromExpectSuccess(fungibleCollectionId, 0, bob, alice, charlie, U128_MAX, 'Fungible');
 
-        expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
-        expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('0');
+    expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
+    expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('0');
 
-        await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
-        await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, 1n);
-        await transferFromExpectFail(fungibleCollectionId, 0, bob, alice, charlie, 1);
+    await createFungibleItemExpectSuccess(alice, fungibleCollectionId, { Value: U128_MAX });
+    await approveExpectSuccess(fungibleCollectionId, 0, alice, bob, 1n);
+    await transferFromExpectFail(fungibleCollectionId, 0, bob, alice, charlie, 1);
 
-        expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
-        expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('1');
-    });
+    expect(await getFungibleBalance(fungibleCollectionId, charlie.address)).to.equal(U128_MAX);
+    expect((await getAllowance(fungibleCollectionId, 0, alice.address, bob.address)).toString()).to.equal('1');
+  });
 });
modifiedtests/src/pallet-presence.test.tsdiffbeforeafterboth
--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -3,9 +3,9 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { ApiPromise } from "@polkadot/api";
-import { expect } from "chai";
-import usingApi from "./substrate/substrate-api";
+import { ApiPromise } from '@polkadot/api';
+import { expect } from 'chai';
+import usingApi from './substrate/substrate-api';
 
 function getModuleNames(api: ApiPromise): string[] {
   return api.runtimeMetadata.asLatest.modules.map(m => m.name.toString().toLowerCase());
@@ -14,12 +14,12 @@
 // Pallets that must always be present
 const requiredPallets = [
   'nft', 'inflation', 'balances', 'contracts', 'randomnesscollectiveflip', 'system', 'timestamp', 'transactionpayment', 'treasury', 'vesting', 'evm', 'ethereum',
-  'scheduler', 'nftpayment', 'charging'
+  'scheduler', 'nftpayment', 'charging',
 ];
 
 // Pallets that depend on consensus and governance configuration
 const consensusPallets = [
-  'sudo', 'aura'
+  'sudo', 'aura',
 ];
 
 describe('Pallet presence', () => {
modifiedtests/src/removeCollectionSponsor.test.tsdiffbeforeafterboth
--- a/tests/src/removeCollectionSponsor.test.ts
+++ b/tests/src/removeCollectionSponsor.test.ts
@@ -5,27 +5,21 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
+import { default as usingApi, submitTransactionExpectFailAsync } from './substrate/substrate-api';
 import { 
   createCollectionExpectSuccess, 
   setCollectionSponsorExpectSuccess, 
   destroyCollectionExpectSuccess, 
-  setCollectionSponsorExpectFailure,
   confirmSponsorshipExpectSuccess,
   confirmSponsorshipExpectFailure,
   createItemExpectSuccess,
   findUnusedAddress,
-  getGenericResult,
-  enableWhiteListExpectSuccess,
-  enablePublicMintingExpectSuccess,
-  addToWhiteListExpectSuccess,
   removeCollectionSponsorExpectSuccess,
   removeCollectionSponsorExpectFailure,
   normalizeAccountId,
-} from "./util/helpers";
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
-import type { AccountId } from '@polkadot/types/interfaces';
+} from './util/helpers';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
 import { BigNumber } from 'bignumber.js';
 
 chai.use(chaiAsPromised);
@@ -33,16 +27,14 @@
 
 let alice: IKeyringPair;
 let bob: IKeyringPair;
-let charlie: IKeyringPair;
 
 describe('integration test: ext. removeCollectionSponsor():', () => {
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-      bob = keyring.addFromUri(`//Bob`);
-      charlie = keyring.addFromUri(`//Charlie`);
+      alice = keyring.addFromUri('//Alice');
+      bob = keyring.addFromUri('//Bob');
     });
   });
 
@@ -65,7 +57,7 @@
       const badTransaction = async function () { 
         await submitTransactionExpectFailAsync(zeroBalance, zeroToAlice);
       };
-      await expect(badTransaction()).to.be.rejectedWith("Inability to pay some fees");
+      await expect(badTransaction()).to.be.rejectedWith('Inability to pay some fees');
       const BsponsorBalance = new BigNumber((await api.query.system.account(bob.address)).data.free.toString());
 
       expect(BsponsorBalance.isEqualTo(AsponsorBalance)).to.be.true;
@@ -95,19 +87,18 @@
 
 describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      alice = keyring.addFromUri(`//Alice`);
-      bob = keyring.addFromUri(`//Bob`);
-      charlie = keyring.addFromUri(`//Charlie`);
+      alice = keyring.addFromUri('//Alice');
+      bob = keyring.addFromUri('//Bob');
     });
   });
 
   it('(!negative test!) Remove sponsor for a collection that never existed', async () => {
     // Find the collection that never existed
-    const collectionId = 0;
+    let collectionId = 0;
     await usingApi(async (api) => {
-      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+      collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
     });
 
     await removeCollectionSponsorExpectFailure(collectionId);
modifiedtests/src/removeFromContractWhiteList.test.tsdiffbeforeafterboth
--- a/tests/src/removeFromContractWhiteList.test.ts
+++ b/tests/src/removeFromContractWhiteList.test.ts
@@ -3,79 +3,79 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import privateKey from "./substrate/privateKey";
-import usingApi from "./substrate/substrate-api";
-import { deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess } from "./util/contracthelpers";
-import { addToContractWhiteListExpectSuccess, isWhitelistedInContract, removeFromContractWhiteListExpectFailure, removeFromContractWhiteListExpectSuccess, toggleContractWhitelistExpectSuccess } from "./util/helpers";
+import privateKey from './substrate/privateKey';
+import usingApi from './substrate/substrate-api';
+import { deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess } from './util/contracthelpers';
+import { addToContractWhiteListExpectSuccess, isWhitelistedInContract, removeFromContractWhiteListExpectFailure, removeFromContractWhiteListExpectSuccess, toggleContractWhitelistExpectSuccess } from './util/helpers';
 import { IKeyringPair } from '@polkadot/types/types';
-import { expect } from "chai";
+import { expect } from 'chai';
 
 describe('Integration Test removeFromContractWhiteList', () => {
-    let bob: IKeyringPair;
+  let bob: IKeyringPair;
 
-    before(async () => {
-        await usingApi(async () => {
-            bob = privateKey('//Bob');
-        });
+  before(async () => {
+    await usingApi(async () => {
+      bob = privateKey('//Bob');
     });
+  });
 
-    it('user is no longer whitelisted after removal', async () => {
-        await usingApi(async (api) => {
-            const [flipper, deployer] = await deployFlipper(api);
+  it('user is no longer whitelisted after removal', async () => {
+    await usingApi(async (api) => {
+      const [flipper, deployer] = await deployFlipper(api);
 
-            await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
-            await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+      await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+      await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
 
-            expect(await isWhitelistedInContract(flipper.address, bob.address)).to.be.false;
-        });
+      expect(await isWhitelistedInContract(flipper.address, bob.address)).to.be.false;
     });
+  });
 
-    it('user can\'t execute contract after removal', async () => {
-        await usingApi(async (api) => {
-            const [flipper, deployer] = await deployFlipper(api);
-            await toggleContractWhitelistExpectSuccess(deployer, flipper.address.toString(), true);
+  it('user can\'t execute contract after removal', async () => {
+    await usingApi(async (api) => {
+      const [flipper, deployer] = await deployFlipper(api);
+      await toggleContractWhitelistExpectSuccess(deployer, flipper.address.toString(), true);
 
-            await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
-            await toggleFlipValueExpectSuccess(bob, flipper);
+      await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+      await toggleFlipValueExpectSuccess(bob, flipper);
 
-            await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
-            await toggleFlipValueExpectFailure(bob, flipper);
-        });
+      await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+      await toggleFlipValueExpectFailure(bob, flipper);
     });
+  });
 
-    it('can be called twice', async () => {
-        await usingApi(async (api) => {
-            const [flipper, deployer] = await deployFlipper(api);
+  it('can be called twice', async () => {
+    await usingApi(async (api) => {
+      const [flipper, deployer] = await deployFlipper(api);
 
-            await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
-            await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
-            await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
-        });
+      await addToContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+      await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
+      await removeFromContractWhiteListExpectSuccess(deployer, flipper.address.toString(), bob.address);
     });
+  });
 });
 
 describe('Negative Integration Test removeFromContractWhiteList', () => {
-    let alice: IKeyringPair;
-    let bob: IKeyringPair;
+  let alice: IKeyringPair;
+  let bob: IKeyringPair;
 
-    before(async () => {
-        await usingApi(async () => {
-            alice = privateKey('//Alice');
-            bob = privateKey('//Bob');
-        });
+  before(async () => {
+    await usingApi(async () => {
+      alice = privateKey('//Alice');
+      bob = privateKey('//Bob');
     });
+  });
 
-    it('fails when called with non-contract address', async () => {
-        await usingApi(async () => {
-            await removeFromContractWhiteListExpectFailure(alice, alice.address, bob.address);
-        });
+  it('fails when called with non-contract address', async () => {
+    await usingApi(async () => {
+      await removeFromContractWhiteListExpectFailure(alice, alice.address, bob.address);
     });
+  });
 
-    it('fails when executed by non owner', async () => {
-        await usingApi(async (api) => {
-            const [flipper, _] = await deployFlipper(api);
+  it('fails when executed by non owner', async () => {
+    await usingApi(async (api) => {
+      const [flipper] = await deployFlipper(api);
 
-            await removeFromContractWhiteListExpectFailure(alice, flipper.address.toString(), bob.address);
-        });
+      await removeFromContractWhiteListExpectFailure(alice, flipper.address.toString(), bob.address);
     });
+  });
 });
modifiedtests/src/removeFromWhiteList.test.tsdiffbeforeafterboth
--- a/tests/src/removeFromWhiteList.test.ts
+++ b/tests/src/removeFromWhiteList.test.ts
@@ -28,7 +28,7 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       alice = privateKey('//Alice');
       bob = privateKey('//Bob');
     });
@@ -62,7 +62,7 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       alice = privateKey('//Alice');
       bob = privateKey('//Bob');
     });
modifiedtests/src/rpc.load.tsdiffbeforeafterboth
--- a/tests/src/rpc.load.ts
+++ b/tests/src/rpc.load.ts
@@ -3,24 +3,22 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { expect, assert } from "chai";
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import { IKeyringPair } from "@polkadot/types/types";
-import { Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract } from "@polkadot/api-contract";
-import { ApiPromise, Keyring } from "@polkadot/api";
-import { ApiTypes, SubmittableExtrinsic } from "@polkadot/api/types";
+import usingApi, { submitTransactionAsync } from './substrate/substrate-api';
+import { IKeyringPair } from '@polkadot/types/types';
+import { Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract } from '@polkadot/api-contract';
+import { ApiPromise, Keyring } from '@polkadot/api';
 import { BigNumber } from 'bignumber.js';
-import { findUnusedAddress } from './util/helpers'
-import fs from "fs";
-import privateKey from "./substrate/privateKey";
+import { findUnusedAddress } from './util/helpers';
+import fs from 'fs';
+import privateKey from './substrate/privateKey';
 
 const value = 0;
 const gasLimit = 500000n * 1000000n;
-const endowment = `1000000000000000`;
-
+const endowment = '1000000000000000';
 
+/*eslint no-async-promise-executor: "off"*/
 function deployBlueprint(alice: IKeyringPair, code: CodePromise): Promise<Blueprint> {
-  return new Promise<Blueprint>(async (resolve, reject) => {
+  return new Promise<Blueprint>(async (resolve) => {
     const unsub = await code
       .createBlueprint()
       .signAndSend(alice, (result) => {
@@ -29,20 +27,21 @@
           resolve(result.blueprint);
           unsub();
         }
-      })
+      });
   });
 }
 
+/*eslint no-async-promise-executor: "off"*/
 function deployContract(alice: IKeyringPair, blueprint: Blueprint) : Promise<any> {
-  return new Promise<any>(async (resolve, reject) => {
+  return new Promise<any>(async (resolve) => {
     const unsub = await blueprint.tx
-    .new(endowment, gasLimit)
-    .signAndSend(alice, (result) => {
-      if (result.status.isInBlock || result.status.isFinalized) {
-        unsub();
-        resolve(result);
-      }
-    });    
+      .new(endowment, gasLimit)
+      .signAndSend(alice, (result) => {
+        if (result.status.isInBlock || result.status.isFinalized) {
+          unsub();
+          resolve(result);
+        }
+      });    
   });
 }
 
@@ -52,7 +51,7 @@
 
   // Transfer balance to it
   const keyring = new Keyring({ type: 'sr25519' });
-  const alice = keyring.addFromUri(`//Alice`);
+  const alice = keyring.addFromUri('//Alice');
   let amount = new BigNumber(endowment);
   amount = amount.plus(1e15);
   const tx = api.tx.balances.transfer(deployer.address, amount.toFixed());
@@ -81,7 +80,7 @@
   const result = await contract.query.get(deployer.address, value, gasLimit);
 
   if(!result.result.isSuccess) {
-    throw `Failed to get value`;
+    throw 'Failed to get value';
   }
   return result.result.asSuccess.data;
 }
@@ -95,6 +94,8 @@
       let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000;
       let rate = 0;
       const checkPoint = 1000;
+
+      /* eslint no-constant-condition: "off" */
       while (true) {
         await api.rpc.system.chain();
         count++;
@@ -102,7 +103,7 @@
     
         if (count % checkPoint == 0) {
           hrTime = process.hrtime();
-          let microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
+          const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
           rate = 1000000*checkPoint/(microsec2 - microsec1);
           microsec1 = microsec2;
         }
@@ -117,7 +118,7 @@
       const [contract, deployer] = await deployLoadTester(api);
 
       // Fill smart contract up with data
-      const bob = privateKey("//Bob");
+      const bob = privateKey('//Bob');
       const tx = contract.tx.bloat(value, gasLimit, 200);
       await submitTransactionAsync(bob, tx);
 
@@ -127,6 +128,8 @@
       let microsec1 = hrTime[0] * 1000000 + hrTime[1] / 1000;
       let rate = 0;
       const checkPoint = 10;
+
+      /* eslint no-constant-condition: "off" */
       while (true) {
         await getScData(contract, deployer);
         count++;
@@ -134,7 +137,7 @@
     
         if (count % checkPoint == 0) {
           hrTime = process.hrtime();
-          let microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
+          const microsec2 = hrTime[0] * 1000000 + hrTime[1] / 1000;
           rate = 1000000*checkPoint/(microsec2 - microsec1);
           microsec1 = microsec2;
         }
modifiedtests/src/scheduler.test.tsdiffbeforeafterboth
--- a/tests/src/scheduler.test.ts
+++ b/tests/src/scheduler.test.ts
@@ -3,7 +3,6 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { IKeyringPair } from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from './substrate/privateKey';
@@ -11,34 +10,16 @@
 import {
   createItemExpectSuccess,
   createCollectionExpectSuccess,
-  destroyCollectionExpectSuccess,
-  findNotExistingCollection,
-  queryCollectionExpectSuccess,
-  setOffchainSchemaExpectFailure,
-  setOffchainSchemaExpectSuccess,
-  transferExpectSuccess,
   scheduleTransferExpectSuccess,
   setCollectionSponsorExpectSuccess,
-  confirmSponsorshipExpectSuccess
+  confirmSponsorshipExpectSuccess,
 } from './util/helpers';
-
 
 chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-const DATA = [1, 2, 3, 4];
 
 describe('Integration Test scheduler base transaction', () => {
-  let alice: IKeyringPair;
-
-  before(async () => {
+  it('User can transfer owned token with delay (scheduler)', async () => {
     await usingApi(async () => {
-      alice = privateKey('//Alice');
-    });
-  });
-
-  it('User can transfer owned token with delay (scheduler)', async () => {
-    await usingApi(async (api) => {
       const Alice = privateKey('//Alice');
       const Bob = privateKey('//Bob');
       // nft
@@ -50,45 +31,4 @@
       await scheduleTransferExpectSuccess(nftCollectionId, newNftTokenId, Alice, Bob, 1, 'NFT');
     });
   });
-
-  
 });
-
-// describe('Negative Integration Test setOffchainSchema', () => {
-//   let alice: IKeyringPair;
-//   let bob: IKeyringPair;
-
-//   let validCollectionId: number;
-
-//   before(async () => {
-//     await usingApi(async () => {
-//       alice = privateKey('//Alice');
-//       bob = privateKey('//Bob');
-
-//       validCollectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
-//     });
-//   });
-
-//   it('fails on not existing collection id', async () => {
-//     const nonExistingCollectionId = await usingApi(findNotExistingCollection);
-
-//     await setOffchainSchemaExpectFailure(alice, nonExistingCollectionId, DATA);
-//   });
-
-//   it('fails on destroyed collection id', async () => {
-//     const destroyedCollectionId = await createCollectionExpectSuccess({ mode: { type: 'NFT' } });
-//     await destroyCollectionExpectSuccess(destroyedCollectionId);
-
-//     await setOffchainSchemaExpectFailure(alice, destroyedCollectionId, DATA);
-//   });
-
-//   it('fails on too long data', async () => {
-//     const tooLongData = new Array(4097).fill(0xff);
-
-//     await setOffchainSchemaExpectFailure(alice, validCollectionId, tooLongData);
-//   });
-
-//   it('fails on execution by non-owner', async () => {
-//     await setOffchainSchemaExpectFailure(bob, validCollectionId, DATA);
-//   });
-// });
modifiedtests/src/setCollectionLimits.test.tsdiffbeforeafterboth
--- a/tests/src/setCollectionLimits.test.ts
+++ b/tests/src/setCollectionLimits.test.ts
@@ -50,7 +50,7 @@
           TokenLimit: tokenLimit,
           SponsorTimeout: sponsorTimeout,
           OwnerCanTransfer: true,
-          OwnerCanDestroy: true
+          OwnerCanDestroy: true,
         },
       );
       const events = await submitTransactionAsync(alice, tx);
@@ -73,13 +73,13 @@
   it('Set the same token limit twice', async () => {
     await usingApi(async (api: ApiPromise) => {
 
-      let collectionLimits = {
+      const collectionLimits = {
         AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
         SponsoredMintSize: sponsoredDataSize,
         TokenLimit: tokenLimit,
         SponsorTimeout: sponsorTimeout,
         OwnerCanTransfer: true,
-        OwnerCanDestroy: true
+        OwnerCanDestroy: true,
       };
 
       // The first time
@@ -173,7 +173,7 @@
       TokenLimit: tokenLimit,
       SponsorTimeout: sponsorTimeout,
       OwnerCanTransfer: false,
-      OwnerCanDestroy: true
+      OwnerCanDestroy: true,
     });
     await setCollectionLimitsExpectFailure(alice, collectionId, { 
       AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
@@ -181,7 +181,7 @@
       TokenLimit: tokenLimit,
       SponsorTimeout: sponsorTimeout,
       OwnerCanTransfer: true,
-      OwnerCanDestroy: true
+      OwnerCanDestroy: true,
     });
   });
 
@@ -193,7 +193,7 @@
       TokenLimit: tokenLimit,
       SponsorTimeout: sponsorTimeout,
       OwnerCanTransfer: true,
-      OwnerCanDestroy: false
+      OwnerCanDestroy: false,
     });
     await setCollectionLimitsExpectFailure(alice, collectionId, { 
       AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
@@ -201,21 +201,21 @@
       TokenLimit: tokenLimit,
       SponsorTimeout: sponsorTimeout,
       OwnerCanTransfer: true,
-      OwnerCanDestroy: true
+      OwnerCanDestroy: true,
     });
   });
 
   it('Setting the higher token limit fails', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
 
       const collectionId = await createCollectionExpectSuccess();
-      let collectionLimits = {
+      const collectionLimits = {
         AccountTokenOwnershipLimit: accountTokenOwnershipLimit,
         SponsoredMintSize: sponsoredDataSize,
         TokenLimit: tokenLimit,
         SponsorTimeout: sponsorTimeout,
         OwnerCanTransfer: true,
-        OwnerCanDestroy: true
+        OwnerCanDestroy: true,
       };
 
       // The first time
modifiedtests/src/setCollectionSponsor.test.tsdiffbeforeafterboth
--- a/tests/src/setCollectionSponsor.test.ts
+++ b/tests/src/setCollectionSponsor.test.ts
@@ -5,22 +5,21 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import { default as usingApi } from "./substrate/substrate-api";
-import { createCollectionExpectSuccess, setCollectionSponsorExpectSuccess, destroyCollectionExpectSuccess, setCollectionSponsorExpectFailure } from "./util/helpers";
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
+import { default as usingApi } from './substrate/substrate-api';
+import { createCollectionExpectSuccess, setCollectionSponsorExpectSuccess, destroyCollectionExpectSuccess, setCollectionSponsorExpectFailure } from './util/helpers';
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
 
 chai.use(chaiAsPromised);
-const expect = chai.expect;
 
 let bob: IKeyringPair;
 
 describe('integration test: ext. setCollectionSponsor():', () => {
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      bob = keyring.addFromUri(`//Bob`);
+      bob = keyring.addFromUri('//Bob');
     });
   });
 
@@ -46,7 +45,7 @@
     const collectionId = await createCollectionExpectSuccess();
 
     const keyring = new Keyring({ type: 'sr25519' });
-    const charlie = keyring.addFromUri(`//Charlie`);
+    const charlie = keyring.addFromUri('//Charlie');
     await setCollectionSponsorExpectSuccess(collectionId, bob.address);
     await setCollectionSponsorExpectSuccess(collectionId, charlie.address);
   });
@@ -54,9 +53,9 @@
 
 describe('(!negative test!) integration test: ext. setCollectionSponsor():', () => {
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const keyring = new Keyring({ type: 'sr25519' });
-      bob = keyring.addFromUri(`//Bob`);
+      bob = keyring.addFromUri('//Bob');
     });
   });
 
@@ -66,9 +65,9 @@
   });
   it('(!negative test!) Add sponsor to a collection that never existed', async () => {
     // Find the collection that never existed
-    const collectionId = 0;
+    let collectionId = 0;
     await usingApi(async (api) => {
-      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+      collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
     });
 
     await setCollectionSponsorExpectFailure(collectionId, bob.address);
modifiedtests/src/setConstOnChainSchema.test.tsdiffbeforeafterboth
--- a/tests/src/setConstOnChainSchema.test.ts
+++ b/tests/src/setConstOnChainSchema.test.ts
@@ -23,7 +23,7 @@
 let largeShema: any;
 
 before(async () => {
-  await usingApi(async (api) => {
+  await usingApi(async () => {
     const keyring = new Keyring({ type: 'sr25519' });
     Alice = keyring.addFromUri('//Alice');
     Bob = keyring.addFromUri('//Bob');
@@ -35,7 +35,7 @@
 describe('Integration Test ext. setConstOnChainSchema()', () => {
 
   it('Run extrinsic with parameters of the collection id, set the scheme', async () => {
-      await usingApi(async (api) => {
+    await usingApi(async (api) => {
       const collectionId = await createCollectionExpectSuccess();
       const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
       expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));
@@ -45,12 +45,12 @@
   });
 
   it('Checking collection data using the ConstOnChainSchema parameter', async () => {
-      await usingApi(async (api) => {
-        const collectionId = await createCollectionExpectSuccess();
-        const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);
-        await submitTransactionAsync(Alice, setShema);
-        const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
-        expect(collection.ConstOnChainSchema.toString()).to.be.eq(Shema);
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess();
+      const setShema = api.tx.nft.setConstOnChainSchema(collectionId, Shema);
+      await submitTransactionAsync(Alice, setShema);
+      const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
+      expect(collection.ConstOnChainSchema.toString()).to.be.eq(Shema);
 
     });
   });
modifiedtests/src/setContractSponsoringRateLimit.test.tsdiffbeforeafterboth
--- a/tests/src/setContractSponsoringRateLimit.test.ts
+++ b/tests/src/setContractSponsoringRateLimit.test.ts
@@ -59,7 +59,7 @@
 
   it('fails when called by non-owning user', async () => {
     await usingApi(async (api) => {
-      const [flipper, _] = await deployFlipper(api);
+      const [flipper] = await deployFlipper(api);
 
       await setContractSponsoringRateLimitExpectFailure(alice, flipper.address, 1);
     });
modifiedtests/src/setPublicAccessMode.test.tsdiffbeforeafterboth
--- a/tests/src/setPublicAccessMode.test.ts
+++ b/tests/src/setPublicAccessMode.test.ts
@@ -1,95 +1,94 @@
-//
-// This file is subject to the terms and conditions defined in
-// file 'LICENSE', which is part of this source code package.
-//
-
-// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
-import { ApiPromise, Keyring } from '@polkadot/api';
-import { IKeyringPair } from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
-import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import {
-  addToWhiteListExpectSuccess,
-  createCollectionExpectSuccess,
-  createItemExpectSuccess,
-  destroyCollectionExpectSuccess,
-  enablePublicMintingExpectSuccess,
-  enableWhiteListExpectSuccess,
-  normalizeAccountId,
-} from './util/helpers';
-import { utf16ToStr } from './util/util';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-let Alice: IKeyringPair;
-let Bob: IKeyringPair;
-
-describe('Integration Test setPublicAccessMode(): ', () => {
-  before(async () => {
-    await usingApi(async (api) => {
-      Alice = privateKey('//Alice');
-      Bob = privateKey('//Bob');
-    });
-  });
-
-  it('Run extrinsic with collection id parameters, set the whitelist mode for the collection', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      const collectionId: number = await createCollectionExpectSuccess();
-      await enableWhiteListExpectSuccess(Alice, collectionId);
-      await enablePublicMintingExpectSuccess(Alice, collectionId);
-      await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
-      await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
-    });
-  });
-
-  it('Whitelisted collection limits', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      const collectionId = await createCollectionExpectSuccess();
-      await enableWhiteListExpectSuccess(Alice, collectionId);
-      await enablePublicMintingExpectSuccess(Alice, collectionId);
-      const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Bob.address), 'NFT');
-      await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
-    });
-  });
-});
-
-describe('Negative Integration Test ext. setPublicAccessMode(): ', () => {
-  it('Set a non-existent collection', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      // tslint:disable-next-line: radix
-      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
-      const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
-      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
-    });
-  });
-
-  it('Set the collection that has been deleted', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      // tslint:disable-next-line: no-bitwise
-      const collectionId = await createCollectionExpectSuccess();
-      await destroyCollectionExpectSuccess(collectionId);
-      const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
-      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
-    });
-  });
-
-  it('Re-set the list mode already set in quantity', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      const collectionId: number = await createCollectionExpectSuccess();
-      await enableWhiteListExpectSuccess(Alice, collectionId);
-      await enableWhiteListExpectSuccess(Alice, collectionId);
-    });
-  });
-
-  it('Execute method not on behalf of the collection owner', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      // tslint:disable-next-line: no-bitwise
-      const collectionId = await createCollectionExpectSuccess();
-      const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
-      await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
-    });
-  });
-});
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
+import { ApiPromise } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+import privateKey from './substrate/privateKey';
+import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api';
+import {
+  addToWhiteListExpectSuccess,
+  createCollectionExpectSuccess,
+  createItemExpectSuccess,
+  destroyCollectionExpectSuccess,
+  enablePublicMintingExpectSuccess,
+  enableWhiteListExpectSuccess,
+  normalizeAccountId,
+} from './util/helpers';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+let Alice: IKeyringPair;
+let Bob: IKeyringPair;
+
+describe('Integration Test setPublicAccessMode(): ', () => {
+  before(async () => {
+    await usingApi(async () => {
+      Alice = privateKey('//Alice');
+      Bob = privateKey('//Bob');
+    });
+  });
+
+  it('Run extrinsic with collection id parameters, set the whitelist mode for the collection', async () => {
+    await usingApi(async () => {
+      const collectionId: number = await createCollectionExpectSuccess();
+      await enableWhiteListExpectSuccess(Alice, collectionId);
+      await enablePublicMintingExpectSuccess(Alice, collectionId);
+      await addToWhiteListExpectSuccess(Alice, collectionId, Bob.address);
+      await createItemExpectSuccess(Bob, collectionId, 'NFT', Bob.address);
+    });
+  });
+
+  it('Whitelisted collection limits', async () => {
+    await usingApi(async (api: ApiPromise) => {
+      const collectionId = await createCollectionExpectSuccess();
+      await enableWhiteListExpectSuccess(Alice, collectionId);
+      await enablePublicMintingExpectSuccess(Alice, collectionId);
+      const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(Bob.address), 'NFT');
+      await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
+    });
+  });
+});
+
+describe('Negative Integration Test ext. setPublicAccessMode(): ', () => {
+  it('Set a non-existent collection', async () => {
+    await usingApi(async (api: ApiPromise) => {
+      // tslint:disable-next-line: radix
+      const collectionId = parseInt((await api.query.nft.createdCollectionCount()).toString()) + 1;
+      const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
+      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+    });
+  });
+
+  it('Set the collection that has been deleted', async () => {
+    await usingApi(async (api: ApiPromise) => {
+      // tslint:disable-next-line: no-bitwise
+      const collectionId = await createCollectionExpectSuccess();
+      await destroyCollectionExpectSuccess(collectionId);
+      const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
+      await expect(submitTransactionExpectFailAsync(Alice, tx)).to.be.rejected;
+    });
+  });
+
+  it('Re-set the list mode already set in quantity', async () => {
+    await usingApi(async () => {
+      const collectionId: number = await createCollectionExpectSuccess();
+      await enableWhiteListExpectSuccess(Alice, collectionId);
+      await enableWhiteListExpectSuccess(Alice, collectionId);
+    });
+  });
+
+  it('Execute method not on behalf of the collection owner', async () => {
+    await usingApi(async (api: ApiPromise) => {
+      // tslint:disable-next-line: no-bitwise
+      const collectionId = await createCollectionExpectSuccess();
+      const tx = api.tx.nft.setPublicAccessMode(collectionId, 'WhiteList');
+      await expect(submitTransactionExpectFailAsync(Bob, tx)).to.be.rejected;
+    });
+  });
+});
modifiedtests/src/setSchemaVersion.test.tsdiffbeforeafterboth
--- a/tests/src/setSchemaVersion.test.ts
+++ b/tests/src/setSchemaVersion.test.ts
@@ -103,7 +103,7 @@
   it('execute setSchemaVersion with not correct schema version', async () => {
     await usingApi(async (api: ApiPromise) => {
       const consoleError = console.error;
-      console.error = (message: string) => {};
+      console.error = () => {};
       try {
         tx = api.tx.nft.setSchemaVersion(collectionIdForTesting, 'Test');
         await submitTransactionAsync(alice, tx);
modifiedtests/src/setVariableMetaData.test.tsdiffbeforeafterboth
--- a/tests/src/setVariableMetaData.test.ts
+++ b/tests/src/setVariableMetaData.test.ts
@@ -49,7 +49,7 @@
 });
 
 describe('Negative Integration Test setVariableMetaData', () => {
-  let data = [1];
+  const data = [1];
 
   let alice: IKeyringPair;
   let bob: IKeyringPair;
@@ -69,7 +69,7 @@
 
   it('fails on not existing collection id', async () => {
     await usingApi(async api => {
-      let nonExistingCollectionId = await findNotExistingCollection(api);
+      const nonExistingCollectionId = await findNotExistingCollection(api);
       await setVariableMetaDataExpectFailure(alice, nonExistingCollectionId, 1, data);
     });
   });
modifiedtests/src/setVariableOnChainSchema.test.tsdiffbeforeafterboth
--- a/tests/src/setVariableOnChainSchema.test.ts
+++ b/tests/src/setVariableOnChainSchema.test.ts
@@ -23,7 +23,7 @@
 let largeSchema: any;
 
 before(async () => {
-  await usingApi(async (api) => {
+  await usingApi(async () => {
     const keyring = new Keyring({ type: 'sr25519' });
     Alice = keyring.addFromUri('//Alice');
     Bob = keyring.addFromUri('//Bob');
@@ -35,7 +35,7 @@
 describe('Integration Test ext. setVariableOnChainSchema()', () => {
 
   it('Run extrinsic with parameters of the collection id, set the scheme', async () => {
-      await usingApi(async (api) => {
+    await usingApi(async (api) => {
       const collectionId = await createCollectionExpectSuccess();
       const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
       expect(collection.Owner).to.be.deep.eq(normalizeAccountId(Alice.address));
@@ -45,12 +45,12 @@
   });
 
   it('Checking collection data using the setVariableOnChainSchema parameter', async () => {
-      await usingApi(async (api) => {
-        const collectionId = await createCollectionExpectSuccess();
-        const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);
-        await submitTransactionAsync(Alice, setSchema);
-        const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
-        expect(collection.VariableOnChainSchema.toString()).to.be.eq(Schema);
+    await usingApi(async (api) => {
+      const collectionId = await createCollectionExpectSuccess();
+      const setSchema = api.tx.nft.setVariableOnChainSchema(collectionId, Schema);
+      await submitTransactionAsync(Alice, setSchema);
+      const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();
+      expect(collection.VariableOnChainSchema.toString()).to.be.eq(Schema);
 
     });
   });
modifiedtests/src/substrate/privateKey.tsdiffbeforeafterboth
--- a/tests/src/substrate/privateKey.ts
+++ b/tests/src/substrate/privateKey.ts
@@ -3,8 +3,8 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { Keyring } from "@polkadot/api";
-import { IKeyringPair } from "@polkadot/types/types";
+import { Keyring } from '@polkadot/api';
+import { IKeyringPair } from '@polkadot/types/types';
 
 export default function privateKey(account: string): IKeyringPair {
   const keyring = new Keyring({ type: 'sr25519' });
modifiedtests/src/substrate/promisify-substrate.tsdiffbeforeafterboth
--- a/tests/src/substrate/promisify-substrate.ts
+++ b/tests/src/substrate/promisify-substrate.ts
@@ -3,7 +3,7 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { ApiPromise } from "@polkadot/api";
+import { ApiPromise } from '@polkadot/api';
 
 type PromiseType<T> = T extends PromiseLike<infer TInner> ? TInner : T;
 
modifiedtests/src/substrate/substrate-api.tsdiffbeforeafterboth
--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -3,15 +3,15 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { WsProvider, ApiPromise } from "@polkadot/api";
+import { WsProvider, ApiPromise } from '@polkadot/api';
 import { EventRecord } from '@polkadot/types/interfaces/system/types';
 import { ExtrinsicStatus } from '@polkadot/types/interfaces/author/types';
-import { IKeyringPair } from "@polkadot/types/types";
+import { IKeyringPair } from '@polkadot/types/types';
 
-import config from "../config";
-import promisifySubstrate from "./promisify-substrate";
-import { ApiOptions, SubmittableExtrinsic, ApiTypes } from "@polkadot/api/types";
-import rtt from "../../../runtime_types.json";
+import config from '../config';
+import promisifySubstrate from './promisify-substrate';
+import { ApiOptions, SubmittableExtrinsic, ApiTypes } from '@polkadot/api/types';
+import rtt from '../../../runtime_types.json';
 
 function defaultApiOptions(): ApiOptions {
   const wsProvider = new WsProvider(config.substrateUrl);
@@ -20,15 +20,15 @@
 
 export default async function usingApi<T = void>(action: (api: ApiPromise) => Promise<T>, settings: ApiOptions | undefined = undefined): Promise<T> {
   settings = settings || defaultApiOptions();
-  let api: ApiPromise = new ApiPromise(settings);
+  const api: ApiPromise = new ApiPromise(settings);
   let result: T = null as unknown as T;
 
   // TODO: Remove, this is temporary: Filter unneeded API output 
   // (Jaco promised it will be removed in the next version)
   const consoleErr = console.error;
   console.error = (message: string) => {
-    if (message.includes("StorageChangeSet:: WebSocket is not connected") || message.includes("2021-")) {}
-    else consoleErr(message);
+    if (!message.includes('StorageChangeSet:: WebSocket is not connected') || message.includes('2021-'))
+      consoleErr(message);
   };
 
   try {
@@ -72,6 +72,7 @@
 
 export function
 submitTransactionAsync(sender: IKeyringPair, transaction: SubmittableExtrinsic<ApiTypes>): Promise<EventRecord[]> {
+  /* eslint no-async-promise-executor: "off" */
   return new Promise(async (resolve, reject) => {
     try {
       await transaction.signAndSend(sender, ({ events = [], status }) => {
@@ -97,6 +98,7 @@
   console.error = () => {};
   console.log = () => {};
 
+  /* eslint no-async-promise-executor: "off" */
   return new Promise<EventRecord[]>(async function(res, rej) {
     const resolve = (rec: EventRecord[]) => {
       setTimeout(() => {
modifiedtests/src/substrate/wait-new-blocks.tsdiffbeforeafterboth
--- a/tests/src/substrate/wait-new-blocks.ts
+++ b/tests/src/substrate/wait-new-blocks.ts
@@ -3,15 +3,16 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import { ApiPromise } from "@polkadot/api";
+import { ApiPromise } from '@polkadot/api';
 
-export default function waitNewBlocks(api: ApiPromise, blocksCount: number = 1): Promise<void> {
-  const promise = new Promise<void>(async (resolve, reject) => {
+/* eslint no-async-promise-executor: "off" */
+export default function waitNewBlocks(api: ApiPromise, blocksCount = 1): Promise<void> {
+  const promise = new Promise<void>(async (resolve) => {
     
-    const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
-      if(blocksCount > 0) {
+    const unsubscribe = await api.rpc.chain.subscribeNewHeads(() => {
+      if (blocksCount > 0) {
         blocksCount--;
-      }else {
+      } else {
         unsubscribe();
         resolve();
       }
modifiedtests/src/toggleContractWhiteList.test.tsdiffbeforeafterboth
--- a/tests/src/toggleContractWhiteList.test.ts
+++ b/tests/src/toggleContractWhiteList.test.ts
@@ -3,17 +3,17 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import chai from "chai";
+import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from "./substrate/substrate-api";
-import privateKey from "./substrate/privateKey";
+import usingApi, { submitTransactionAsync, submitTransactionExpectFailAsync } from './substrate/substrate-api';
+import privateKey from './substrate/privateKey';
 import {
   deployFlipper,
-  getFlipValue
-} from "./util/contracthelpers";
+  getFlipValue,
+} from './util/contracthelpers';
 import {
-  getGenericResult
-} from "./util/helpers"
+  getGenericResult,
+} from './util/helpers';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -23,7 +23,7 @@
 
 describe('Integration Test toggleContractWhiteList', () => {
 
-  it(`Enable white list contract mode`, async () => {
+  it('Enable white list contract mode', async () => {
     await usingApi(async api => {
       const [contract, deployer] = await deployFlipper(api);
 
@@ -38,9 +38,9 @@
     });
   });
 
-  it(`Only whitelisted account can call contract`, async () => {
+  it('Only whitelisted account can call contract', async () => {
     await usingApi(async api => {
-      const bob = privateKey("//Bob");
+      const bob = privateKey('//Bob');
 
       const [contract, deployer] = await deployFlipper(api);
 
@@ -48,59 +48,59 @@
       const flip = contract.exec('flip', value, gasLimit);
       await submitTransactionAsync(bob, flip);
       const flipValueAfter = await getFlipValue(contract,deployer);
-      expect(flipValueAfter).to.be.eq(!flipValueBefore, `Anyone can call new contract.`);
+      expect(flipValueAfter).to.be.eq(!flipValueBefore, 'Anyone can call new contract.');
 
       const deployerCanFlip = async () => {
-        let flipValueBefore = await getFlipValue(contract, deployer);
+        const flipValueBefore = await getFlipValue(contract, deployer);
         const deployerFlip = contract.exec('flip', value, gasLimit);
         await submitTransactionAsync(deployer, deployerFlip);
         const aliceFlip1Response = await getFlipValue(contract, deployer);
-        expect(aliceFlip1Response).to.be.eq(!flipValueBefore, `Deployer always can flip.`);
+        expect(aliceFlip1Response).to.be.eq(!flipValueBefore, 'Deployer always can flip.');
       };
       await deployerCanFlip();
 
       flipValueBefore = await getFlipValue(contract, deployer);
       const enableWhiteListTx = api.tx.nft.toggleContractWhiteList(contract.address, true);
-      const enableResult = await submitTransactionAsync(deployer, enableWhiteListTx);
+      await submitTransactionAsync(deployer, enableWhiteListTx);
       const flipWithEnabledWhiteList = contract.exec('flip', value, gasLimit);
       await expect(submitTransactionExpectFailAsync(bob, flipWithEnabledWhiteList)).to.be.rejected;
       const flipValueAfterEnableWhiteList = await getFlipValue(contract, deployer);
-      expect(flipValueAfterEnableWhiteList).to.be.eq(flipValueBefore, `Enabling whitelist doesn't make it possible to call contract for everyone.`);
+      expect(flipValueAfterEnableWhiteList).to.be.eq(flipValueBefore, 'Enabling whitelist doesn\'t make it possible to call contract for everyone.');
 
       await deployerCanFlip();
 
       flipValueBefore = await getFlipValue(contract, deployer);
       const addBobToWhiteListTx = api.tx.nft.addToContractWhiteList(contract.address, bob.address);
-      const addBobResult = await submitTransactionAsync(deployer, addBobToWhiteListTx);
+      await submitTransactionAsync(deployer, addBobToWhiteListTx);
       const flipWithWhitelistedBob = contract.exec('flip', value, gasLimit);
       await submitTransactionAsync(bob, flipWithWhitelistedBob);
       const flipAfterWhiteListed = await getFlipValue(contract,deployer);
-      expect(flipAfterWhiteListed).to.be.eq(!flipValueBefore, `Bob was whitelisted, now he can flip.`);
+      expect(flipAfterWhiteListed).to.be.eq(!flipValueBefore, 'Bob was whitelisted, now he can flip.');
 
       await deployerCanFlip();
 
       flipValueBefore = await getFlipValue(contract, deployer);
       const removeBobFromWhiteListTx = api.tx.nft.removeFromContractWhiteList(contract.address, bob.address);
-      const removeBobResult = await submitTransactionAsync(deployer, removeBobFromWhiteListTx);
+      await submitTransactionAsync(deployer, removeBobFromWhiteListTx);
       const bobRemoved = contract.exec('flip', value, gasLimit);
       await expect(submitTransactionExpectFailAsync(bob, bobRemoved)).to.be.rejected;
       const afterBobRemoved = await getFlipValue(contract, deployer);
-      expect(afterBobRemoved).to.be.eq(flipValueBefore, `Bob can't call contract, now when he is removeed from white list.`);
+      expect(afterBobRemoved).to.be.eq(flipValueBefore, 'Bob can\'t call contract, now when he is removeed from white list.');
 
       await deployerCanFlip();
 
       flipValueBefore = await getFlipValue(contract, deployer);
       const disableWhiteListTx = api.tx.nft.toggleContractWhiteList(contract.address, false);
-      const disableWhiteListResult = await submitTransactionAsync(deployer, disableWhiteListTx);
+      await submitTransactionAsync(deployer, disableWhiteListTx);
       const whiteListDisabledFlip = contract.exec('flip', value, gasLimit);
       await submitTransactionAsync(bob, whiteListDisabledFlip);
       const afterWhiteListDisabled = await getFlipValue(contract,deployer);
-      expect(afterWhiteListDisabled).to.be.eq(!flipValueBefore, `Anyone can call contract with disabled whitelist.`);
+      expect(afterWhiteListDisabled).to.be.eq(!flipValueBefore, 'Anyone can call contract with disabled whitelist.');
 
     });
   });
 
-  it(`Enabling white list repeatedly should not produce errors`, async () => {
+  it('Enabling white list repeatedly should not produce errors', async () => {
     await usingApi(async api => {
       const [contract, deployer] = await deployFlipper(api);
 
@@ -123,10 +123,10 @@
 
 describe('Negative Integration Test toggleContractWhiteList', () => {
 
-  it(`Enable white list for a non-contract`, async () => {
+  it('Enable white list for a non-contract', async () => {
     await usingApi(async api => {
-      const alice = privateKey("//Alice");
-      const bobGuineaPig = privateKey("//Bob");
+      const alice = privateKey('//Alice');
+      const bobGuineaPig = privateKey('//Bob');
 
       const enabledBefore = (await api.query.nft.contractWhiteListEnabled(bobGuineaPig.address)).toJSON();
       const enableWhiteListTx = api.tx.nft.toggleContractWhiteList(bobGuineaPig.address, true);
@@ -138,10 +138,10 @@
     });
   });
 
-  it(`Enable white list using a non-owner address`, async () => {
+  it('Enable white list using a non-owner address', async () => {
     await usingApi(async api => {
-      const bob = privateKey("//Bob");
-      const [contract, deployer] = await deployFlipper(api);
+      const bob = privateKey('//Bob');
+      const [contract] = await deployFlipper(api);
 
       const enabledBefore = (await api.query.nft.contractWhiteListEnabled(contract.address)).toJSON();
       const enableWhiteListTx = api.tx.nft.toggleContractWhiteList(contract.address, true);
modifiedtests/src/transfer.nload.tsdiffbeforeafterboth
--- a/tests/src/transfer.nload.ts
+++ b/tests/src/transfer.nload.ts
@@ -1,9 +1,14 @@
-import { ApiPromise } from "@polkadot/api";
+//
+// This file is subject to the terms and conditions defined in
+// file 'LICENSE', which is part of this source code package.
+//
+
+import { ApiPromise } from '@polkadot/api';
 import { IKeyringPair } from '@polkadot/types/types';
-import privateKey from "./substrate/privateKey";
-import usingApi, { submitTransactionAsync } from "./substrate/substrate-api";
-import waitNewBlocks from "./substrate/wait-new-blocks";
-import { findUnusedAddresses } from "./util/helpers";
+import privateKey from './substrate/privateKey';
+import usingApi, { submitTransactionAsync } from './substrate/substrate-api';
+import waitNewBlocks from './substrate/wait-new-blocks';
+import { findUnusedAddresses } from './util/helpers';
 import * as cluster from 'cluster';
 import os from 'os';
 
@@ -12,102 +17,102 @@
 
 let counters: { [key: string]: number } = {};
 function increaseCounter(name: string, amount: number) {
-    if (!counters[name]) {
-        counters[name] = 0;
-    }
-    counters[name] += amount;
+  if (!counters[name]) {
+    counters[name] = 0;
+  }
+  counters[name] += amount;
 }
 function flushCounterToMaster() {
-    if (Object.keys(counters).length === 0) {
-        return;
-    }
+  if (Object.keys(counters).length === 0) {
+    return;
+  }
     process.send!(counters);
     counters = {};
 }
 
 async function distributeBalance(source: IKeyringPair, api: ApiPromise, totalAmount: bigint, stages: number) {
-    let accounts = [source];
-    // we don't need source in output array
-    const failedAccounts = [0];
+  const accounts = [source];
+  // we don't need source in output array
+  const failedAccounts = [0];
 
-    const finalUserAmount = 2 ** stages - 1;
-    accounts.push(...await findUnusedAddresses(api, finalUserAmount));
-    // findUnusedAddresses produces at least 1 request per user
-    increaseCounter('requests', finalUserAmount);
+  const finalUserAmount = 2 ** stages - 1;
+  accounts.push(...await findUnusedAddresses(api, finalUserAmount));
+  // findUnusedAddresses produces at least 1 request per user
+  increaseCounter('requests', finalUserAmount);
 
-    for (let stage = 0; stage < stages; stage++) {
-        let usersWithBalance = 2 ** stage;
-        let amount = totalAmount / (2n ** BigInt(stage)) - FEE * BigInt(stage);
-        // console.log(`Stage ${stage}/${stages}, ${usersWithBalance} => ${usersWithBalance * 2} = ${amount}`);
-        let txs = [];
-        for (let i = 0; i < usersWithBalance; i++) {
-            let newUser = accounts[i + usersWithBalance];
-            // console.log(`${accounts[i].address} => ${newUser.address} = ${amountToSplit}`);
-            const tx = api.tx.balances.transfer(newUser.address, amount);
-            txs.push(submitTransactionAsync(accounts[i], tx).catch(e => {
-                failedAccounts.push(i + usersWithBalance);
-                increaseCounter('txFailed', 1);
-            }));
-            increaseCounter('tx', 1);
-        }
-        await Promise.all(txs);
+  for (let stage = 0; stage < stages; stage++) {
+    const usersWithBalance = 2 ** stage;
+    const amount = totalAmount / (2n ** BigInt(stage)) - FEE * BigInt(stage);
+    // console.log(`Stage ${stage}/${stages}, ${usersWithBalance} => ${usersWithBalance * 2} = ${amount}`);
+    const txs = [];
+    for (let i = 0; i < usersWithBalance; i++) {
+      const newUser = accounts[i + usersWithBalance];
+      // console.log(`${accounts[i].address} => ${newUser.address} = ${amountToSplit}`);
+      const tx = api.tx.balances.transfer(newUser.address, amount);
+      txs.push(submitTransactionAsync(accounts[i], tx).catch(() => {
+        failedAccounts.push(i + usersWithBalance);
+        increaseCounter('txFailed', 1);
+      }));
+      increaseCounter('tx', 1);
     }
+    await Promise.all(txs);
+  }
 
-    for (let account of failedAccounts.reverse()) {
-        accounts.splice(account, 1);
-    }
-    return accounts;
+  for (const account of failedAccounts.reverse()) {
+    accounts.splice(account, 1);
+  }
+  return accounts;
 }
 
 if (cluster.isMaster) {
-    let testDone = false;
-    usingApi(async (api) => {
-        let prevCounters: { [key: string]: number } = {};
-        while (!testDone) {
-            for (let name in counters) {
-                if (!(name in prevCounters)) {
-                    prevCounters[name] = 0;
-                }
-                if(counters[name] === prevCounters[name]) {
-                    continue;
-                }
-                console.log(`${name.padEnd(15)} = ${counters[name] - prevCounters[name]}`);
-                prevCounters[name] = counters[name];
-            }
-            await waitNewBlocks(api, 1);
+  let testDone = false;
+  usingApi(async (api) => {
+    const prevCounters: { [key: string]: number } = {};
+    while (!testDone) {
+      for (const name in counters) {
+        if (!(name in prevCounters)) {
+          prevCounters[name] = 0;
+        }
+        if(counters[name] === prevCounters[name]) {
+          continue;
         }
-    });
-    let waiting: Promise<void>[] = [];
-    console.log(`Starting ${os.cpus().length} workers`);
-    usingApi(async (api) => {
-        const alice = privateKey('//Alice');
-        for (let id in os.cpus()) {
-            const WORKER_NAME = `//LoadWorker${id}_${Date.now()}`;
-            const workerAccount = privateKey(WORKER_NAME);
-            const tx = api.tx.balances.transfer(workerAccount.address, 400n * 10n ** 23n);
-            await submitTransactionAsync(alice, tx);
+        console.log(`${name.padEnd(15)} = ${counters[name] - prevCounters[name]}`);
+        prevCounters[name] = counters[name];
+      }
+      await waitNewBlocks(api, 1);
+    }
+  });
+  const waiting: Promise<void>[] = [];
+  console.log(`Starting ${os.cpus().length} workers`);
+  usingApi(async (api) => {
+    const alice = privateKey('//Alice');
+    for (const id in os.cpus()) {
+      const WORKER_NAME = `//LoadWorker${id}_${Date.now()}`;
+      const workerAccount = privateKey(WORKER_NAME);
+      const tx = api.tx.balances.transfer(workerAccount.address, 400n * 10n ** 23n);
+      await submitTransactionAsync(alice, tx);
 
-            let worker = cluster.fork({
-                WORKER_NAME,
-                STAGES: id + 2
-            });
-            worker.on('message', msg => {
-                for (let key in msg) {
-                    increaseCounter(key, msg[key]);
-                }
-            });
-            waiting.push(new Promise(res => worker.on('exit', res)));
+      const worker = cluster.fork({
+        WORKER_NAME,
+        STAGES: id + 2,
+      });
+      worker.on('message', msg => {
+        for (const key in msg) {
+          increaseCounter(key, msg[key]);
         }
-        await Promise.all(waiting);
-        testDone = true;
-    })
+      });
+      waiting.push(new Promise(res => worker.on('exit', res)));
+    }
+    await Promise.all(waiting);
+    testDone = true;
+  });
 } else {
-    increaseCounter('startedWorkers', 1);
-    usingApi(async (api) => {
-        await distributeBalance(privateKey(process.env.WORKER_NAME as string), api, 400n * 10n ** 22n, 10);
-    });
-    const interval = setInterval(() => {
-        flushCounterToMaster();
-    }, 100);
-    interval.unref();
+  increaseCounter('startedWorkers', 1);
+  usingApi(async (api) => {
+    await distributeBalance(privateKey(process.env.WORKER_NAME as string), api, 400n * 10n ** 22n, 10);
+  });
+  const interval = setInterval(() => {
+    flushCounterToMaster();
+  }, 100);
+  interval.unref();
 }
\ No newline at end of file
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -64,7 +64,7 @@
   });
 
   it('User can transfer owned token', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       const Alice = privateKey('//Alice');
       const Bob = privateKey('//Bob');
       // nft
@@ -77,17 +77,23 @@
       await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, Alice, Bob, 1, 'Fungible');
       // reFungible
       const reFungibleCollectionId = await
-        createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
-      await transferExpectSuccess(reFungibleCollectionId,
-        newReFungibleTokenId, Alice, Bob, 100, 'ReFungible');
+      await transferExpectSuccess(
+        reFungibleCollectionId,
+        newReFungibleTokenId,
+        Alice,
+        Bob,
+        100,
+        'ReFungible',
+      );
     });
   });
 });
 
 describe('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
   before(async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       Alice = privateKey('//Alice');
       Bob = privateKey('//Bob');
       Charlie = privateKey('//Charlie');
@@ -119,11 +125,17 @@
     await transferExpectFail(fungibleCollectionId, newFungibleTokenId, Alice, Bob, 1, 'Fungible');
     // reFungible
     const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
     await destroyCollectionExpectSuccess(reFungibleCollectionId);
-    await transferExpectFail(reFungibleCollectionId,
-      newReFungibleTokenId, Alice, Bob, 1, 'ReFungible');
+    await transferExpectFail(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      Alice,
+      Bob,
+      1,
+      'ReFungible',
+    );
   });
   it('Transfer with not existed item_id', async () => {
     // nft
@@ -134,9 +146,15 @@
     await transferExpectFail(fungibleCollectionId, 2, Alice, Bob, 1, 'Fungible');
     // reFungible
     const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-    await transferExpectFail(reFungibleCollectionId,
-      2, Alice, Bob, 1, 'ReFungible');
+    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    await transferExpectFail(
+      reFungibleCollectionId,
+      2,
+      Alice,
+      Bob,
+      1,
+      'ReFungible',
+    );
   });
   it('Transfer with deleted item_id', async () => {
     // nft
@@ -151,11 +169,17 @@
     await transferExpectFail(fungibleCollectionId, newFungibleTokenId, Alice, Bob, 1, 'Fungible');
     // reFungible
     const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
     await burnItemExpectSuccess(Alice, reFungibleCollectionId, newReFungibleTokenId, 1);
-    await transferExpectFail(reFungibleCollectionId,
-      newReFungibleTokenId, Alice, Bob, 1, 'ReFungible');
+    await transferExpectFail(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      Alice,
+      Bob,
+      1,
+      'ReFungible',
+    );
   });
   it('Transfer with recipient that is not owner', async () => {
     // nft
@@ -168,9 +192,15 @@
     await transferExpectFail(fungibleCollectionId, newFungibleTokenId, Charlie, Bob, 1, 'Fungible');
     // reFungible
     const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
-    await transferExpectFail(reFungibleCollectionId,
-      newReFungibleTokenId, Charlie, Bob, 1, 'ReFungible');
+    await transferExpectFail(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      Charlie,
+      Bob,
+      1,
+      'ReFungible',
+    );
   });
 });
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- a/tests/src/transferFrom.test.ts
+++ b/tests/src/transferFrom.test.ts
@@ -14,7 +14,6 @@
   createCollectionExpectSuccess,
   createFungibleItemExpectSuccess,
   createItemExpectSuccess,
-  destroyCollectionExpectSuccess,
   getAllowance,
   transferFromExpectFail,
   transferFromExpectSuccess,
@@ -31,7 +30,7 @@
   let Charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       Alice = privateKey('//Alice');
       Bob = privateKey('//Bob');
       Charlie = privateKey('//Charlie');
@@ -39,7 +38,7 @@
   });
 
   it('Execute the extrinsic and check nftItemList - owner of token', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -52,13 +51,21 @@
       const newFungibleTokenId = await createItemExpectSuccess(Alice, fungibleCollectionId, 'Fungible');
       await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, Alice, Bob);
       await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, Bob, Alice, Charlie, 1, 'Fungible');
+
       // reFungible
       const reFungibleCollectionId = await
-        createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
       await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, Alice, Bob, 100);
-      await transferFromExpectSuccess(reFungibleCollectionId,
-        newReFungibleTokenId, Bob, Alice, Charlie, 100, 'ReFungible');
+      await transferFromExpectSuccess(
+        reFungibleCollectionId,
+        newReFungibleTokenId,
+        Bob,
+        Alice,
+        Charlie,
+        100,
+        'ReFungible',
+      );
     });
   });
 
@@ -92,7 +99,7 @@
   let Charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async (api) => {
+    await usingApi(async () => {
       Alice = privateKey('//Alice');
       Bob = privateKey('//Bob');
       Charlie = privateKey('//Charlie');
@@ -139,7 +146,7 @@
   }); */
 
   it('transferFrom for not approved address', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -152,15 +159,21 @@
       await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, Bob, Alice, Charlie, 1);
       // reFungible
       const reFungibleCollectionId = await
-        createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
-      await transferFromExpectFail(reFungibleCollectionId,
-        newReFungibleTokenId, Bob, Alice, Charlie, 1);
+      await transferFromExpectFail(
+        reFungibleCollectionId,
+        newReFungibleTokenId,
+        Bob,
+        Alice,
+        Charlie,
+        1,
+      );
     });
   });
 
   it('transferFrom incorrect token count', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -175,16 +188,22 @@
       await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, Bob, Alice, Charlie, 2);
       // reFungible
       const reFungibleCollectionId = await
-        createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
       await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, Alice, Bob);
-      await transferFromExpectFail(reFungibleCollectionId,
-        newReFungibleTokenId, Bob, Alice, Charlie, 2);
+      await transferFromExpectFail(
+        reFungibleCollectionId,
+        newReFungibleTokenId,
+        Bob,
+        Alice,
+        Charlie,
+        2,
+      );
     });
   });
 
   it('execute transferFrom from account that is not owner of collection', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       const Dave = privateKey('//Dave');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
@@ -211,7 +230,7 @@
       }
       // reFungible
       const reFungibleCollectionId = await
-        createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
       try {
         await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, Dave, Bob);
@@ -223,7 +242,7 @@
     });
   });
   it( 'transferFrom burnt token before approve NFT', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -233,7 +252,7 @@
     });
   });
   it( 'transferFrom burnt token before approve Fungible', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
       const newFungibleTokenId = await createItemExpectSuccess(Alice, fungibleCollectionId, 'Fungible');
       await burnItemExpectSuccess(Alice, fungibleCollectionId, 1, 10);
@@ -243,7 +262,7 @@
     });
   }); 
   it( 'transferFrom burnt token before approve ReFungible', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
       await burnItemExpectSuccess(Alice, reFungibleCollectionId, newReFungibleTokenId, 1);
@@ -254,7 +273,7 @@
   });
   
   it( 'transferFrom burnt token after approve NFT', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(Alice, nftCollectionId, 'NFT');
@@ -264,7 +283,7 @@
     });
   });
   it( 'transferFrom burnt token after approve Fungible', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
       const newFungibleTokenId = await createItemExpectSuccess(Alice, fungibleCollectionId, 'Fungible');
       await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, Alice, Bob);
@@ -274,7 +293,7 @@
     });
   }); 
   it( 'transferFrom burnt token after approve ReFungible', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async () => {
       const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(Alice, reFungibleCollectionId, 'ReFungible');
       await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, Alice, Bob);
modifiedtests/src/util/contracthelpers.tsdiffbeforeafterboth
--- a/tests/src/util/contracthelpers.ts
+++ b/tests/src/util/contracthelpers.ts
@@ -3,13 +3,13 @@
 // file 'LICENSE', which is part of this source code package.
 //
 
-import chai from "chai";
+import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import { submitTransactionAsync, submitTransactionExpectFailAsync } from "../substrate/substrate-api";
-import fs from "fs";
-import { Abi, BlueprintPromise as Blueprint, CodePromise, ContractPromise as Contract } from "@polkadot/api-contract";
-import { IKeyringPair } from "@polkadot/types/types";
-import { ApiPromise, Keyring } from "@polkadot/api";
+import { submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';
+import fs from 'fs';
+import { Abi, CodePromise, ContractPromise as Contract } from '@polkadot/api-contract';
+import { IKeyringPair } from '@polkadot/types/types';
+import { ApiPromise, Keyring } from '@polkadot/api';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -20,8 +20,9 @@
 const gasLimit = '200000000000';
 const endowment = '100000000000000000';
 
-function deployContract(alice: IKeyringPair, code: CodePromise, constructor: string = 'default', ...args: any[]): Promise<Contract> {
-  return new Promise<Contract>(async (resolve, reject) => {
+/* eslint no-async-promise-executor: "off" */
+function deployContract(alice: IKeyringPair, code: CodePromise, constructor = 'default', ...args: any[]): Promise<Contract> {
+  return new Promise<Contract>(async (resolve) => {
     const unsub = await (code as any)
       .tx[constructor]({value: endowment, gasLimit}, ...args)
       .signAndSend(alice, (result: any) => {
@@ -30,7 +31,7 @@
           resolve((result as any).contract);
           unsub();
         }
-      })
+      });
   });
 }
 
@@ -40,7 +41,7 @@
 
   // Transfer balance to it
   const keyring = new Keyring({ type: 'sr25519' });
-  const alice = keyring.addFromUri(`//Alice`);
+  const alice = keyring.addFromUri('//Alice');
   let amount = new BigNumber(endowment);
   amount = amount.plus(100e15);
   const tx = api.tx.balances.transfer(deployer.address, amount.toFixed());
@@ -71,7 +72,7 @@
   const result = await contract.query.get(deployer.address, value, gasLimit);
 
   if(!result.result.isOk) {
-    throw `Failed to get flipper value`;
+    throw 'Failed to get flipper value';
   }
   return (result.result.asOk.data[0] == 0x00) ? false : true;
 }
@@ -87,19 +88,6 @@
 export async function toggleFlipValueExpectFailure(sender: IKeyringPair, contract: Contract) {
   const tx = contract.tx.flip(value, gasLimit);
   await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
-}
-
-function instantiateTransferContract(alice: IKeyringPair, blueprint: Blueprint) : Promise<any> {
-  return new Promise<any>(async (resolve, reject) => {
-    const unsub = await blueprint.tx
-    .default(endowment, gasLimit)
-    .signAndSend(alice, (result) => {
-      if (result.status.isInBlock || result.status.isFinalized) {
-        unsub();
-        resolve(result);
-      }
-    });    
-  });
 }
 
 export async function deployTransferContract(api: ApiPromise): Promise<[Contract, IKeyringPair]> {
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
before · tests/src/util/helpers.ts
1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56import { ApiPromise, Keyring } from '@polkadot/api';7import { Enum, Struct } from '@polkadot/types/codec';8import type { AccountId, BlockNumber, Call, EventRecord } from '@polkadot/types/interfaces';9import { u128 } from '@polkadot/types/primitive';10import { IKeyringPair } from '@polkadot/types/types';11import { evmToAddress } from '@polkadot/util-crypto';12import { BigNumber } from 'bignumber.js';13import BN from 'bn.js';14import chai from 'chai';15import chaiAsPromised from 'chai-as-promised';16import { alicesPublicKey, nullPublicKey } from '../accounts';17import privateKey from '../substrate/privateKey';18import { default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync } from '../substrate/substrate-api';19import { ICollectionInterface } from '../types';20import { hexToStr, strToUTF16, utf16ToStr } from './util';21import { Compact, Option, Raw, Vec } from '@polkadot/types/codec';22// import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, EcdsaSignature, Ed25519Signature, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV1, ExtrinsicPayloadV2, ExtrinsicPayloadV3, ExtrinsicPayloadV4, ExtrinsicSignatureV1, ExtrinsicSignatureV2, ExtrinsicSignatureV3, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV1, ExtrinsicV2, ExtrinsicV3, ExtrinsicV4, Hash, Header, ImmortalEra, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, Moment, MortalEra, MultiSignature, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Seal, SealV0, Signature, SignedBlock, SignerPayload, Sr25519Signature, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';2324chai.use(chaiAsPromised);25const expect = chai.expect;2627export type CrossAccountId = {28  substrate: string,29} | {30  ethereum: string,31};32export function normalizeAccountId(input: string | CrossAccountId | IKeyringPair): CrossAccountId {33  if (typeof input === 'string')34    return { substrate: input };35  if ('address' in input) {36    return { substrate: input.address };37  }38  if ('ethereum' in input) {39    input.ethereum = input.ethereum.toLowerCase();40  }41  return input;42}43export function toSubstrateAddress(input: string | CrossAccountId | IKeyringPair): string {44  input = normalizeAccountId(input);45  if ('substrate' in input) {46    return input.substrate;47  } else {48    return evmToAddress(input.ethereum);49  }50}5152export const U128_MAX = (1n << 128n) - 1n;5354type GenericResult = {55  success: boolean,56};5758interface CreateCollectionResult {59  success: boolean;60  collectionId: number;61}6263interface CreateItemResult {64  success: boolean;65  collectionId: number;66  itemId: number;67  recipient?: CrossAccountId;68}6970interface TransferResult {71  success: boolean;72  collectionId: number;73  itemId: number;74  sender?: CrossAccountId;75  recipient?: CrossAccountId;76  value: bigint;77}7879interface IReFungibleOwner {80  Fraction: BN;81  Owner: number[];82}8384interface ITokenDataType {85  Owner: number[];86  ConstData: number[];87  VariableData: number[];88}8990interface IFungibleTokenDataType {91  Value: BN;92}9394interface IGetMessage {95  checkMsgNftMethod: string;96  checkMsgTrsMethod: string;97  checkMsgSysMethod: string;98}99100export interface IReFungibleTokenDataType {101  Owner: IReFungibleOwner[];102  ConstData: number[];103  VariableData: number[];104}105106export function nftEventMessage(events: EventRecord[]): IGetMessage {107  let checkMsgNftMethod: string = '';108  let checkMsgTrsMethod: string = '';109  let checkMsgSysMethod: string = '';110  events.forEach(({ event: { method, section } }) => {111    if (section === 'nft') {112      checkMsgNftMethod = method;113    } else if (section === 'treasury') {114      checkMsgTrsMethod = method;115    } else if (section === 'system') {116      checkMsgSysMethod = method;117    } else { return null; }118  });119  const result: IGetMessage = {120    checkMsgNftMethod,121    checkMsgTrsMethod,122    checkMsgSysMethod,123  };124  return result;125}126127export function getGenericResult(events: EventRecord[]): GenericResult {128  const result: GenericResult = {129    success: false,130  };131  events.forEach(({ phase, event: { data, method, section } }) => {132    // console.log(`    ${phase}: ${section}.${method}:: ${data}`);133    if (method === 'ExtrinsicSuccess') {134      result.success = true;135    }136  });137  return result;138}139140141142export function getCreateCollectionResult(events: EventRecord[]): CreateCollectionResult {143  let success = false;144  let collectionId: number = 0;145  events.forEach(({ phase, event: { data, method, section } }) => {146    // console.log(`    ${phase}: ${section}.${method}:: ${data}`);147    if (method == 'ExtrinsicSuccess') {148      success = true;149    } else if ((section == 'nft') && (method == 'CollectionCreated')) {150      collectionId = parseInt(data[0].toString());151    }152  });153  const result: CreateCollectionResult = {154    success,155    collectionId,156  };157  return result;158}159160export function getCreateItemResult(events: EventRecord[]): CreateItemResult {161  let success = false;162  let collectionId: number = 0;163  let itemId: number = 0;164  let recipient;165  events.forEach(({ phase, event: { data, method, section } }) => {166    // console.log(`    ${phase}: ${section}.${method}:: ${data}`);167    if (method == 'ExtrinsicSuccess') {168      success = true;169    } else if ((section == 'nft') && (method == 'ItemCreated')) {170      collectionId = parseInt(data[0].toString());171      itemId = parseInt(data[1].toString());172      recipient = data[2].toJSON();173    }174  });175  const result: CreateItemResult = {176    success,177    collectionId,178    itemId,179    recipient,180  };181  return result;182}183184export function getTransferResult(events: EventRecord[]): TransferResult {185  const result: TransferResult = {186    success: false,187    collectionId: 0,188    itemId: 0,189    value: 0n,190  };191192  events.forEach(({ event: { data, method, section } }) => {193    if (method === 'ExtrinsicSuccess') {194      result.success = true;195    } else if (section === 'nft' && method === 'Transfer') {196      result.collectionId = +data[0].toString();197      result.itemId = +data[1].toString();198      result.sender = data[2].toJSON() as CrossAccountId;199      result.recipient = data[3].toJSON() as CrossAccountId;200      result.value = BigInt(data[4].toString());201    }202  });203204  return result;205}206207interface Invalid {208  type: 'Invalid';209}210211interface Nft {212  type: 'NFT';213}214215interface Fungible {216  type: 'Fungible';217  decimalPoints: number;218}219220interface ReFungible {221  type: 'ReFungible';222}223224type CollectionMode = Nft | Fungible | ReFungible | Invalid;225226export type CreateCollectionParams = {227  mode: CollectionMode,228  name: string,229  description: string,230  tokenPrefix: string,231};232233const defaultCreateCollectionParams: CreateCollectionParams = {234  description: 'description',235  mode: { type: 'NFT' },236  name: 'name',237  tokenPrefix: 'prefix',238}239240export async function createCollectionExpectSuccess(params: Partial<CreateCollectionParams> = {}): Promise<number> {241  const { name, description, mode, tokenPrefix } = { ...defaultCreateCollectionParams, ...params };242243  let collectionId: number = 0;244  await usingApi(async (api) => {245    // Get number of collections before the transaction246    const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString(), 10);247248    // Run the CreateCollection transaction249    const alicePrivateKey = privateKey('//Alice');250251    let modeprm = {};252    if (mode.type === 'NFT') {253      modeprm = { nft: null };254    } else if (mode.type === 'Fungible') {255      modeprm = { fungible: mode.decimalPoints };256    } else if (mode.type === 'ReFungible') {257      modeprm = { refungible: null };258    } else if (mode.type === 'Invalid') {259      modeprm = { invalid: null };260    }261262    const tx = api.tx.nft.createCollection(strToUTF16(name), strToUTF16(description), strToUTF16(tokenPrefix), modeprm);263    const events = await submitTransactionAsync(alicePrivateKey, tx);264    const result = getCreateCollectionResult(events);265266    // Get number of collections after the transaction267    const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString(), 10);268269    // Get the collection270    const collection: any = (await api.query.nft.collectionById(result.collectionId) as any).toJSON();271272    // What to expect273    // tslint:disable-next-line:no-unused-expression274    expect(result.success).to.be.true;275    expect(result.collectionId).to.be.equal(BcollectionCount);276    // tslint:disable-next-line:no-unused-expression277    expect(collection).to.be.not.null;278    expect(BcollectionCount).to.be.equal(AcollectionCount + 1, 'Error: NFT collection NOT created.');279    expect(collection.Owner).to.be.equal(toSubstrateAddress(alicesPublicKey));280    expect(utf16ToStr(collection.Name)).to.be.equal(name);281    expect(utf16ToStr(collection.Description)).to.be.equal(description);282    expect(hexToStr(collection.TokenPrefix)).to.be.equal(tokenPrefix);283284    collectionId = result.collectionId;285  });286287  return collectionId;288}289290export async function createCollectionExpectFailure(params: Partial<CreateCollectionParams> = {}) {291  const { name, description, mode, tokenPrefix } = { ...defaultCreateCollectionParams, ...params };292293  let modeprm = {};294  if (mode.type === 'NFT') {295    modeprm = { nft: null };296  } else if (mode.type === 'Fungible') {297    modeprm = { fungible: mode.decimalPoints };298  } else if (mode.type === 'ReFungible') {299    modeprm = { refungible: null };300  } else if (mode.type === 'Invalid') {301    modeprm = { invalid: null };302  }303304  await usingApi(async (api) => {305    // Get number of collections before the transaction306    const AcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());307308    // Run the CreateCollection transaction309    const alicePrivateKey = privateKey('//Alice');310    const tx = api.tx.nft.createCollection(strToUTF16(name), strToUTF16(description), strToUTF16(tokenPrefix), modeprm);311    const events = await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;312    const result = getCreateCollectionResult(events);313314    // Get number of collections after the transaction315    const BcollectionCount = parseInt((await api.query.nft.createdCollectionCount()).toString());316317    // What to expect318    // tslint:disable-next-line:no-unused-expression319    expect(result.success).to.be.false;320    expect(BcollectionCount).to.be.equal(AcollectionCount, 'Error: Collection with incorrect data created.');321  });322}323324export async function findUnusedAddress(api: ApiPromise, seedAddition = ''): Promise<IKeyringPair> {325  let bal = new BigNumber(0);326  let unused;327  do {328    const randomSeed = 'seed' + Math.floor(Math.random() * Math.floor(10000)) + seedAddition;329    const keyring = new Keyring({ type: 'sr25519' });330    unused = keyring.addFromUri(`//${randomSeed}`);331    bal = new BigNumber((await api.query.system.account(unused.address)).data.free.toString());332  } while (bal.toFixed() != '0');333  return unused;334}335336export async function getAllowance(collectionId: number, tokenId: number, owner: string, approved: string) {337  return await usingApi(async (api) => {338    const bn = await api.query.nft.allowances(collectionId, [tokenId, owner, approved]) as unknown as BN;339    return BigInt(bn.toString());340  });341}342343export function findUnusedAddresses(api: ApiPromise, amount: number): Promise<IKeyringPair[]> {344  return Promise.all(new Array(amount).fill(null).map(() => findUnusedAddress(api, '_' + Date.now())));345}346347export async function findNotExistingCollection(api: ApiPromise): Promise<number> {348  const totalNumber = parseInt((await api.query.nft.createdCollectionCount()).toString(), 10) as unknown as number;349  const newCollection: number = totalNumber + 1;350  return newCollection;351}352353function getDestroyResult(events: EventRecord[]): boolean {354  let success: boolean = false;355  events.forEach(({ phase, event: { data, method, section } }) => {356    // console.log(`    ${phase}: ${section}.${method}:: ${data}`);357    if (method == 'ExtrinsicSuccess') {358      success = true;359    }360  });361  return success;362}363364export async function destroyCollectionExpectFailure(collectionId: number, senderSeed: string = '//Alice') {365  await usingApi(async (api) => {366    // Run the DestroyCollection transaction367    const alicePrivateKey = privateKey(senderSeed);368    const tx = api.tx.nft.destroyCollection(collectionId);369    await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;370  });371}372373export async function destroyCollectionExpectSuccess(collectionId: number, senderSeed: string = '//Alice') {374  await usingApi(async (api) => {375    // Run the DestroyCollection transaction376    const alicePrivateKey = privateKey(senderSeed);377    const tx = api.tx.nft.destroyCollection(collectionId);378    const events = await submitTransactionAsync(alicePrivateKey, tx);379    const result = getDestroyResult(events);380381    // Get the collection382    const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();383384    // What to expect385    expect(result).to.be.true;386    expect(collection).to.be.null;387  });388}389390export async function queryCollectionLimits(collectionId: number) {391  return await usingApi(async (api) => {392    return ((await api.query.nft.collectionById(collectionId)).toJSON() as any).Limits;393  });394}395396export async function setCollectionLimitsExpectSuccess(sender: IKeyringPair, collectionId: number, limits: any) {397  await usingApi(async (api) => {398    const oldLimits = await queryCollectionLimits(collectionId);399    const newLimits = { ...oldLimits as any, ...limits };400    const tx = api.tx.nft.setCollectionLimits(collectionId, newLimits);401    const events = await submitTransactionAsync(sender, tx);402    const result = getGenericResult(events);403404    expect(result.success).to.be.true;405  });406}407408export async function setCollectionLimitsExpectFailure(sender: IKeyringPair, collectionId: number, limits: any) {409  await usingApi(async (api) => {410    const oldLimits = await queryCollectionLimits(collectionId);411    const newLimits = { ...oldLimits as any, ...limits };412    const tx = api.tx.nft.setCollectionLimits(collectionId, newLimits);413    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;414    const result = getGenericResult(events);415416    expect(result.success).to.be.false;417  });418}419420export async function setCollectionSponsorExpectSuccess(collectionId: number, sponsor: string) {421  await usingApi(async (api) => {422423    // Run the transaction424    const alicePrivateKey = privateKey('//Alice');425    const tx = api.tx.nft.setCollectionSponsor(collectionId, sponsor);426    const events = await submitTransactionAsync(alicePrivateKey, tx);427    const result = getGenericResult(events);428429    // Get the collection430    const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();431432    // What to expect433    expect(result.success).to.be.true;434    expect(collection.Sponsorship).to.deep.equal({435      unconfirmed: sponsor,436    });437  });438}439440export async function removeCollectionSponsorExpectSuccess(collectionId: number) {441  await usingApi(async (api) => {442443    // Run the transaction444    const alicePrivateKey = privateKey('//Alice');445    const tx = api.tx.nft.removeCollectionSponsor(collectionId);446    const events = await submitTransactionAsync(alicePrivateKey, tx);447    const result = getGenericResult(events);448449    // Get the collection450    const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();451452    // What to expect453    expect(result.success).to.be.true;454    expect(collection.Sponsorship).to.be.deep.equal({ disabled: null });455  });456}457458export async function removeCollectionSponsorExpectFailure(collectionId: number) {459  await usingApi(async (api) => {460461    // Run the transaction462    const alicePrivateKey = privateKey('//Alice');463    const tx = api.tx.nft.removeCollectionSponsor(collectionId);464    await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;465  });466}467468export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed: string = '//Alice') {469  await usingApi(async (api) => {470471    // Run the transaction472    const alicePrivateKey = privateKey(senderSeed);473    const tx = api.tx.nft.setCollectionSponsor(collectionId, sponsor);474    await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;475  });476}477478export async function confirmSponsorshipExpectSuccess(collectionId: number, senderSeed: string = '//Alice') {479  await usingApi(async (api) => {480481    // Run the transaction482    const sender = privateKey(senderSeed);483    const tx = api.tx.nft.confirmSponsorship(collectionId);484    const events = await submitTransactionAsync(sender, tx);485    const result = getGenericResult(events);486487    // Get the collection488    const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();489490    // What to expect491    expect(result.success).to.be.true;492    expect(collection.Sponsorship).to.be.deep.equal({493      confirmed: sender.address,494    });495  });496}497498499export async function confirmSponsorshipExpectFailure(collectionId: number, senderSeed: string = '//Alice') {500  await usingApi(async (api) => {501502    // Run the transaction503    const sender = privateKey(senderSeed);504    const tx = api.tx.nft.confirmSponsorship(collectionId);505    await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;506  });507}508509export async function enableContractSponsoringExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, enable: boolean) {510  await usingApi(async (api) => {511    const tx = api.tx.nft.enableContractSponsoring(contractAddress, enable);512    const events = await submitTransactionAsync(sender, tx);513    const result = getGenericResult(events);514515    expect(result.success).to.be.true;516  });517}518519export async function enableContractSponsoringExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, enable: boolean) {520  await usingApi(async (api) => {521    const tx = api.tx.nft.enableContractSponsoring(contractAddress, enable);522    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;523    const result = getGenericResult(events);524525    expect(result.success).to.be.false;526  });527}528529export async function setContractSponsoringRateLimitExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, rateLimit: number) {530  await usingApi(async (api) => {531    const tx = api.tx.nft.setContractSponsoringRateLimit(contractAddress, rateLimit);532    const events = await submitTransactionAsync(sender, tx);533    const result = getGenericResult(events);534535    expect(result.success).to.be.true;536  });537}538539export async function setContractSponsoringRateLimitExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, rateLimit: number) {540  await usingApi(async (api) => {541    const tx = api.tx.nft.setContractSponsoringRateLimit(contractAddress, rateLimit);542    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;543    const result = getGenericResult(events);544545    expect(result.success).to.be.false;546  });547}548549export async function toggleContractWhitelistExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, enabled: boolean) {550  await usingApi(async (api) => {551    const tx = api.tx.nft.toggleContractWhiteList(contractAddress, true);552    const events = await submitTransactionAsync(sender, tx);553    const result = getGenericResult(events);554555    expect(result.success).to.be.true;556  });557}558559export async function isWhitelistedInContract(contractAddress: AccountId | string, user: string) {560  let whitelisted: boolean = false;561  await usingApi(async (api) => {562    whitelisted = (await api.query.nft.contractWhiteList(contractAddress, user)).toJSON() as boolean;563  });564  return whitelisted;565}566567export async function addToContractWhiteListExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, user: AccountId | string) {568  await usingApi(async (api) => {569    const tx = api.tx.nft.addToContractWhiteList(contractAddress.toString(), user.toString());570    const events = await submitTransactionAsync(sender, tx);571    const result = getGenericResult(events);572573    expect(result.success).to.be.true;574  });575}576577export async function removeFromContractWhiteListExpectSuccess(sender: IKeyringPair, contractAddress: AccountId | string, user: AccountId | string) {578  await usingApi(async (api) => {579    const tx = api.tx.nft.removeFromContractWhiteList(contractAddress.toString(), user.toString());580    const events = await submitTransactionAsync(sender, tx);581    const result = getGenericResult(events);582583    expect(result.success).to.be.true;584  });585}586587export async function removeFromContractWhiteListExpectFailure(sender: IKeyringPair, contractAddress: AccountId | string, user: AccountId | string) {588  await usingApi(async (api) => {589    const tx = api.tx.nft.removeFromContractWhiteList(contractAddress.toString(), user.toString());590    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;591    const result = getGenericResult(events);592593    expect(result.success).to.be.false;594  });595}596597export async function setVariableMetaDataExpectSuccess(sender: IKeyringPair, collectionId: number, itemId: number, data: number[]) {598  await usingApi(async (api) => {599    const tx = api.tx.nft.setVariableMetaData(collectionId, itemId, '0x' + Buffer.from(data).toString('hex'));600    const events = await submitTransactionAsync(sender, tx);601    const result = getGenericResult(events);602603    expect(result.success).to.be.true;604  });605}606607export async function setVariableMetaDataExpectFailure(sender: IKeyringPair, collectionId: number, itemId: number, data: number[]) {608  await usingApi(async (api) => {609    const tx = api.tx.nft.setVariableMetaData(collectionId, itemId, '0x' + Buffer.from(data).toString('hex'));610    await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;611  });612}613614export async function setOffchainSchemaExpectSuccess(sender: IKeyringPair, collectionId: number, data: number[]) {615  await usingApi(async (api) => {616    const tx = api.tx.nft.setOffchainSchema(collectionId, '0x' + Buffer.from(data).toString('hex'));617    const events = await submitTransactionAsync(sender, tx);618    const result = getGenericResult(events);619620    expect(result.success).to.be.true;621  });622}623624export async function setOffchainSchemaExpectFailure(sender: IKeyringPair, collectionId: number, data: number[]) {625  await usingApi(async (api) => {626    const tx = api.tx.nft.setOffchainSchema(collectionId, '0x' + Buffer.from(data).toString('hex'));627    await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;628  });629}630631export interface CreateFungibleData {632  readonly Value: bigint;633}634635export interface CreateReFungibleData { }636export interface CreateNftData { }637638export type CreateItemData = {639  NFT: CreateNftData;640} | {641  Fungible: CreateFungibleData;642} | {643  ReFungible: CreateReFungibleData;644};645646export async function burnItemExpectSuccess(owner: IKeyringPair, collectionId: number, tokenId: number, value = 0) {647  await usingApi(async (api) => {648    const tx = api.tx.nft.burnItem(collectionId, tokenId, value);649    const events = await submitTransactionAsync(owner, tx);650    const result = getGenericResult(events);651    // Get the item652    const item: any = (await api.query.nft.nftItemList(collectionId, tokenId)).toJSON();653    // What to expect654    // tslint:disable-next-line:no-unused-expression655    expect(result.success).to.be.true;656    // tslint:disable-next-line:no-unused-expression657    expect(item).to.be.null;658  });659}660661export async function662  approveExpectSuccess(collectionId: number,663    tokenId: number, owner: IKeyringPair, approved: IKeyringPair | CrossAccountId | string, amount: number | bigint = 1) {664  await usingApi(async (api: ApiPromise) => {665    approved = normalizeAccountId(approved);666    const allowanceBefore =667      await api.query.nft.allowances(collectionId, [tokenId, owner.address, toSubstrateAddress(approved)]) as unknown as BN;668    const approveNftTx = api.tx.nft.approve(approved, collectionId, tokenId, amount);669    const events = await submitTransactionAsync(owner, approveNftTx);670    const result = getCreateItemResult(events);671    // tslint:disable-next-line:no-unused-expression672    expect(result.success).to.be.true;673    const allowanceAfter =674      await api.query.nft.allowances(collectionId, [tokenId, owner.address, toSubstrateAddress(approved)]) as unknown as BN;675    expect(allowanceAfter.sub(allowanceBefore).toString()).to.be.equal(amount.toString());676  });677}678679export async function680  transferFromExpectSuccess(collectionId: number,681    tokenId: number,682    accountApproved: IKeyringPair,683    accountFrom: IKeyringPair | CrossAccountId,684    accountTo: IKeyringPair | CrossAccountId,685    value: number | bigint = 1,686    type: string = 'NFT') {687  await usingApi(async (api: ApiPromise) => {688    const to = normalizeAccountId(accountTo);689    let balanceBefore = new BN(0);690    if (type === 'Fungible') {691      balanceBefore = await api.query.nft.balance(collectionId, toSubstrateAddress(to)) as unknown as BN;692    }693    const transferFromTx = api.tx.nft.transferFrom(694      normalizeAccountId(accountFrom), to, collectionId, tokenId, value);695    const events = await submitTransactionAsync(accountApproved, transferFromTx);696    const result = getCreateItemResult(events);697    // tslint:disable-next-line:no-unused-expression698    expect(result.success).to.be.true;699    if (type === 'NFT') {700      const nftItemData = (await api.query.nft.nftItemList(collectionId, tokenId) as any).toJSON() as ITokenDataType;701      expect(nftItemData.Owner).to.be.deep.equal(to);702    }703    if (type === 'Fungible') {704      const balanceAfter = (await api.query.nft.fungibleItemList(collectionId, toSubstrateAddress(to)) as any).Value as unknown as BN;705      expect(balanceAfter.sub(balanceBefore).toString()).to.be.equal(value.toString());706    }707    if (type === 'ReFungible') {708      const nftItemData =709        (await api.query.nft.reFungibleItemList(collectionId, tokenId) as any).toJSON() as IReFungibleTokenDataType;710      expect(nftItemData.Owner[0].Owner).to.be.deep.equal(normalizeAccountId(to));711      expect(nftItemData.Owner[0].Fraction).to.be.equal(value);712    }713  });714}715716export async function717  transferFromExpectFail(collectionId: number,718    tokenId: number,719    accountApproved: IKeyringPair,720    accountFrom: IKeyringPair,721    accountTo: IKeyringPair,722    value: number | bigint = 1) {723  await usingApi(async (api: ApiPromise) => {724    const transferFromTx = api.tx.nft.transferFrom(725      normalizeAccountId(accountFrom.address), normalizeAccountId(accountTo.address), collectionId, tokenId, value);726    const events = await expect(submitTransactionExpectFailAsync(accountApproved, transferFromTx)).to.be.rejected;727    const result = getCreateCollectionResult(events);728    // tslint:disable-next-line:no-unused-expression729    expect(result.success).to.be.false;730  });731}732733async function getBlockNumber(api: ApiPromise): Promise<number> {734  return new Promise<number>(async (resolve, reject) => {735    const unsubscribe = await api.rpc.chain.subscribeNewHeads((head) => {736        unsubscribe();737        resolve(head.number.toNumber());738    });739  });740}741742export async function743scheduleTransferExpectSuccess(collectionId: number,744                      tokenId: number,745                      sender: IKeyringPair,746                      recipient: IKeyringPair,747                      value: number | bigint = 1,748                      type: string = 'NFT') {749  await usingApi(async (api: ApiPromise) => {750    let balanceBefore = new BN(0);751752753    let blockNumber: number | undefined = await getBlockNumber(api);754    let expectedBlockNumber = blockNumber + 2;755756    expect(blockNumber).to.be.greaterThan(0);757    const transferTx = await api.tx.nft.transfer(recipient.address, collectionId, tokenId, value); 758    const scheduleTx = await api.tx.scheduler.schedule(expectedBlockNumber, null, 0, transferTx);759760    const events = await submitTransactionAsync(sender, scheduleTx);761762    const sponsorBalanceBefore = new BigNumber((await api.query.system.account(sender.address)).data.free.toString());763    const recipientBalanceBefore = new BigNumber((await api.query.system.account(recipient.address)).data.free.toString());764765    const nftItemDataBefore = (await api.query.nft.nftItemList(collectionId, tokenId)).toJSON() as unknown as ITokenDataType;766    expect(nftItemDataBefore.Owner.toString()).to.be.equal(sender.address);767768    // sleep for 2 blocks769    await new Promise(resolve => setTimeout(resolve, 6000 * 2));770771    const sponsorBalanceAfter = new BigNumber((await api.query.system.account(sender.address)).data.free.toString());772    const recipientBalanceAfter = new BigNumber((await api.query.system.account(recipient.address)).data.free.toString());773774    const nftItemData = (await api.query.nft.nftItemList(collectionId, tokenId)).toJSON() as unknown as ITokenDataType;775    expect(nftItemData.Owner.toString()).to.be.equal(recipient.address);776    expect(recipientBalanceAfter.toNumber()).to.be.equal(recipientBalanceBefore.toNumber());777  });778}779780781export async function782  transferExpectSuccess(collectionId: number,783    tokenId: number,784    sender: IKeyringPair,785    recipient: IKeyringPair | CrossAccountId,786    value: number | bigint = 1,787    type: string = 'NFT') {788  await usingApi(async (api: ApiPromise) => {789    const to = normalizeAccountId(recipient);790791    let balanceBefore = new BN(0);792    if (type === 'Fungible') {793      balanceBefore = await api.query.nft.balance(collectionId, toSubstrateAddress(to)) as unknown as BN;794    }795    const transferTx = api.tx.nft.transfer(to, collectionId, tokenId, value);796    const events = await submitTransactionAsync(sender, transferTx);797    const result = getTransferResult(events);798    // tslint:disable-next-line:no-unused-expression799    expect(result.success).to.be.true;800    expect(result.collectionId).to.be.equal(collectionId);801    expect(result.itemId).to.be.equal(tokenId);802    expect(result.sender).to.be.deep.equal(normalizeAccountId(sender.address));803    expect(result.recipient).to.be.deep.equal(to);804    expect(result.value.toString()).to.be.equal(value.toString());805    if (type === 'NFT') {806      const nftItemData = (await api.query.nft.nftItemList(collectionId, tokenId)).toJSON() as unknown as ITokenDataType;807      expect(nftItemData.Owner).to.be.deep.equal(to);808    }809    if (type === 'Fungible') {810      const balanceAfter = (await api.query.nft.fungibleItemList(collectionId, toSubstrateAddress(to)) as any).Value as unknown as BN;811      expect(balanceAfter.sub(balanceBefore).toString()).to.be.equal(value.toString());812    }813    if (type === 'ReFungible') {814      const nftItemData =815        (await api.query.nft.reFungibleItemList(collectionId, tokenId)).toJSON() as unknown as IReFungibleTokenDataType;816      expect(nftItemData.Owner[0].Owner).to.be.deep.equal(to);817      expect(nftItemData.Owner[0].Fraction.toString()).to.be.equal(value.toString());818    }819  });820}821822export async function823  transferExpectFail(collectionId: number,824    tokenId: number,825    sender: IKeyringPair,826    recipient: IKeyringPair,827    value: number | bigint = 1,828    type: string = 'NFT') {829  await usingApi(async (api: ApiPromise) => {830    const transferTx = api.tx.nft.transfer(normalizeAccountId(recipient.address), collectionId, tokenId, value);831    const events = await expect(submitTransactionExpectFailAsync(sender, transferTx)).to.be.rejected;832    if (events && Array.isArray(events)) {833      const result = getCreateCollectionResult(events);834      // tslint:disable-next-line:no-unused-expression835      expect(result.success).to.be.false;836    }837  });838}839840export async function841  approveExpectFail(collectionId: number,842    tokenId: number, owner: IKeyringPair, approved: IKeyringPair, amount: number | bigint = 1) {843  await usingApi(async (api: ApiPromise) => {844    const approveNftTx = api.tx.nft.approve(normalizeAccountId(approved.address), collectionId, tokenId, amount);845    const events = await expect(submitTransactionExpectFailAsync(owner, approveNftTx)).to.be.rejected;846    const result = getCreateCollectionResult(events);847    // tslint:disable-next-line:no-unused-expression848    expect(result.success).to.be.false;849  });850}851852export async function getFungibleBalance(853  collectionId: number,854  owner: string,855) {856  return await usingApi(async (api) => {857    const response = (await api.query.nft.fungibleItemList(collectionId, owner)).toJSON() as unknown as { Value: string };858    return BigInt(response.Value);859  });860}861862export async function createFungibleItemExpectSuccess(863  sender: IKeyringPair,864  collectionId: number,865  data: CreateFungibleData,866  owner: CrossAccountId | string = sender.address,867) {868  return await usingApi(async (api) => {869    const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(owner), { Fungible: data });870871    const events = await submitTransactionAsync(sender, tx);872    const result = getCreateItemResult(events);873874    expect(result.success).to.be.true;875    return result.itemId;876  });877}878879export async function createItemExpectSuccess(880  sender: IKeyringPair, collectionId: number, createMode: string, owner: CrossAccountId | string = sender.address) {881  let newItemId: number = 0;882  await usingApi(async (api) => {883    const to = normalizeAccountId(owner);884    const AItemCount = parseInt((await api.query.nft.itemListIndex(collectionId)).toString(), 10);885    const Aitem: any = (await api.query.nft.fungibleItemList(collectionId, toSubstrateAddress(to))).toJSON();886    const AItemBalance = new BigNumber(Aitem.Value);887888    let tx;889    if (createMode === 'Fungible') {890      const createData = { fungible: { value: 10 } };891      tx = api.tx.nft.createItem(collectionId, to, createData);892    } else if (createMode === 'ReFungible') {893      const createData = { refungible: { const_data: [], variable_data: [], pieces: 100 } };894      tx = api.tx.nft.createItem(collectionId, to, createData);895    } else {896      tx = api.tx.nft.createItem(collectionId, to, createMode);897    }898899    const events = await submitTransactionAsync(sender, tx);900    const result = getCreateItemResult(events);901902    const BItemCount = parseInt((await api.query.nft.itemListIndex(collectionId)).toString(), 10);903    const Bitem: any = (await api.query.nft.fungibleItemList(collectionId, toSubstrateAddress(to))).toJSON();904    const BItemBalance = new BigNumber(Bitem.Value);905906    // What to expect907    // tslint:disable-next-line:no-unused-expression908    expect(result.success).to.be.true;909    if (createMode === 'Fungible') {910      expect(BItemBalance.minus(AItemBalance).toNumber()).to.be.equal(10);911    } else {912      expect(BItemCount).to.be.equal(AItemCount + 1);913    }914    expect(collectionId).to.be.equal(result.collectionId);915    expect(BItemCount.toString()).to.be.equal(result.itemId.toString());916    expect(to).to.be.deep.equal(result.recipient);917    newItemId = result.itemId;918  });919  return newItemId;920}921922export async function createItemExpectFailure(923  sender: IKeyringPair, collectionId: number, createMode: string, owner: string = sender.address) {924  await usingApi(async (api) => {925    const tx = api.tx.nft.createItem(collectionId, normalizeAccountId(owner), createMode);926    927    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;928    const result = getCreateItemResult(events);929930    expect(result.success).to.be.false;931  });932}933934export async function setPublicAccessModeExpectSuccess(935  sender: IKeyringPair, collectionId: number,936  accessMode: 'Normal' | 'WhiteList',937) {938  await usingApi(async (api) => {939940    // Run the transaction941    const tx = api.tx.nft.setPublicAccessMode(collectionId, accessMode);942    const events = await submitTransactionAsync(sender, tx);943    const result = getGenericResult(events);944945    // Get the collection946    const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();947948    // What to expect949    // tslint:disable-next-line:no-unused-expression950    expect(result.success).to.be.true;951    expect(collection.Access).to.be.equal(accessMode);952  });953}954955export async function enableWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number) {956  await setPublicAccessModeExpectSuccess(sender, collectionId, 'WhiteList');957}958959export async function disableWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number) {960  await setPublicAccessModeExpectSuccess(sender, collectionId, 'Normal');961}962963export async function setMintPermissionExpectSuccess(sender: IKeyringPair, collectionId: number, enabled: boolean) {964  await usingApi(async (api) => {965966    // Run the transaction967    const tx = api.tx.nft.setMintPermission(collectionId, enabled);968    const events = await submitTransactionAsync(sender, tx);969    const result = getGenericResult(events);970971    // Get the collection972    const collection: any = (await api.query.nft.collectionById(collectionId)).toJSON();973974    // What to expect975    // tslint:disable-next-line:no-unused-expression976    expect(result.success).to.be.true;977    expect(collection.MintMode).to.be.equal(enabled);978  });979}980981export async function enablePublicMintingExpectSuccess(sender: IKeyringPair, collectionId: number) {982  await setMintPermissionExpectSuccess(sender, collectionId, true);983}984985export async function setMintPermissionExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) {986  await usingApi(async (api) => {987    // Run the transaction988    const tx = api.tx.nft.setMintPermission(collectionId, enabled);989    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;990    const result = getCreateCollectionResult(events);991    // tslint:disable-next-line:no-unused-expression992    expect(result.success).to.be.false;993  });994}995996export async function isWhitelisted(collectionId: number, address: string) {997  let whitelisted: boolean = false;998  await usingApi(async (api) => {999    whitelisted = (await api.query.nft.whiteList(collectionId, address)).toJSON() as unknown as boolean;1000  });1001  return whitelisted;1002}10031004export async function addToWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: string | AccountId) {1005  await usingApi(async (api) => {10061007    const whiteListedBefore = (await api.query.nft.whiteList(collectionId, address)).toJSON();10081009    // Run the transaction1010    const tx = api.tx.nft.addToWhiteList(collectionId, normalizeAccountId(address));1011    const events = await submitTransactionAsync(sender, tx);1012    const result = getGenericResult(events);10131014    const whiteListedAfter = (await api.query.nft.whiteList(collectionId, address)).toJSON();10151016    // What to expect1017    // tslint:disable-next-line:no-unused-expression1018    expect(result.success).to.be.true;1019    // tslint:disable-next-line: no-unused-expression1020    expect(whiteListedBefore).to.be.false;1021    // tslint:disable-next-line: no-unused-expression1022    expect(whiteListedAfter).to.be.true;1023  });1024}10251026export async function removeFromWhiteListExpectSuccess(sender: IKeyringPair, collectionId: number, address: CrossAccountId) {1027  await usingApi(async (api) => {1028    // Run the transaction1029    const tx = api.tx.nft.removeFromWhiteList(collectionId, normalizeAccountId(address));1030    const events = await submitTransactionAsync(sender, tx);1031    const result = getGenericResult(events);10321033    // What to expect1034    // tslint:disable-next-line:no-unused-expression1035    expect(result.success).to.be.true;1036  });1037}10381039export async function removeFromWhiteListExpectFailure(sender: IKeyringPair, collectionId: number, address: CrossAccountId) {1040  await usingApi(async (api) => {1041    // Run the transaction1042    const tx = api.tx.nft.removeFromWhiteList(collectionId, normalizeAccountId(address));1043    const events = await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;1044    const result = getGenericResult(events);10451046    // What to expect1047    // tslint:disable-next-line:no-unused-expression1048    expect(result.success).to.be.false;1049  });1050}10511052export const getDetailedCollectionInfo = async (api: ApiPromise, collectionId: number)1053  : Promise<ICollectionInterface | null> => {1054  return (await api.query.nft.collectionById(collectionId)).toJSON() as unknown as ICollectionInterface;1055};10561057export const getCreatedCollectionCount = async (api: ApiPromise): Promise<number> => {1058  // set global object - collectionsCount1059  return (await api.query.nft.createdCollectionCount() as unknown as BN).toNumber();1060};10611062export async function queryCollectionExpectSuccess(collectionId: number): Promise<ICollectionInterface> {1063  return await usingApi(async (api) => {1064    return (await api.query.nft.collectionById(collectionId)).toJSON() as unknown as ICollectionInterface;1065  });1066}
modifiedtests/src/util/util.tsdiffbeforeafterboth
--- a/tests/src/util/util.ts
+++ b/tests/src/util/util.ts
@@ -4,7 +4,7 @@
 //
 
 export function strToUTF16(str: string): any {
-  let buf: number[] = [];
+  const buf: number[] = [];
   for (let i=0, strLen=str.length; i < strLen; i++) {
     buf.push(str.charCodeAt(i));
   }
@@ -12,7 +12,7 @@
 }
 
 export function utf16ToStr(buf: number[]): string {
-  let str: string = "";
+  let str = '';
   for (let i=0, strLen=buf.length; i < strLen; i++) {
     if (buf[i] != 0) str += String.fromCharCode(buf[i]);
     else break;
@@ -21,13 +21,13 @@
 }
 
 export function hexToStr(buf: string): string {
-  let str: string = "";
-  let hexStart = buf.indexOf("0x");
+  let str = '';
+  let hexStart = buf.indexOf('0x');
   if (hexStart < 0) hexStart = 0;
   else hexStart = 2;  
   for (let i=hexStart, strLen=buf.length; i < strLen; i+=2) {
-    let ch = buf[i] + buf[i+1];
-    let num = parseInt(ch, 16);
+    const ch = buf[i] + buf[i+1];
+    const num = parseInt(ch, 16);
     if (num != 0) str += String.fromCharCode(num);
     else break;
   }