git.delta.rocks / unique-network / refs/commits / b1d3841dc4c5

difftreelog

test(ss58Format) transfer all tests to the new privateKeyWrapper method

h3lpkey2022-06-02parent: #d17fd85.patch.diff
in: master

62 files changed

modifiedtests/src/addCollectionAdmin.test.tsdiffbeforeafterboth
--- a/tests/src/addCollectionAdmin.test.ts
+++ b/tests/src/addCollectionAdmin.test.ts
@@ -17,7 +17,6 @@
 import {ApiPromise} from '@polkadot/api';
 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 {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, destroyCollectionExpectSuccess, getAdminList, normalizeAccountId, queryCollectionExpectSuccess} from './util/helpers';
 
@@ -26,10 +25,10 @@
 
 describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {
   it('Add collection admin.', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.equal(alice.address);
@@ -43,11 +42,11 @@
   });
 
   it('Add admin using added collection admin.', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//CHARLIE');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//CHARLIE');
 
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.equal(alice.address);
@@ -69,10 +68,10 @@
 
 describe('Negative Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {
   it("Not owner can't add collection admin.", async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const nonOwner = privateKey('//Bob_stash');
+      const alice = privateKeyWrapper!('//Alice');
+      const nonOwner = privateKeyWrapper!('//Bob_stash');
 
       const changeAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(alice.address));
       await expect(submitTransactionExpectFailAsync(nonOwner, changeAdminTx)).to.be.rejected;
@@ -85,11 +84,11 @@
     });
   });
   it("Can't add collection admin of not existing collection.", async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       // tslint:disable-next-line: no-bitwise
       const collectionId = (1 << 32) - 1;
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const changeOwnerTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address));
       await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected;
@@ -100,10 +99,10 @@
   });
 
   it("Can't add an admin to a destroyed collection.", async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       await destroyCollectionExpectSuccess(collectionId);
       const changeOwnerTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address));
       await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected;
@@ -114,16 +113,16 @@
   });
 
   it('Add an admin to a collection that has reached the maximum number of admins limit', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      const alice = privateKey('//Alice');
+    await usingApi(async (api: ApiPromise, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
       const accounts = [
-        privateKey('//AdminTest/1').address,
-        privateKey('//AdminTest/2').address,
-        privateKey('//AdminTest/3').address,
-        privateKey('//AdminTest/4').address,
-        privateKey('//AdminTest/5').address,
-        privateKey('//AdminTest/6').address,
-        privateKey('//AdminTest/7').address,
+        privateKeyWrapper!('//AdminTest/1').address,
+        privateKeyWrapper!('//AdminTest/2').address,
+        privateKeyWrapper!('//AdminTest/3').address,
+        privateKeyWrapper!('//AdminTest/4').address,
+        privateKeyWrapper!('//AdminTest/5').address,
+        privateKeyWrapper!('//AdminTest/6').address,
+        privateKeyWrapper!('//AdminTest/7').address,
       ];
       const collectionId = await createCollectionExpectSuccess();
 
modifiedtests/src/addToAllowList.test.tsdiffbeforeafterboth
--- a/tests/src/addToAllowList.test.ts
+++ b/tests/src/addToAllowList.test.ts
@@ -17,7 +17,6 @@
 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 {
   addToAllowListExpectSuccess,
@@ -42,9 +41,9 @@
 describe('Integration Test ext. addToAllowList()', () => {
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -65,10 +64,10 @@
 describe('Negative Integration Test ext. addToAllowList()', () => {
 
   it('Allow list an address in the collection that does not exist', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       // tslint:disable-next-line: no-bitwise
       const collectionId = await getCreatedCollectionCount(api) + 1;
-      const bob = privateKey('//Bob');
+      const bob = privateKeyWrapper!('//Bob');
 
       const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address));
       await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
@@ -76,9 +75,9 @@
   });
 
   it('Allow list an address in the collection that was destroyed', async () => {
-    await usingApi(async (api) => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // tslint:disable-next-line: no-bitwise
       const collectionId = await createCollectionExpectSuccess();
       await destroyCollectionExpectSuccess(collectionId);
@@ -88,9 +87,9 @@
   });
 
   it('Allow list an address in the collection that does not have allow list access enabled', async () => {
-    await usingApi(async (api) => {
-      const alice = privateKey('//Alice');
-      const ferdie = privateKey('//Ferdie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const ferdie = privateKeyWrapper!('//Ferdie');
       const collectionId = await createCollectionExpectSuccess();
       await enableAllowListExpectSuccess(alice, collectionId);
       await enablePublicMintingExpectSuccess(alice, collectionId);
@@ -104,10 +103,10 @@
 describe('Integration Test ext. addToAllowList() with collection admin permissions:', () => {
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
modifiedtests/src/addToContractAllowList.test.tsdiffbeforeafterboth
--- a/tests/src/addToContractAllowList.test.ts
+++ b/tests/src/addToContractAllowList.test.ts
@@ -17,7 +17,6 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import privateKey from './substrate/privateKey';
 import {
   deployFlipper,
 } from './util/contracthelpers';
@@ -31,8 +30,8 @@
 describe.skip('Integration Test addToContractAllowList', () => {
 
   it('Add an address to a contract allow list', async () => {
-    await usingApi(async api => {
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const bob = privateKeyWrapper!('//Bob');
       const [contract, deployer] = await deployFlipper(api);
 
       const allowListedBefore = (await api.query.unique.contractAllowList(contract.address, bob.address)).toJSON();
@@ -47,8 +46,8 @@
   });
 
   it('Adding same address to allow list repeatedly should not produce errors', async () => {
-    await usingApi(async api => {
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const bob = privateKeyWrapper!('//Bob');
       const [contract, deployer] = await deployFlipper(api);
 
       const allowListedBefore = (await api.query.unique.contractAllowList(contract.address, bob.address)).toJSON();
@@ -70,10 +69,10 @@
 describe.skip('Negative Integration Test addToContractAllowList', () => {
 
   it('Add an address to a allow list of a non-contract', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Bob');
-      const bob = privateKey('//Bob');
-      const charlieGuineaPig = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Bob');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlieGuineaPig = privateKeyWrapper!('//Charlie');
 
       const allowListedBefore = (await api.query.unique.contractAllowList(charlieGuineaPig.address, bob.address)).toJSON();
       const addTx = api.tx.unique.addToContractAllowList(charlieGuineaPig.address, bob.address);
@@ -86,8 +85,8 @@
   });
 
   it('Add to a contract allow list using a non-owner address', async () => {
-    await usingApi(async api => {
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const bob = privateKeyWrapper!('//Bob');
       const [contract] = await deployFlipper(api);
 
       const allowListedBefore = (await api.query.unique.contractAllowList(contract.address, bob.address)).toJSON();
modifiedtests/src/allowLists.test.tsdiffbeforeafterboth
--- a/tests/src/allowLists.test.ts
+++ b/tests/src/allowLists.test.ts
@@ -17,7 +17,6 @@
 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 {
   addToAllowListExpectSuccess,
@@ -50,10 +49,10 @@
 describe('Integration Test ext. Allow list tests', () => {
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
modifiedtests/src/approve.test.tsdiffbeforeafterboth
--- a/tests/src/approve.test.ts
+++ b/tests/src/approve.test.ts
@@ -18,7 +18,6 @@
 import {ApiPromise} from '@polkadot/api';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
 import {default as usingApi} from './substrate/substrate-api';
 import {
   approveExpectFail,
@@ -43,10 +42,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -99,10 +98,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });  
 
@@ -131,10 +130,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });  
 
@@ -166,10 +165,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });  
 
@@ -205,11 +204,11 @@
   let dave: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
-      dave = privateKey('//Dave');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
+      dave =  privateKeyWrapper!('//Dave');
     });
   });  
 
@@ -228,10 +227,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -267,10 +266,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -300,11 +299,11 @@
   let dave: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
-      dave = privateKey('//Dave');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
+      dave =  privateKeyWrapper!('//Dave');
     });
   });  
 
@@ -340,11 +339,11 @@
   let dave: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
-      dave = privateKey('//Dave');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
+      dave =  privateKeyWrapper!('//Dave');
     });
   });  
 
@@ -391,10 +390,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -413,10 +412,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice =  privateKeyWrapper!('//Alice');
+      bob =  privateKeyWrapper!('//Bob');
+      charlie =  privateKeyWrapper!('//Charlie');
     });
   });
 
modifiedtests/src/change-collection-owner.test.tsdiffbeforeafterboth
--- a/tests/src/change-collection-owner.test.ts
+++ b/tests/src/change-collection-owner.test.ts
@@ -16,7 +16,6 @@
 
 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,
   addCollectionAdminExpectSuccess,
@@ -41,10 +40,10 @@
 
 describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {
   it('Changing owner changes owner address', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const collection =await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.deep.eq(alice.address);
@@ -60,10 +59,10 @@
 
 describe('Integration Test changeCollectionOwner(collection_id, new_owner) special checks for exOwner:', () => {
   it('Changing the owner of the collection is not allowed for the former owner', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.deep.eq(alice.address);
@@ -80,11 +79,11 @@
   });
 
   it('New collectionOwner has access to sponsorship management operations in the collection', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.deep.eq(alice.address);
@@ -124,11 +123,11 @@
   });
 
   it('New collectionOwner has access to changeCollectionOwner', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.deep.eq(alice.address);
@@ -151,10 +150,10 @@
 
 describe('Negative Integration Test changeCollectionOwner(collection_id, new_owner):', () => {
   it('Not owner can\'t change owner.', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address);
       await expect(submitTransactionExpectFailAsync(bob, changeOwnerTx)).to.be.rejected;
@@ -168,10 +167,10 @@
   });
 
   it('Collection admin can\'t change owner.', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
 
@@ -187,10 +186,10 @@
   });
 
   it('Can\'t change owner of a non-existing collection.', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = (1<<32) - 1;
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const changeOwnerTx = api.tx.unique.changeCollectionOwner(collectionId, bob.address);
       await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected;
@@ -201,11 +200,11 @@
   });
 
   it('Former collectionOwner not allowed to sponsorship management operations in the collection', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.deep.eq(alice.address);
modifiedtests/src/check-event/burnItemEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/burnItemEvent.test.ts
+++ b/tests/src/check-event/burnItemEvent.test.ts
@@ -19,7 +19,6 @@
 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, uniqueEventMessage} from '../util/helpers';
 
@@ -32,8 +31,8 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
   it('Check event from burnItem(): ', async () => {
modifiedtests/src/check-event/createCollectionEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/createCollectionEvent.test.ts
+++ b/tests/src/check-event/createCollectionEvent.test.ts
@@ -19,7 +19,6 @@
 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 {uniqueEventMessage} from '../util/helpers';
 
@@ -32,8 +31,8 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
   it('Check event from createCollection(): ', async () => {
modifiedtests/src/check-event/createItemEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/createItemEvent.test.ts
+++ b/tests/src/check-event/createItemEvent.test.ts
@@ -19,7 +19,6 @@
 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, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
 
@@ -32,8 +31,8 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
   it('Check event from createItem(): ', async () => {
modifiedtests/src/check-event/createMultipleItemsEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/createMultipleItemsEvent.test.ts
+++ b/tests/src/check-event/createMultipleItemsEvent.test.ts
@@ -19,7 +19,6 @@
 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, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
 
@@ -32,8 +31,8 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
   it('Check event from createMultipleItems(): ', async () => {
modifiedtests/src/check-event/destroyCollectionEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/destroyCollectionEvent.test.ts
+++ b/tests/src/check-event/destroyCollectionEvent.test.ts
@@ -19,7 +19,6 @@
 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, uniqueEventMessage} from '../util/helpers';
 
@@ -31,8 +30,8 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
   it('Check event from destroyCollection(): ', async () => {
modifiedtests/src/check-event/transferEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/transferEvent.test.ts
+++ b/tests/src/check-event/transferEvent.test.ts
@@ -19,7 +19,6 @@
 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, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
 
@@ -33,9 +32,9 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
   it('Check event from transfer(): ', async () => {
modifiedtests/src/check-event/transferFromEvent.test.tsdiffbeforeafterboth
--- a/tests/src/check-event/transferFromEvent.test.ts
+++ b/tests/src/check-event/transferFromEvent.test.ts
@@ -19,7 +19,6 @@
 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, uniqueEventMessage, normalizeAccountId} from '../util/helpers';
 
@@ -33,9 +32,9 @@
   const checkTreasury = 'Deposit';
   const checkSystem = 'ExtrinsicSuccess';
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
   it('Check event from transferFrom(): ', async () => {
modifiedtests/src/contracts.test.tsdiffbeforeafterboth
--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -50,11 +50,11 @@
 
 describe.skip('Contracts', () => {
   it('Can deploy smart contract Flipper, instantiate it and call it\'s get and flip messages.', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const [contract, deployer] = await deployFlipper(api);
       const initialGetResponse = await getFlipValue(contract, deployer);
 
-      const bob = privateKey('//Bob');
+      const bob = privateKeyWrapper!('//Bob');
       const flip = contract.tx.flip(value, gasLimit);
       await submitTransactionAsync(bob, flip);
 
@@ -76,9 +76,9 @@
 
 describe.skip('Chain extensions', () => {
   it('Transfer CE', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       // Prep work
       const collectionId = await createCollectionExpectSuccess();
@@ -100,9 +100,9 @@
   });
 
   it('Mint CE', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const collectionId = await createCollectionExpectSuccess();
       const [contract] = await deployTransferContract(api);
@@ -127,9 +127,9 @@
   });
 
   it('Bulk mint CE', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const collectionId = await createCollectionExpectSuccess();
       const [contract] = await deployTransferContract(api);
@@ -168,10 +168,10 @@
   });
 
   it('Approve CE', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       const collectionId = await createCollectionExpectSuccess();
       const [contract] = await deployTransferContract(api);
@@ -187,10 +187,10 @@
   });
 
   it('TransferFrom CE', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       const collectionId = await createCollectionExpectSuccess();
       const [contract] = await deployTransferContract(api);
@@ -208,9 +208,9 @@
   });
 
   it('ToggleAllowList CE', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const collectionId = await createCollectionExpectSuccess();
       const [contract] = await deployTransferContract(api);
modifiedtests/src/createCollection.test.tsdiffbeforeafterboth
--- a/tests/src/createCollection.test.ts
+++ b/tests/src/createCollection.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {expect} from 'chai';
-import privateKey from './substrate/privateKey';
 import usingApi, {executeTransaction, submitTransactionAsync} from './substrate/substrate-api';
 import {createCollectionWithPropsExpectFailure, createCollectionExpectFailure, createCollectionExpectSuccess, getCreateCollectionResult, getDetailedCollectionInfo, createCollectionWithPropsExpectSuccess} from './util/helpers';
 
@@ -58,9 +57,9 @@
   });
 
   it('Create new collection with extra fields', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       const tx = api.tx.unique.createCollectionEx({
         mode: {Fungible: 8},
         permissions: {
@@ -101,8 +100,8 @@
     await createCollectionExpectFailure({tokenPrefix: 'A'.repeat(17), mode: {type: 'NFT'}});
   });
   it('fails when bad limits are set', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
       const tx = api.tx.unique.createCollectionEx({mode: 'NFT', limits: {tokenLimit: 0}});
       await expect(executeTransaction(api, alice, tx)).to.be.rejectedWith(/^common.CollectionTokenLimitExceeded$/);
     });
modifiedtests/src/createMultipleItems.test.tsdiffbeforeafterboth
--- a/tests/src/createMultipleItems.test.ts
+++ b/tests/src/createMultipleItems.test.ts
@@ -18,7 +18,6 @@
 import {IKeyringPair} from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
 import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync, executeTransaction} from './substrate/substrate-api';
 import {
   createCollectionExpectSuccess,
@@ -41,12 +40,12 @@
 
 describe('Integration Test createMultipleItems(collection_id, owner, items_data):', () => {
   it('Create 0x31, 0x32, 0x33 items in active NFT collection and verify tokens data in chain', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
       expect(itemsListIndexBefore).to.be.equal(0);
 
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       await submitTransactionAsync(
         alice, 
         api.tx.unique.setPropertyPermissions(collectionId, [{key: 'data', permission: {tokenOwner: true}}]),
@@ -73,11 +72,11 @@
   });
 
   it('Create 0x01, 0x02, 0x03 items in active Fungible collection and verify tokens data in chain', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
       expect(itemsListIndexBefore).to.be.equal(0);
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       const args = [
         {Fungible: {value: 1}},
         {Fungible: {value: 2}},
@@ -93,11 +92,11 @@
   });
 
   it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
       expect(itemsListIndexBefore).to.be.equal(0);
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       const args = [
         {ReFungible: {pieces: 1}},
         {ReFungible: {pieces: 2}},
@@ -116,8 +115,8 @@
   });
 
   it('Can mint amount of items equals to collection limits', async () => {
-    await usingApi(async (api) => {
-      const alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
 
       const collectionId = await createCollectionExpectSuccess();
       await setCollectionLimitsExpectSuccess(alice, collectionId, {
@@ -135,11 +134,11 @@
   });
 
   it('Create 0x31, 0x32, 0x33 items in active NFT with property Admin', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: false}}]});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
       expect(itemsListIndexBefore).to.be.equal(0);
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       const args = [
         {NFT: {properties: [{key: 'k', value: 'v1'}]}},
         {NFT: {properties: [{key: 'k', value: 'v2'}]}},
@@ -161,12 +160,12 @@
   });
 
   it('Create 0x31, 0x32, 0x33 items in active NFT with property AdminConst', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}]});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
       expect(itemsListIndexBefore).to.be.equal(0);
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
       const args = [
         {NFT: {properties: [{key: 'k', value: 'v1'}]}},
@@ -189,11 +188,11 @@
   });
 
   it('Create 0x31, 0x32, 0x33 items in active NFT with property itemOwnerOrAdmin', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
       expect(itemsListIndexBefore).to.be.equal(0);
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       const args = [
         {NFT: {properties: [{key: 'k', value: 'v1'}]}},
         {NFT: {properties: [{key: 'k', value: 'v2'}]}},
@@ -220,9 +219,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -302,9 +301,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -360,12 +359,12 @@
   });
 
   it('Create NFT and Re-fungible tokens that has reached the maximum data limit', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       // NFT
       const collectionId = await createCollectionWithPropsExpectSuccess({
         propPerm: [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}],
       });
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       const args = [
         {NFT: {properties: [{key: 'key', value: 'A'.repeat(32769)}]}},
         {NFT: {properties: [{key: 'key', value: 'B'.repeat(32769)}]}},
modifiedtests/src/createMultipleItemsEx.test.tsdiffbeforeafterboth
--- a/tests/src/createMultipleItemsEx.test.ts
+++ b/tests/src/createMultipleItemsEx.test.ts
@@ -15,17 +15,16 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {expect} from 'chai';
-import privateKey from './substrate/privateKey';
 import usingApi, {executeTransaction} from './substrate/substrate-api';
-import {createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, addCollectionAdminExpectSuccess} from './util/helpers';
+import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess} from './util/helpers';
 
 describe('createMultipleItemsEx', () => {
   it('can initialize multiple NFT with different owners', async () => {
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const data = [
         {
           owner: {substrate: alice.address},
@@ -47,10 +46,10 @@
 
   it('createMultipleItemsEx with property Admin', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({mode: {type: 'NFT'}, propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: false}}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const data = [
         {
           owner: {substrate: alice.address},
@@ -75,10 +74,10 @@
 
   it('createMultipleItemsEx with property AdminConst', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({mode: {type: 'NFT'}, propPerm: [{key: 'k', permission: {mutable: false, collectionAdmin: true, tokenOwner: false}}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const data = [
         {
           owner: {substrate: alice.address},
@@ -103,10 +102,10 @@
 
   it('createMultipleItemsEx with property itemOwnerOrAdmin', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({mode: {type: 'NFT'}, propPerm: [{key: 'k', permission: {mutable: false, collectionAdmin: true, tokenOwner: true}}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const data = [
         {
           owner: {substrate: alice.address},
@@ -132,11 +131,11 @@
   it('No editing rights', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({properties: [{key: 'key1', value: 'v'}],
       propPerm:   [{key: 'key1', permission: {mutable: true, collectionAdmin: false, tokenOwner: false}}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await addCollectionAdminExpectSuccess(alice, collection, bob.address);
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
+      await addCollectionAdminExpectSuccess(alice, collection, bob.address);
       const data = [
         {
           owner: {substrate: alice.address},
@@ -161,10 +160,10 @@
   it('User doesnt have editing rights', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({properties: [{key: 'key1', value: 'v'}],
       propPerm:   [{key: 'key1', permission: {mutable: false, collectionAdmin: false, tokenOwner: false}}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    await addCollectionAdminExpectSuccess(alice, collection, bob.address);
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      await addCollectionAdminExpectSuccess(alice, collection, bob.address);
       const data = [
         {
           owner: {substrate: alice.address},
@@ -188,11 +187,11 @@
 
   it('Adding property without access rights', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({properties: [{key: 'key1', value: 'v'}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await addCollectionAdminExpectSuccess(alice, collection, bob.address);
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
+      await addCollectionAdminExpectSuccess(alice, collection, bob.address);
       const data = [
         {
           owner: {substrate: alice.address},
@@ -220,20 +219,20 @@
       propPerms.push({key: `key${i}`, permission: {mutable: true, collectionAdmin: true, tokenOwner: true}});
     }
 
-    const alice = privateKey('//Alice');
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
       await expect(executeTransaction(api, alice, api.tx.unique.setPropertyPermissions(collection, propPerms))).to.be.rejectedWith(/common\.PropertyLimitReached/);
     });
   });
 
   it('Trying to add bigger property than allowed', async () => {
     const collection = await createCollectionWithPropsExpectSuccess({propPerm: [{key: 'k', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}]});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await addCollectionAdminExpectSuccess(alice, collection, bob.address);
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
+      await addCollectionAdminExpectSuccess(alice, collection, bob.address);
       const data = [
         {
           owner: {substrate: alice.address}, properties: [{key: 'k', value: 'vvvvvv'.repeat(5000)}, {key: 'k2', value: 'vvv'.repeat(5000)}],
@@ -253,10 +252,10 @@
 
   it('can initialize multiple NFT with different owners', async () => {
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const data = [
         {
           owner: {substrate: alice.address},
@@ -278,10 +277,10 @@
 
   it('can initialize multiple NFT with different owners', async () => {
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const data = [
         {
           owner: {substrate: alice.address},
@@ -303,10 +302,10 @@
 
   it('fails when trying to set multiple owners when creating multiple refungibles', async () => {
     const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-
-    await usingApi(async (api) => {
+    
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // Polkadot requires map, and yet requires keys to be JSON encoded
       const users = new Map();
       users.set(JSON.stringify({substrate: alice.address}), 1);
modifiedtests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth
--- a/tests/src/creditFeesToTreasury.test.ts
+++ b/tests/src/creditFeesToTreasury.test.ts
@@ -19,7 +19,6 @@
 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 {IKeyringPair} from '@polkadot/types/types';
 import {
   createCollectionExpectSuccess,
@@ -65,20 +64,20 @@
 
 describe('integration test: Fees must be credited to Treasury:', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
   it('Total issuance does not change', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       await skipInflationBlock(api);
       await waitNewBlocks(api, 1);
 
       const totalBefore = (await api.query.balances.totalIssuance()).toBigInt();
 
-      const alicePrivateKey = privateKey('//Alice');
+      const alicePrivateKey = privateKeyWrapper!('//Alice');
       const amount = 1n;
       const transfer = api.tx.balances.transfer(bobsPublicKey, amount);
 
@@ -92,11 +91,11 @@
   });
 
   it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       await skipInflationBlock(api);
       await waitNewBlocks(api, 1);
 
-      const alicePrivateKey = privateKey('//Alice');
+      const alicePrivateKey = privateKeyWrapper!('//Alice');
       const treasuryBalanceBefore: bigint = (await api.query.system.account(TREASURY)).data.free.toBigInt();
       const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();
 
@@ -115,11 +114,11 @@
   });
 
   it('Treasury balance increased by failed tx fee', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       //await skipInflationBlock(api);
       await waitNewBlocks(api, 1);
 
-      const bobPrivateKey = privateKey('//Bob');
+      const bobPrivateKey = privateKeyWrapper!('//Bob');
       const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();
       const bobBalanceBefore = (await api.query.system.account(bobsPublicKey)).data.free.toBigInt();
 
modifiedtests/src/destroyCollection.test.tsdiffbeforeafterboth
--- a/tests/src/destroyCollection.test.ts
+++ b/tests/src/destroyCollection.test.ts
@@ -17,7 +17,6 @@
 import {IKeyringPair} from '@polkadot/types/types';
 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,
@@ -50,9 +49,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
modifiedtests/src/enableContractSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/enableContractSponsoring.test.ts
+++ b/tests/src/enableContractSponsoring.test.ts
@@ -17,7 +17,6 @@
 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 {deployFlipper, getFlipValue, toggleFlipValueExpectSuccess} from './util/contracthelpers';
 import {
@@ -79,7 +78,9 @@
   let alice: IKeyringPair;
 
   before(async () => {
-    alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+    });
   });
 
   it('fails when called for non-contract address', async () => {
modifiedtests/src/enableDisableTransfer.test.tsdiffbeforeafterboth
--- a/tests/src/enableDisableTransfer.test.ts
+++ b/tests/src/enableDisableTransfer.test.ts
@@ -16,7 +16,6 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {
   createItemExpectSuccess,
@@ -31,9 +30,9 @@
 
 describe('Enable/Disable Transfers', () => {
   it('User can transfer token with enabled transfer flag', async () => {
-    await usingApi(async () => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
@@ -46,9 +45,9 @@
   });
 
   it('User can\'n transfer token with disabled transfer flag', async () => {
-    await usingApi(async () => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
@@ -63,8 +62,8 @@
 
 describe('Negative Enable/Disable Transfers', () => {
   it('Non-owner cannot change transfer flag', async () => {
-    await usingApi(async () => {
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const bob = privateKeyWrapper!('//Bob');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
 
modifiedtests/src/eth/base.test.tsdiffbeforeafterboth
--- a/tests/src/eth/base.test.ts
+++ b/tests/src/eth/base.test.ts
@@ -28,7 +28,6 @@
 import {expect} from 'chai';
 import {createCollectionExpectSuccess, createItemExpectSuccess, UNIQUE} from '../util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
-import privateKey from '../substrate/privateKey';
 import {Contract} from 'web3-eth-contract';
 import Web3 from 'web3';
 
@@ -50,11 +49,11 @@
     expect(cost - balanceB < BigInt(0.2 * Number(UNIQUE))).to.be.true;
   });
 
-  itWeb3('NFT transfer is close to 0.15 UNQ', async ({web3, api}) => {
+  itWeb3('NFT transfer is close to 0.15 UNQ', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3);
     const receiver = createEthAccount(web3);
 
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
modifiedtests/src/eth/collectionProperties.test.tsdiffbeforeafterboth
--- a/tests/src/eth/collectionProperties.test.ts
+++ b/tests/src/eth/collectionProperties.test.ts
@@ -1,4 +1,3 @@
-import privateKey from '../substrate/privateKey';
 import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess} from '../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
@@ -6,8 +5,8 @@
 import {executeTransaction} from '../substrate/substrate-api';
 
 describe('EVM collection properties', () => {
-  itWeb3('Can be set', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be set', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
 
@@ -21,8 +20,8 @@
     const [{value}] = (await api.rpc.unique.collectionProperties(collection, ['testKey'])).toHuman()! as any;
     expect(value).to.equal('testValue');
   });
-  itWeb3('Can be deleted', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be deleted', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
 
@@ -38,8 +37,8 @@
     const result = (await api.rpc.unique.collectionProperties(collection, ['testKey'])).toJSON()! as any;
     expect(result.length).to.equal(0);
   });
-  itWeb3('Can be read', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be read', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = createEthAccount(web3);
     const collection = await createCollectionExpectSuccess({mode: {type:'NFT'}});
 
modifiedtests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -1,12 +1,11 @@
-import privateKey from '../substrate/privateKey';
 import {addToAllowListExpectSuccess, confirmSponsorshipExpectSuccess, createCollectionExpectSuccess, enablePublicMintingExpectSuccess, setCollectionSponsorExpectSuccess} from '../util/helpers';
 import {itWeb3, createEthAccount, collectionIdToAddress, GAS_ARGS, normalizeEvents} from './util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
 import {expect} from 'chai';
 
 describe('evm collection sponsoring', () => {
-  itWeb3('sponsors mint transactions', async ({web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('sponsors mint transactions', async ({web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const collection = await createCollectionExpectSuccess();
     await setCollectionSponsorExpectSuccess(collection, alice.address);
modifiedtests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -14,7 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from '../substrate/privateKey';
 import {expect} from 'chai';
 import {
   contractHelpers,
@@ -63,8 +62,8 @@
     expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;
   });
 
-  itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = await createEthAccountWithBalance(api, web3);
@@ -91,8 +90,8 @@
     expect(+balanceAfter).to.be.lessThan(+originalFlipperBalance);
   });
 
-  itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should decrease (allowlisted)', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = createEthAccount(web3);
@@ -121,8 +120,8 @@
     expect(+balanceAfter).to.be.lessThan(+originalFlipperBalance);
   });
 
-  itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Sponsoring is set, an address that has no UNQ can send a transaction and it works. Sponsor balance should not decrease (non-allowlisted)', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = createEthAccount(web3);
@@ -149,8 +148,8 @@
     expect(+balanceAfter).to.be.equals(+originalFlipperBalance);
   });
 
-  itWeb3('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Sponsoring is set, an address that has UNQ can send a transaction and it works. User balance should not change', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = await createEthAccountWithBalance(api, web3);
@@ -178,8 +177,8 @@
     expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance);
   });
 
-  itWeb3('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Sponsoring is limited, with setContractRateLimit. The limitation is working if transactions are sent more often, the sender pays the commission.', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = await createEthAccountWithBalance(api, web3);
@@ -301,9 +300,9 @@
   });
 
   //TODO: CORE-302 add eth methods
-  itWeb3.skip('Check that transaction via EVM spend money from substrate address', async ({api, web3}) => {
-    const owner = privateKey('//Alice');
-    const user = privateKey(`//User/${Date.now()}`);
+  itWeb3.skip('Check that transaction via EVM spend money from substrate address', async ({api, web3, privateKeyWrapper}) => {
+    const owner = privateKeyWrapper!('//Alice');
+    const user = privateKeyWrapper!(`//User/${Date.now()}`);
     const userEth = subToEth(user.address);
     const collectionId = await createCollectionExpectSuccess();
     await addCollectionAdminExpectSuccess(owner, collectionId, {Ethereum: userEth});
modifiedtests/src/eth/crossTransfer.test.tsdiffbeforeafterboth
--- a/tests/src/eth/crossTransfer.test.ts
+++ b/tests/src/eth/crossTransfer.test.ts
@@ -14,7 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from '../substrate/privateKey';
 import {createCollectionExpectSuccess,
   createFungibleItemExpectSuccess,
   transferExpectSuccess,
@@ -28,27 +27,27 @@
 import nonFungibleAbi from './nonFungibleAbi.json';
 
 describe('Token transfer between substrate address and EVM address. Fungible', () => {
-  itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async () => {
+  itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
+    const alice = privateKeyWrapper!('//Alice');
+    const bob = privateKeyWrapper!('//Bob');
+    const charlie = privateKeyWrapper!('//Charlie');
     await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Substrate: alice.address});
     await transferExpectSuccess(collection, 0, alice, {Ethereum: subToEth(charlie.address)} , 200, 'Fungible');
     await transferFromExpectSuccess(collection, 0, alice, {Ethereum: subToEth(charlie.address)}, charlie, 50, 'Fungible');
     await transferExpectSuccess(collection, 0, charlie, bob, 50, 'Fungible');
   });
 
-  itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({api, web3}) => {
+  itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
+    const alice = privateKeyWrapper!('//Alice');
+    const bob = privateKeyWrapper!('//Bob');
     const bobProxy = await createEthAccountWithBalance(api, web3);
     const aliceProxy = await createEthAccountWithBalance(api, web3);
 
@@ -64,28 +63,28 @@
 });
 
 describe('Token transfer between substrate address and EVM address. NFT', () => {
-  itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async () => {
+  itWeb3('The private key X create a substrate address. Alice sends a token to the corresponding EVM address, and X can send it to Bob in the substrate', async ({privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
+    const alice = privateKeyWrapper!('//Alice');
+    const bob = privateKeyWrapper!('//Bob');
+    const charlie = privateKeyWrapper!('//Charlie');
     const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});
     await transferExpectSuccess(collection, tokenId, alice, {Ethereum: subToEth(charlie.address)}, 1, 'NFT');
     await transferFromExpectSuccess(collection, tokenId, alice, {Ethereum: subToEth(charlie.address)}, charlie, 1, 'NFT');
     await transferExpectSuccess(collection, tokenId, charlie, bob, 1, 'NFT');
   });
 
-  itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({api, web3}) => {
+  itWeb3('The private key X create a EVM address. Alice sends a token to the substrate address corresponding to this EVM address, and X can send it to Bob in the EVM', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
-    const charlie = privateKey('//Charlie');
+    const alice = privateKeyWrapper!('//Alice');
+    const bob = privateKeyWrapper!('//Bob');
+    const charlie = privateKeyWrapper!('//Charlie');
     const bobProxy = await createEthAccountWithBalance(api, web3);
     const aliceProxy = await createEthAccountWithBalance(api, web3);
     const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});
modifiedtests/src/eth/fungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -14,19 +14,18 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from '../substrate/privateKey';
 import {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';
 import fungibleAbi from './fungibleAbi.json';
 import {expect} from 'chai';
 
 describe('Fungible: Information getting', () => {
-  itWeb3('totalSupply', async ({api, web3}) => {
+  itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
 
@@ -39,12 +38,12 @@
     expect(totalSupply).to.equal('200');
   });
 
-  itWeb3('balanceOf', async ({api, web3}) => {
+  itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
 
@@ -59,12 +58,12 @@
 });
 
 describe('Fungible: Plain calls', () => {
-  itWeb3('Can perform approve()', async ({web3, api}) => {
+  itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
 
@@ -98,12 +97,12 @@
     }
   });
 
-  itWeb3('Can perform transferFrom()', async ({web3, api}) => {
+  itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = createEthAccount(web3);
     await transferBalanceToEth(api, alice, owner);
@@ -156,12 +155,12 @@
     }
   });
 
-  itWeb3('Can perform transfer()', async ({web3, api}) => {
+  itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = createEthAccount(web3);
     await transferBalanceToEth(api, alice, owner);
@@ -203,11 +202,11 @@
 });
 
 describe('Fungible: Fees', () => {
-  itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api}) => {
+  itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const spender = createEthAccount(web3);
@@ -221,11 +220,11 @@
     expect(cost < BigInt(0.2 * Number(UNIQUE)));
   });
 
-  itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api}) => {
+  itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const spender = await createEthAccountWithBalance(api, web3);
@@ -241,11 +240,11 @@
     expect(cost < BigInt(0.2 * Number(UNIQUE)));
   });
 
-  itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api}) => {
+  itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const receiver = createEthAccount(web3);
@@ -261,11 +260,11 @@
 });
 
 describe('Fungible: Substrate calls', () => {
-  itWeb3('Events emitted for approve()', async ({web3}) => {
+  itWeb3('Events emitted for approve()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const receiver = createEthAccount(web3);
 
@@ -291,12 +290,12 @@
     ]);
   });
 
-  itWeb3('Events emitted for transferFrom()', async ({web3}) => {
+  itWeb3('Events emitted for transferFrom()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
+    const alice = privateKeyWrapper!('//Alice');
+    const bob = privateKeyWrapper!('//Bob');
 
     const receiver = createEthAccount(web3);
 
@@ -332,11 +331,11 @@
     ]);
   });
 
-  itWeb3('Events emitted for transfer()', async ({web3}) => {
+  itWeb3('Events emitted for transfer()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const receiver = createEthAccount(web3);
 
modifiedtests/src/eth/marketplace/marketplace.test.tsdiffbeforeafterboth
--- a/tests/src/eth/marketplace/marketplace.test.ts
+++ b/tests/src/eth/marketplace/marketplace.test.ts
@@ -16,7 +16,6 @@
 
 import {readFile} from 'fs/promises';
 import {getBalanceSingle} from '../../substrate/get-balance';
-import privateKey from '../../substrate/privateKey';
 import {
   addToAllowListExpectSuccess, 
   confirmSponsorshipExpectSuccess, 
@@ -38,8 +37,8 @@
 const PRICE = 2000n;
 
 describe('Matcher contract usage', () => {
-  itWeb3('With UNQ', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('With UNQ', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const matcherOwner = await createEthAccountWithBalance(api, web3);
     const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, {
       from: matcherOwner,
@@ -61,7 +60,7 @@
     await helpers.methods.toggleAllowed(matcher.options.address, subToEth(alice.address), true).send({from: matcherOwner});
     await addToAllowListExpectSuccess(alice, collectionId, evmToAddress(subToEth(alice.address)));
 
-    const seller = privateKey(`//Seller/${Date.now()}`);
+    const seller = privateKeyWrapper!(`//Seller/${Date.now()}`);
     await helpers.methods.toggleAllowed(matcher.options.address, subToEth(seller.address), true).send({from: matcherOwner});
 
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', seller.address);
@@ -99,8 +98,8 @@
   });
 
 
-  itWeb3('With escrow', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('With escrow', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const matcherOwner = await createEthAccountWithBalance(api, web3);
     const escrow = await createEthAccountWithBalance(api, web3);
     const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, {
@@ -124,7 +123,7 @@
     await helpers.methods.toggleAllowed(matcher.options.address, subToEth(alice.address), true).send({from: matcherOwner});
     await addToAllowListExpectSuccess(alice, collectionId, evmToAddress(subToEth(alice.address)));
 
-    const seller = privateKey(`//Seller/${Date.now()}`);
+    const seller = privateKeyWrapper!(`//Seller/${Date.now()}`);
     await helpers.methods.toggleAllowed(matcher.options.address, subToEth(seller.address), true).send({from: matcherOwner});
 
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', seller.address);
@@ -170,8 +169,8 @@
   });
 
 
-  itWeb3('Sell tokens from substrate user via EVM contract', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Sell tokens from substrate user via EVM contract', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const matcherOwner = await createEthAccountWithBalance(api, web3);
     const matcherContract = new web3.eth.Contract(JSON.parse((await readFile(`${__dirname}/MarketPlace.abi`)).toString()), undefined, {
       from: matcherOwner,
@@ -184,7 +183,7 @@
     await setCollectionLimitsExpectSuccess(alice, collectionId, {sponsorApproveTimeout: 1});
     const evmCollection = new web3.eth.Contract(nonFungibleAbi as any, collectionIdToAddress(collectionId), {from: matcherOwner});
 
-    const seller = privateKey(`//Seller/${Date.now()}`);
+    const seller = privateKeyWrapper!(`//Seller/${Date.now()}`);
     await transferBalanceTo(api, alice, seller.address);
     
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'NFT', seller.address);
modifiedtests/src/eth/migration.test.tsdiffbeforeafterboth
--- a/tests/src/eth/migration.test.ts
+++ b/tests/src/eth/migration.test.ts
@@ -15,12 +15,11 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {expect} from 'chai';
-import privateKey from '../substrate/privateKey';
 import {submitTransactionAsync} from '../substrate/substrate-api';
 import {createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers';
 
 describe('EVM Migrations', () => {
-  itWeb3('Deploy contract saved state', async ({web3, api}) => {
+  itWeb3('Deploy contract saved state', async ({web3, api, privateKeyWrapper}) => {
     /*
       contract StatefulContract {
         uint counter;
@@ -54,7 +53,7 @@
       ['0xedc95719e9a3b28dd8e80877cb5880a9be7de1a13fc8b05e7999683b6b567643', '0x0000000000000000000000000000000000000000000000000000000000000004'],
     ];
 
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
 
     await submitTransactionAsync(alice, api.tx.sudo.sudo(api.tx.evmMigration.begin(ADDRESS) as any));
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -14,7 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from '../substrate/privateKey';
 import {approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE} from '../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth} from './util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
@@ -22,11 +21,11 @@
 import {submitTransactionAsync} from '../substrate/substrate-api';
 
 describe('NFT: Information getting', () => {
-  itWeb3('totalSupply', async ({api, web3}) => {
+  itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
 
     await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});
@@ -38,11 +37,11 @@
     expect(totalSupply).to.equal('1');
   });
 
-  itWeb3('balanceOf', async ({api, web3}) => {
+  itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
     await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum:caller});
@@ -56,11 +55,11 @@
     expect(balance).to.equal('3');
   });
 
-  itWeb3('ownerOf', async ({api, web3}) => {
+  itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
     const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});
@@ -114,11 +113,11 @@
   });
 
   //TODO: CORE-302 add eth methods
-  itWeb3.skip('Can perform mintBulk()', async ({web3, api}) => {
+  itWeb3.skip('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
     const changeAdminTx = api.tx.unique.addCollectionAdmin(collection, {Ethereum: caller});
@@ -177,11 +176,11 @@
     }
   });
 
-  itWeb3('Can perform burn()', async ({web3, api}) => {
+  itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
 
@@ -208,11 +207,11 @@
     }
   });
 
-  itWeb3('Can perform approve()', async ({web3, api}) => {
+  itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = createEthAccount(web3);
     await transferBalanceToEth(api, alice, owner);
@@ -242,11 +241,11 @@
     }
   });
 
-  itWeb3('Can perform transferFrom()', async ({web3, api}) => {
+  itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = createEthAccount(web3);
     await transferBalanceToEth(api, alice, owner);
@@ -290,11 +289,11 @@
     }
   });
 
-  itWeb3('Can perform transfer()', async ({web3, api}) => {
+  itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = createEthAccount(web3);
     await transferBalanceToEth(api, alice, owner);
@@ -336,11 +335,11 @@
 });
 
 describe('NFT: Fees', () => {
-  itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api}) => {
+  itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const spender = createEthAccount(web3);
@@ -354,11 +353,11 @@
     expect(cost < BigInt(0.2 * Number(UNIQUE)));
   });
 
-  itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api}) => {
+  itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const spender = await createEthAccountWithBalance(api, web3);
@@ -374,11 +373,11 @@
     expect(cost < BigInt(0.2 * Number(UNIQUE)));
   });
 
-  itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api}) => {
+  itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const receiver = createEthAccount(web3);
@@ -394,11 +393,11 @@
 });
 
 describe('NFT: Substrate calls', () => {
-  itWeb3('Events emitted for mint()', async ({web3}) => {
+  itWeb3('Events emitted for mint()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const address = collectionIdToAddress(collection);
     const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
@@ -421,11 +420,11 @@
     ]);
   });
 
-  itWeb3('Events emitted for burn()', async ({web3}) => {
+  itWeb3('Events emitted for burn()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const address = collectionIdToAddress(collection);
     const contract = new web3.eth.Contract(nonFungibleAbi as any, address);
@@ -448,11 +447,11 @@
     ]);
   });
 
-  itWeb3('Events emitted for approve()', async ({web3}) => {
+  itWeb3('Events emitted for approve()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const receiver = createEthAccount(web3);
 
@@ -478,12 +477,12 @@
     ]);
   });
 
-  itWeb3('Events emitted for transferFrom()', async ({web3}) => {
+  itWeb3('Events emitted for transferFrom()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
-    const bob = privateKey('//Bob');
+    const alice = privateKeyWrapper!('//Alice');
+    const bob = privateKeyWrapper!('//Bob');
 
     const receiver = createEthAccount(web3);
 
@@ -510,11 +509,11 @@
     ]);
   });
 
-  itWeb3('Events emitted for transfer()', async ({web3}) => {
+  itWeb3('Events emitted for transfer()', async ({web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const receiver = createEthAccount(web3);
 
modifiedtests/src/eth/payable.test.tsdiffbeforeafterboth
--- a/tests/src/eth/payable.test.ts
+++ b/tests/src/eth/payable.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {expect} from 'chai';
-import privateKey from '../substrate/privateKey';
 import {submitTransactionAsync} from '../substrate/substrate-api';
 import {createEthAccountWithBalance, deployCollector, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';
 import {evmToAddress} from '@polkadot/util-crypto';
@@ -32,10 +31,10 @@
     expect(await contract.methods.getCollected().call()).to.be.equal('10000');
   });
 
-  itWeb3('Evm contract can receive wei from substrate account', async ({api, web3}) => {
+  itWeb3('Evm contract can receive wei from substrate account', async ({api, web3, privateKeyWrapper}) => {
     const deployer = await createEthAccountWithBalance(api, web3);
     const contract = await deployCollector(web3, deployer);
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     // Transaction fee/value will be payed from subToEth(sender) evm balance,
     // which is backed by evmToAddress(subToEth(sender)) substrate balance
@@ -62,27 +61,27 @@
   });
 
   // We can't handle sending balance to backing storage of evm balance, because evmToAddress operation is irreversible
-  itWeb3('Wei sent directly to backing storage of evm contract balance is unaccounted', async({api, web3}) => {
+  itWeb3('Wei sent directly to backing storage of evm contract balance is unaccounted', async({api, web3, privateKeyWrapper}) => {
     const deployer = await createEthAccountWithBalance(api, web3);
     const contract = await deployCollector(web3, deployer);
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     await transferBalanceExpectSuccess(api, alice, evmToAddress(contract.options.address), '10000');
 
     expect(await contract.methods.getUnaccounted().call()).to.be.equal('10000');
   });
 
-  itWeb3('Balance can be retrieved from evm contract', async({api, web3}) => {
+  itWeb3('Balance can be retrieved from evm contract', async({api, web3, privateKeyWrapper}) => {
     const FEE_BALANCE = 1000n * UNIQUE;
     const CONTRACT_BALANCE = 1n * UNIQUE;
 
     const deployer = await createEthAccountWithBalance(api, web3);
     const contract = await deployCollector(web3, deployer);
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     await web3.eth.sendTransaction({from: deployer, to: contract.options.address, value: CONTRACT_BALANCE.toString(), ...GAS_ARGS});
 
-    const receiver = privateKey(`//Receiver${Date.now()}`);
+    const receiver = privateKeyWrapper!(`//Receiver${Date.now()}`);
 
     // First receive balance on eth balance of bob
     {
modifiedtests/src/eth/proxy/fungibleProxy.test.tsdiffbeforeafterboth
--- a/tests/src/eth/proxy/fungibleProxy.test.ts
+++ b/tests/src/eth/proxy/fungibleProxy.test.ts
@@ -14,7 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from '../../substrate/privateKey';
 import {createCollectionExpectSuccess, createFungibleItemExpectSuccess} from '../../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers';
 import fungibleAbi from '../fungibleAbi.json';
@@ -35,12 +34,12 @@
 }
 
 describe('Fungible (Via EVM proxy): Information getting', () => {
-  itWeb3('totalSupply', async ({api, web3}) => {
+  itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
 
     await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Substrate: alice.address});
@@ -52,12 +51,12 @@
     expect(totalSupply).to.equal('200');
   });
 
-  itWeb3('balanceOf', async ({api, web3}) => {
+  itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
 
     await createFungibleItemExpectSuccess(alice, collection, {Value: 200n}, {Ethereum: caller});
@@ -71,12 +70,12 @@
 });
 
 describe('Fungible (Via EVM proxy): Plain calls', () => {
-  itWeb3('Can perform approve()', async ({web3, api}) => {
+  itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const spender = createEthAccount(web3);
 
@@ -107,12 +106,12 @@
     }
   });
 
-  itWeb3('Can perform transferFrom()', async ({web3, api}) => {
+  itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const owner = await createEthAccountWithBalance(api, web3);
 
@@ -162,12 +161,12 @@
     }
   });
 
-  itWeb3('Can perform transfer()', async ({web3, api}) => {
+  itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
       mode: {type: 'Fungible', decimalPoints: 0},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const receiver = await createEthAccountWithBalance(api, web3);
 
modifiedtests/src/eth/proxy/nonFungibleProxy.test.tsdiffbeforeafterboth
--- a/tests/src/eth/proxy/nonFungibleProxy.test.ts
+++ b/tests/src/eth/proxy/nonFungibleProxy.test.ts
@@ -14,7 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from '../../substrate/privateKey';
 import {createCollectionExpectSuccess, createItemExpectSuccess} from '../../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents} from '../util/helpers';
 import nonFungibleAbi from '../nonFungibleAbi.json';
@@ -36,11 +35,11 @@
 }
 
 describe('NFT (Via EVM proxy): Information getting', () => {
-  itWeb3('totalSupply', async ({api, web3}) => {
+  itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
 
     await createItemExpectSuccess(alice, collection, 'NFT', {Substrate: alice.address});
@@ -52,11 +51,11 @@
     expect(totalSupply).to.equal('1');
   });
 
-  itWeb3('balanceOf', async ({api, web3}) => {
+  itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
     await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});
@@ -70,11 +69,11 @@
     expect(balance).to.equal('3');
   });
 
-  itWeb3('ownerOf', async ({api, web3}) => {
+  itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
     const tokenId = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: caller});
@@ -89,11 +88,11 @@
 
 describe('NFT (Via EVM proxy): Plain calls', () => {
   //TODO: CORE-302 add eth methods
-  itWeb3.skip('Can perform mint()', async ({web3, api}) => {
+  itWeb3.skip('Can perform mint()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const receiver = createEthAccount(web3);
 
@@ -130,11 +129,11 @@
   });
   
   //TODO: CORE-302 add eth methods
-  itWeb3.skip('Can perform mintBulk()', async ({web3, api}) => {
+  itWeb3.skip('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
 
     const caller = await createEthAccountWithBalance(api, web3);
     const receiver = createEthAccount(web3);
@@ -193,11 +192,11 @@
     }
   });
 
-  itWeb3('Can perform burn()', async ({web3, api}) => {
+  itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
 
     const address = collectionIdToAddress(collection);
@@ -225,11 +224,11 @@
     }
   });
 
-  itWeb3('Can perform approve()', async ({web3, api}) => {
+  itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const spender = createEthAccount(web3);
 
@@ -255,11 +254,11 @@
     }
   });
 
-  itWeb3('Can perform transferFrom()', async ({web3, api}) => {
+  itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const owner = await createEthAccountWithBalance(api, web3);
 
@@ -299,11 +298,11 @@
     }
   });
 
-  itWeb3('Can perform transfer()', async ({web3, api}) => {
+  itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       mode: {type: 'NFT'},
     });
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const receiver = createEthAccount(web3);
 
modifiedtests/src/eth/sponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/eth/sponsoring.test.ts
+++ b/tests/src/eth/sponsoring.test.ts
@@ -15,12 +15,11 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {expect} from 'chai';
-import privateKey from '../substrate/privateKey';
 import {contractHelpers, createEthAccount, createEthAccountWithBalance, deployCollector, deployFlipper, itWeb3, SponsoringMode, transferBalanceToEth} from './util/helpers';
 
 describe('EVM sponsoring', () => {
-  itWeb3('Fee is deducted from contract if sponsoring is enabled', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Fee is deducted from contract if sponsoring is enabled', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = createEthAccount(web3);
@@ -50,8 +49,8 @@
     expect(await web3.eth.getBalance(caller)).to.be.equals(originalCallerBalance);
     expect(await web3.eth.getBalance(flipper.options.address)).to.be.not.equals(originalFlipperBalance);
   });
-  itWeb3('...but this doesn\'t applies to payable value', async ({api, web3}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('...but this doesn\'t applies to payable value', async ({api, web3, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
 
     const owner = await createEthAccountWithBalance(api, web3);
     const caller = await createEthAccountWithBalance(api, web3);
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
--- a/tests/src/eth/tokenProperties.test.ts
+++ b/tests/src/eth/tokenProperties.test.ts
@@ -1,4 +1,3 @@
-import privateKey from '../substrate/privateKey';
 import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess} from '../util/helpers';
 import {cartesian, collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3} from './util/helpers';
 import nonFungibleAbi from './nonFungibleAbi.json';
@@ -6,8 +5,8 @@
 import {executeTransaction} from '../substrate/substrate-api';
 
 describe('EVM token properties', () => {
-  itWeb3('Can be reconfigured', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be reconfigured', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {
       const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
@@ -24,8 +23,8 @@
       });
     }
   });
-  itWeb3('Can be set', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be set', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
     const token = await createItemExpectSuccess(alice, collection, 'NFT');
@@ -47,8 +46,8 @@
     const [{value}] = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toHuman()! as any;
     expect(value).to.equal('testValue');
   });
-  itWeb3('Can be deleted', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be deleted', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = await createEthAccountWithBalance(api, web3);
     const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
     const token = await createItemExpectSuccess(alice, collection, 'NFT');
@@ -72,8 +71,8 @@
     const result = (await api.rpc.unique.tokenProperties(collection, token, ['testKey'])).toJSON()! as any;
     expect(result.length).to.equal(0);
   });
-  itWeb3('Can be read', async({web3, api}) => {
-    const alice = privateKey('//Alice');
+  itWeb3('Can be read', async({web3, api, privateKeyWrapper}) => {
+    const alice = privateKeyWrapper!('//Alice');
     const caller = createEthAccount(web3);
     const collection = await createCollectionExpectSuccess({mode: {type:'NFT'}});
     const token = await createItemExpectSuccess(alice, collection, 'NFT');
modifiedtests/src/eth/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -18,20 +18,20 @@
 /// <reference path="helpers.d.ts" />
 
 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 {addressToEvm, evmToAddress} from '@polkadot/util-crypto';
 import {expect} from 'chai';
-import {CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../../util/helpers';
 import * as solc from 'solc';
+import Web3 from 'web3';
 import config from '../../config';
+import getBalance from '../../substrate/get-balance';
 import privateKey from '../../substrate/privateKey';
-import contractHelpersAbi from './contractHelpersAbi.json';
-import nonFungibleAbi from '../nonFungibleAbi.json';
+import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api';
+import waitNewBlocks from '../../substrate/wait-new-blocks';
+import {CrossAccountId, getDetailedCollectionInfo, getGenericResult, UNIQUE} from '../../util/helpers';
 import collectionHelpersAbi from '../collectionHelpersAbi.json';
-import getBalance from '../../substrate/get-balance';
-import waitNewBlocks from '../../substrate/wait-new-blocks';
+import nonFungibleAbi from '../nonFungibleAbi.json';
+import contractHelpersAbi from './contractHelpersAbi.json';
 
 export const GAS_ARGS = {gas: 2500000};
 
@@ -139,8 +139,8 @@
     });
   });
 }
-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});
+itWeb3.only = (name: string, cb: (apis: { web3: Web3, api: ApiPromise, privateKeyWrapper?: (account: string) => IKeyringPair }) => any) => itWeb3(name, cb, {only: true});
+itWeb3.skip = (name: string, cb: (apis: { web3: Web3, api: ApiPromise, privateKeyWrapper?: (account: string) => IKeyringPair }) => any) => itWeb3(name, cb, {skip: true});
 
 export async function generateSubstrateEthPair(web3: Web3) {
   const account = web3.eth.accounts.create();
modifiedtests/src/inflation.test.tsdiffbeforeafterboth
--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -17,22 +17,21 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import privateKey from './substrate/privateKey';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
 
 describe('integration test: Inflation', () => {
   it('First year inflation is 10%', async () => {
-    await usingApi(async (api) => {
+    await usingApi(async (api, privateKeyWrapper) => {
 
       // Make sure non-sudo can't start inflation
       const tx = api.tx.inflation.startInflation(1);
-      const bob = privateKey('//Bob');
+      const bob = privateKeyWrapper!('//Bob');
       await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected;
 
       // Start inflation on relay block 1 (Alice is sudo)
-      const alice = privateKey('//Alice');
+      const alice = privateKeyWrapper!('//Alice');
       const sudoTx = api.tx.sudo.sudo(tx as any);
       await submitTransactionAsync(alice, sudoTx);
 
modifiedtests/src/limits.test.tsdiffbeforeafterboth
--- a/tests/src/limits.test.ts
+++ b/tests/src/limits.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {
   createCollectionExpectSuccess,
@@ -35,8 +34,8 @@
   let alice: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
 
@@ -69,8 +68,8 @@
   let alice: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
 
@@ -103,10 +102,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -166,10 +165,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -233,10 +232,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -296,10 +295,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -337,10 +336,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -369,10 +368,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
modifiedtests/src/mintModes.test.tsdiffbeforeafterboth
--- a/tests/src/mintModes.test.ts
+++ b/tests/src/mintModes.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {
   addToAllowListExpectSuccess,
@@ -33,9 +32,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -112,9 +111,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
modifiedtests/src/nesting/graphs.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/graphs.test.ts
+++ b/tests/src/nesting/graphs.test.ts
@@ -2,7 +2,6 @@
 import {IKeyringPair} from '@polkadot/types/types';
 import {expect} from 'chai';
 import {tokenIdToCross} from '../eth/util/helpers';
-import privateKey from '../substrate/privateKey';
 import usingApi, {executeTransaction} from '../substrate/substrate-api';
 import {getCreateCollectionResult, transferExpectSuccess} from '../util/helpers';
 
@@ -34,8 +33,8 @@
 
 describe('Graphs', () => {
   it('Ouroboros can\'t be created in a complex graph', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
       const collection = await buildComplexObjectGraph(api, alice);
 
       // to self
modifiedtests/src/nesting/migration-check.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/migration-check.test.ts
+++ b/tests/src/nesting/migration-check.test.ts
@@ -1,5 +1,4 @@
 import {expect} from 'chai';
-import privateKey from '../substrate/privateKey';
 import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
 import {getCreateCollectionResult} from '../util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
@@ -13,8 +12,8 @@
   let alice: IKeyringPair;
 
   before(async() => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
   });
 
modifiedtests/src/nesting/nest.test.tsdiffbeforeafterboth
before · tests/src/nesting/nest.test.ts
1import {expect} from 'chai';2import {tokenIdToAddress} from '../eth/util/helpers';3import privateKey from '../substrate/privateKey';4import usingApi, {executeTransaction} from '../substrate/substrate-api';5import {6  addToAllowListExpectSuccess,7  createCollectionExpectSuccess,8  createItemExpectSuccess,9  enableAllowListExpectSuccess,10  enablePublicMintingExpectSuccess,11  getTokenOwner,12  getTopmostTokenOwner,13  normalizeAccountId,14  setCollectionPermissionsExpectSuccess,15  transferExpectFailure,16  transferExpectSuccess,17  transferFromExpectSuccess,18} from '../util/helpers';19import {IKeyringPair} from '@polkadot/types/types';2021let alice: IKeyringPair;22let bob: IKeyringPair;2324describe('Integration Test: Nesting', () => {25  before(async () => {26    await usingApi(async () => {27      alice = privateKey('//Alice');28      bob = privateKey('//Bob');29    });30  });3132  it('Performs the full suite: bundles a token, transfers, and unnests', async () => {33    await usingApi(async api => {34      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});35      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});36      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');3738      // Create a nested token39      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});40      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});41      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});4243      // Create a token to be nested44      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');4546      // Nest47      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});48      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});49      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});5051      // Move bundle to different user52      await transferExpectSuccess(collection, targetToken, alice, {Substrate: bob.address});53      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address});54      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});5556      // Unnest57      await transferFromExpectSuccess(collection, newToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}, {Substrate: bob.address});58      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});59    });60  });6162  it('Transfers an already bundled token', async () => {63    await usingApi(async api => {64      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});65      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});6667      const tokenA = await createItemExpectSuccess(alice, collection, 'NFT');68      const tokenB = await createItemExpectSuccess(alice, collection, 'NFT');6970      // Create a nested token71      const tokenC = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, tokenA)});72      expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});73      expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenA).toLowerCase()});7475      // Transfer the nested token to another token76      await expect(executeTransaction(77        api,78        alice,79        api.tx.unique.transferFrom(80          normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenA)}), 81          normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenB)}), 82          collection,83          tokenC,84          1,85        ),86      )).to.not.be.rejected;87      expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});88      expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenB).toLowerCase()});89    });90  });9192  // ---------- Non-Fungible ----------9394  it('NFT: allows an Owner to nest/unnest their token', async () => {95    await usingApi(async api => {96      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});97      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});98      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');99100      // Create a nested token101      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});102      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});103      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});104105      // Create a token to be nested and nest106      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');107      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});108      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});109      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});110    });111  });112113  it('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {114    await usingApi(async api => {115      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});116      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {OwnerRestricted:[collection]}});117      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');118119      // Create a nested token120      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});121      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});122      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});123124      // Create a token to be nested and nest125      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');126      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});127      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});128      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});129    });130  });131132  // ---------- Fungible ----------133134  it('Fungible: allows an Owner to nest/unnest their token', async () => {135    await usingApi(async api => {136      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});137      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: 'Owner'});138      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});139      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};140141      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});142143      // Create a nested token144      await expect(executeTransaction(api, alice, api.tx.unique.createItem(145        collectionFT,146        targetAddress,147        {Fungible: {Value: 10}},148      ))).to.not.be.rejected;149150      // Nest a new token151      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');152      await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible');153    });154  });155156  it('Fungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {157    await usingApi(async api => {158      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});159      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});160      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};161162      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});163164      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {OwnerRestricted: [collectionFT]}});165166      // Create a nested token167      await expect(executeTransaction(api, alice, api.tx.unique.createItem(168        collectionFT,169        targetAddress,170        {Fungible: {Value: 10}},171      ))).to.not.be.rejected;172173      // Nest a new token174      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');175      await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible');176    });177  });178179  // ---------- Re-Fungible ----------180181  it('ReFungible: allows an Owner to nest/unnest their token', async () => {182    await usingApi(async api => {183      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});184      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: 'Owner'});185      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});186      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};187188      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});189190      // Create a nested token191      await expect(executeTransaction(api, alice, api.tx.unique.createItem(192        collectionRFT,193        targetAddress,194        {ReFungible: {const_data: [], pieces: 100}},195      ))).to.not.be.rejected;196197      // Nest a new token198      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');199      await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible');200    });201  });202203  it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {204    await usingApi(async api => {205      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});206      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});207      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};208209      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});210211      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {OwnerRestricted:[collectionRFT]}});212213      // Create a nested token214      await expect(executeTransaction(api, alice, api.tx.unique.createItem(215        collectionRFT,216        targetAddress,217        {ReFungible: {const_data: [], pieces: 100}},218      ))).to.not.be.rejected;219220      // Nest a new token221      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');222      await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible');223    });224  });225});226227describe('Negative Test: Nesting', async() => {228  before(async () => {229    await usingApi(async () => {230      alice = privateKey('//Alice');231      bob = privateKey('//Bob');232    });233  });234235  it('Disallows excessive token nesting', async () => {236    await usingApi(async api => {237      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});238      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});239      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');240241      const maxNestingLevel = 5;242      let prevToken = targetToken;243244      // Create a nested-token matryoshka245      for (let i = 0; i < maxNestingLevel; i++) {246        const nestedToken = await createItemExpectSuccess(247          alice,248          collection,249          'NFT',250          {Ethereum: tokenIdToAddress(collection, prevToken)},251        );252253        prevToken = nestedToken;254      }255256      // The nesting depth is limited by `maxNestingLevel`257      await expect(executeTransaction(api, alice, api.tx.unique.createItem(258        collection,259        {Ethereum: tokenIdToAddress(collection, prevToken)},260          {nft: {const_data: [], variable_data: []}} as any,261      )), 'while creating nested token').to.be.rejectedWith(/^structure\.DepthLimit$/);262263      expect(await getTopmostTokenOwner(api, collection, prevToken)).to.be.deep.equal({Substrate: alice.address});264    });265  });266267  // ---------- Non-Fungible ----------268269  it('NFT: disallows to nest token if nesting is disabled', async () => {270    await usingApi(async api => {271      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});272      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Disabled'});273      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');274275      // Try to create a nested token276      await expect(executeTransaction(api, alice, api.tx.unique.createItem(277        collection,278        {Ethereum: tokenIdToAddress(collection, targetToken)},279          {nft: {const_data: [], variable_data: []}} as any,280      )), 'while creating nested token').to.be.rejectedWith(/^common\.NestingIsDisabled$/);281282      // Create a token to be nested283      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');284      // Try to nest285      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.NestingIsDisabled/);286      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});287      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});288    });289  });290291  it('NFT: disallows a non-Owner to nest someone else\'s token', async () => {292    await usingApi(async api => {293      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});294      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: 'Owner'});295296      await addToAllowListExpectSuccess(alice, collection, bob.address);297      await enableAllowListExpectSuccess(alice, collection);298      await enablePublicMintingExpectSuccess(alice, collection);299300      // Create a token to attempt to be nested into301      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');302303      // Try to create a nested token in the wrong collection304      await expect(executeTransaction(api, alice, api.tx.unique.createItem(305        collection,306        {Ethereum: tokenIdToAddress(collection, targetToken)},307          {nft: {const_data: [], variable_data: []}} as any,308      )), 'while creating nested token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);309310      // Try to create and nest a token in the wrong collection311      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');312      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);313      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});314    });315  });316317  it('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {318    await usingApi(async api => {319      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});320      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {OwnerRestricted:[collection]}});321322      await addToAllowListExpectSuccess(alice, collection, bob.address);323      await enableAllowListExpectSuccess(alice, collection);324      await enablePublicMintingExpectSuccess(alice, collection);325326      // Create a token to attempt to be nested into327      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');328329      // Try to create a nested token in the wrong collection330      await expect(executeTransaction(api, alice, api.tx.unique.createItem(331        collection,332        {Ethereum: tokenIdToAddress(collection, targetToken)},333          {nft: {const_data: [], variable_data: []}} as any,334      )), 'while creating nested token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);335336      // Try to create and nest a token in the wrong collection337      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');338      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);339      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});340    });341  });342343  it('NFT: disallows to nest token in an unlisted collection', async () => {344    await usingApi(async api => {345      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});346      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {OwnerRestricted:[]}});347348      // Create a token to attempt to be nested into349      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');350351      // Try to create a nested token in the wrong collection352      await expect(executeTransaction(api, alice, api.tx.unique.createItem(353        collection,354        {Ethereum: tokenIdToAddress(collection, targetToken)},355          {nft: {const_data: [], variable_data: []}} as any,356      )), 'while creating nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);357358      // Try to create and nest a token in the wrong collection359      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');360      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);361      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});362    });363  });364365  // ---------- Fungible ----------366367  it('Fungible: disallows to nest token if nesting is disabled', async () => {368    await usingApi(async api => {369      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});370      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: 'Disabled'});371      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');372      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};373374      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});375376      // Try to create a nested token377      await expect(executeTransaction(api, alice, api.tx.unique.createItem(378        collectionFT,379        targetAddress,380        {Fungible: {Value: 10}},381      )), 'while creating nested token').to.be.rejectedWith(/^common\.NestingIsDisabled$/);382383      // Create a token to be nested384      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');385      // Try to nest386      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.NestingIsDisabled/);387388      // Create another token to be nested389      const newToken2 = await createItemExpectSuccess(alice, collectionFT, 'Fungible');390      // Try to nest inside a fungible token391      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionFT, newToken)}, collectionFT, newToken2, 1)), 'while nesting new token inside fungible').to.be.rejectedWith(/fungible\.FungibleDisallowsNesting/);392    });393  });394395  it('Fungible: disallows a non-Owner to nest someone else\'s token', async () => {396    await usingApi(async api => {397      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});398      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: 'Owner'});399400      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);401      await enableAllowListExpectSuccess(alice, collectionNFT);402      await enablePublicMintingExpectSuccess(alice, collectionNFT);403404      // Create a token to attempt to be nested into405      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');406      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};407408      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});409410      // Try to create a nested token in the wrong collection411      await expect(executeTransaction(api, alice, api.tx.unique.createItem(412        collectionFT,413        targetAddress,414        {Fungible: {Value: 10}},415      )), 'while creating nested token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);416417      // Try to create and nest a token in the wrong collection418      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');419      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);420    });421  });422423  it('Fungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {424    await usingApi(async api => {425      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});426      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);427      await enableAllowListExpectSuccess(alice, collectionNFT);428      await enablePublicMintingExpectSuccess(alice, collectionNFT);429430      // Create a token to attempt to be nested into431      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');432      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};433434      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});435      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {OwnerRestricted:[collectionFT]}});436437      // Try to create a nested token in the wrong collection438      await expect(executeTransaction(api, alice, api.tx.unique.createItem(439        collectionFT,440        targetAddress,441        {Fungible: {Value: 10}},442      )), 'while creating nested token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);443444      // Try to create and nest a token in the wrong collection445      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');446      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);447    });448  });449450  it('Fungible: disallows to nest token in an unlisted collection', async () => {451    await usingApi(async api => {452      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});453      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {OwnerRestricted:[]}});454455      // Create a token to attempt to be nested into456      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');457      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};458459      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});460461      // Try to create a nested token in the wrong collection462      await expect(executeTransaction(api, alice, api.tx.unique.createItem(463        collectionFT,464        targetAddress,465        {Fungible: {Value: 10}},466      )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);467468      // Try to create and nest a token in the wrong collection469      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');470      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);471    });472  });473474  // ---------- Re-Fungible ----------475476  it('ReFungible: disallows to nest token if nesting is disabled', async () => {477    await usingApi(async api => {478      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});479      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: 'Disabled'});480      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');481      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};482483      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});484485      // Create a nested token486      await expect(executeTransaction(api, alice, api.tx.unique.createItem(487        collectionRFT,488        targetAddress,489        {ReFungible: {const_data: [], pieces: 100}},490      )), 'while creating a nested token').to.be.rejectedWith(/^common\.NestingIsDisabled$/);491492      // Create a token to be nested493      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');494      // Try to nest495      await transferExpectFailure(collectionRFT, newToken, alice, targetAddress, 100);496      // Try to nest497      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.NestingIsDisabled/);498499      // Create another token to be nested500      const newToken2 = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');501      // Try to nest inside a fungible token502      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionRFT, newToken)}, collectionRFT, newToken2, 1)), 'while nesting new token inside refungible').to.be.rejectedWith(/refungible\.RefungibleDisallowsNesting/);503    });504  });505506  it('ReFungible: disallows a non-Owner to nest someone else\'s token', async () => {507    await usingApi(async api => {508      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});509      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: 'Owner'});510511      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);512      await enableAllowListExpectSuccess(alice, collectionNFT);513      await enablePublicMintingExpectSuccess(alice, collectionNFT);514515      // Create a token to attempt to be nested into516      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');517      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};518519      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});520521      // Try to create a nested token in the wrong collection522      await expect(executeTransaction(api, alice, api.tx.unique.createItem(523        collectionRFT,524        targetAddress,525        {ReFungible: {const_data: [], pieces: 100}},526      )), 'while creating a nested token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);527528      // Try to create and nest a token in the wrong collection529      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');530      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);531    });532  });533534  it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {535    await usingApi(async api => {536      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});537      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);538      await enableAllowListExpectSuccess(alice, collectionNFT);539      await enablePublicMintingExpectSuccess(alice, collectionNFT);540541      // Create a token to attempt to be nested into542      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');543      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};544545      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});546      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {OwnerRestricted:[collectionRFT]}});547548      // Try to create a nested token in the wrong collection549      await expect(executeTransaction(api, alice, api.tx.unique.createItem(550        collectionRFT,551        targetAddress,552        {ReFungible: {const_data: [], pieces: 100}},553      )), 'while creating a nested token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);554555      // Try to create and nest a token in the wrong collection556      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');557      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.OnlyOwnerAllowedToNest/);558    });559  });560561  it('ReFungible: disallows to nest token to an unlisted collection', async () => {562    await usingApi(async api => {563      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});564      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {OwnerRestricted:[]}});565566      // Create a token to attempt to be nested into567      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');568      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};569570      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});571572      // Try to create a nested token in the wrong collection573      await expect(executeTransaction(api, alice, api.tx.unique.createItem(574        collectionRFT,575        targetAddress,576        {ReFungible: {const_data: [], pieces: 100}},577      )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);578579      // Try to create and nest a token in the wrong collection580      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');581      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);582    });583  });584});
modifiedtests/src/nesting/properties.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/properties.test.ts
+++ b/tests/src/nesting/properties.test.ts
@@ -1,5 +1,4 @@
 import {expect} from 'chai';
-import privateKey from '../substrate/privateKey';
 import usingApi, {executeTransaction} from '../substrate/substrate-api';
 import {
   addCollectionAdminExpectSuccess,
@@ -16,9 +15,9 @@
 
 describe('Composite Properties Test', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -63,9 +62,9 @@
 
 describe('Integration Test: Collection Properties', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -158,9 +157,9 @@
 
 describe('Negative Integration Test: Collection Properties', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
   
@@ -290,9 +289,9 @@
 
 describe('Integration Test: Access Rights to Token Properties', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
   
@@ -356,9 +355,9 @@
 
 describe('Negative Integration Test: Access Rights to Token Properties', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -474,10 +473,10 @@
   let permissions: {permission: any, signers: IKeyringPair[]}[];
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
 
       permissions = [
         {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob]},
@@ -639,11 +638,11 @@
   let constitution: {permission: any, signers: IKeyringPair[], sinner: IKeyringPair}[];
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
-      const dave = privateKey('//Dave');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
+      const dave = privateKeyWrapper!('//Dave');
 
       constitution = [
         {permission: {mutable: true, collectionAdmin: true}, signers: [alice, bob], sinner: charlie},
modifiedtests/src/nesting/rules-smoke.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/rules-smoke.test.ts
+++ b/tests/src/nesting/rules-smoke.test.ts
@@ -1,6 +1,5 @@
 import {expect} from 'chai';
 import {tokenIdToAddress} from '../eth/util/helpers';
-import privateKey from '../substrate/privateKey';
 import usingApi, {executeTransaction} from '../substrate/substrate-api';
 import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, CrossAccountId, getCreateCollectionResult} from '../util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
@@ -9,9 +8,9 @@
   let alice!: IKeyringPair;
   let nestTarget!: CrossAccountId;
   before(async() => {
-    await usingApi(async api => {
-      alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       const events = await executeTransaction(api, alice, api.tx.unique.createCollectionEx({
         mode: 'NFT',
         permissions: {
modifiedtests/src/nesting/unnest.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/unnest.test.ts
+++ b/tests/src/nesting/unnest.test.ts
@@ -1,6 +1,5 @@
 import {expect} from 'chai';
 import {tokenIdToAddress} from '../eth/util/helpers';
-import privateKey from '../substrate/privateKey';
 import usingApi, {executeTransaction} from '../substrate/substrate-api';
 import {
   createCollectionExpectSuccess,
@@ -19,9 +18,9 @@
 
 describe('Integration Test: Unnesting', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -110,9 +109,9 @@
 
 describe('Negative Test: Unnesting', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
modifiedtests/src/nextSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/nextSponsoring.test.ts
+++ b/tests/src/nextSponsoring.test.ts
@@ -18,7 +18,6 @@
 import {IKeyringPair} from '@polkadot/types/types';
 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,
@@ -40,9 +39,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
modifiedtests/src/overflow.test.tsdiffbeforeafterboth
--- a/tests/src/overflow.test.ts
+++ b/tests/src/overflow.test.ts
@@ -17,7 +17,6 @@
 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 {approveExpectSuccess, createCollectionExpectSuccess, createFungibleItemExpectSuccess, getAllowance, getBalance, transferExpectFailure, transferExpectSuccess, transferFromExpectFail, transferFromExpectSuccess, U128_MAX} from './util/helpers';
 
@@ -30,10 +29,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
modifiedtests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth
--- a/tests/src/removeCollectionAdmin.test.ts
+++ b/tests/src/removeCollectionAdmin.test.ts
@@ -14,10 +14,8 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import {ApiPromise} from '@polkadot/api';
 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, destroyCollectionExpectSuccess, getAdminList, normalizeAccountId, queryCollectionExpectSuccess} from './util/helpers';
 
@@ -26,10 +24,10 @@
 
 describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {
   it('Remove collection admin.', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.deep.eq(alice.address);
       // first - add collection admin Bob
@@ -49,11 +47,11 @@
   });
 
   it('Remove collection admin by admin.', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
       const collection = await queryCollectionExpectSuccess(api, collectionId);
       expect(collection.owner.toString()).to.be.eq(alice.address);
       // first - add collection admin Bob
@@ -76,8 +74,8 @@
   });
 
   it('Remove admin from collection that has no admins', async () => {
-    await usingApi(async (api: ApiPromise) => {
-      const alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
       const collectionId = await createCollectionExpectSuccess();
 
       const adminListBeforeAddAdmin = await getAdminList(api, collectionId);
@@ -91,11 +89,11 @@
 
 describe('Negative Integration Test removeCollectionAdmin(collection_id, account_id):', () => {
   it('Can\'t remove collection admin from not existing collection', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       // tslint:disable-next-line: no-bitwise
       const collectionId = (1 << 32) - 1;
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       const changeOwnerTx = api.tx.unique.removeCollectionAdmin(collectionId, normalizeAccountId(bob.address));
       await expect(submitTransactionExpectFailAsync(alice, changeOwnerTx)).to.be.rejected;
@@ -106,11 +104,11 @@
   });
 
   it('Can\'t remove collection admin from deleted collection', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       // tslint:disable-next-line: no-bitwise
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
 
       await destroyCollectionExpectSuccess(collectionId);
 
@@ -123,11 +121,11 @@
   });
 
   it('Regular user Can\'t remove collection admin', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess();
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       const addAdminTx = api.tx.unique.addCollectionAdmin(collectionId, normalizeAccountId(bob.address));
       await submitTransactionAsync(alice, addAdminTx);
modifiedtests/src/removeFromAllowList.test.tsdiffbeforeafterboth
--- a/tests/src/removeFromAllowList.test.ts
+++ b/tests/src/removeFromAllowList.test.ts
@@ -31,7 +31,6 @@
   addCollectionAdminExpectSuccess,
 } from './util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 
 chai.use(chaiAsPromised);
 const expect = chai.expect;
@@ -41,9 +40,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -75,9 +74,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -107,10 +106,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
modifiedtests/src/removeFromContractAllowList.test.tsdiffbeforeafterboth
--- a/tests/src/removeFromContractAllowList.test.ts
+++ b/tests/src/removeFromContractAllowList.test.ts
@@ -14,7 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from './util/contracthelpers';
 import {addToContractAllowListExpectSuccess, isAllowlistedInContract, removeFromContractAllowListExpectFailure, removeFromContractAllowListExpectSuccess, toggleContractAllowlistExpectSuccess} from './util/helpers';
@@ -25,8 +24,8 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -70,9 +69,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
modifiedtests/src/rpc.load.tsdiffbeforeafterboth
--- a/tests/src/rpc.load.ts
+++ b/tests/src/rpc.load.ts
@@ -20,7 +20,6 @@
 import {ApiPromise, Keyring} from '@polkadot/api';
 import {findUnusedAddress} from './util/helpers';
 import fs from 'fs';
-import privateKey from './substrate/privateKey';
 
 const value = 0;
 const gasLimit = 500000n * 1000000n;
@@ -121,13 +120,13 @@
   });
 
   it('Smart Contract RPC Load Test', async () => {
-    await usingApi(async api => {
+    await usingApi(async (api, privateKeyWrapper) => {
 
       // Deploy smart contract
       const [contract, deployer] = await deployLoadTester(api);
 
       // Fill smart contract up with data
-      const bob = privateKey('//Bob');
+      const bob = privateKeyWrapper!('//Bob');
       const tx = contract.tx.bloat(value, gasLimit, 200);
       await submitTransactionAsync(bob, tx);
 
modifiedtests/src/scheduler.test.tsdiffbeforeafterboth
--- a/tests/src/scheduler.test.ts
+++ b/tests/src/scheduler.test.ts
@@ -16,7 +16,6 @@
 
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {
   createItemExpectSuccess,
@@ -30,9 +29,9 @@
 
 describe.skip('Integration Test scheduler base transaction', () => {
   it('User can transfer owned token with delay (scheduler)', async () => {
-    await usingApi(async () => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
modifiedtests/src/setChainLimits.test.tsdiffbeforeafterboth
--- a/tests/src/setChainLimits.test.ts
+++ b/tests/src/setChainLimits.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {
   createCollectionExpectSuccess,
@@ -31,10 +30,10 @@
   let limits: IChainLimits;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      dave = privateKey('//Dave');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      dave = privateKeyWrapper!('//Dave');
       limits = {
         collectionNumbersLimit : 1,
         accountTokenOwnershipLimit: 1,
modifiedtests/src/setContractSponsoringRateLimit.test.tsdiffbeforeafterboth
--- a/tests/src/setContractSponsoringRateLimit.test.ts
+++ b/tests/src/setContractSponsoringRateLimit.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import waitNewBlocks from './substrate/wait-new-blocks';
 import {deployFlipper, toggleFlipValueExpectFailure, toggleFlipValueExpectSuccess} from './util/contracthelpers';
@@ -57,7 +56,9 @@
   let alice: IKeyringPair;
 
   before(async () => {
-    alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+    });
   });
 
   it('fails when called for non-contract address', async () => {
modifiedtests/src/setMintPermission.test.tsdiffbeforeafterboth
--- a/tests/src/setMintPermission.test.ts
+++ b/tests/src/setMintPermission.test.ts
@@ -15,7 +15,6 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 import usingApi from './substrate/substrate-api';
 import {
   addToAllowListExpectSuccess,
@@ -35,9 +34,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -75,9 +74,9 @@
   let bob: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
modifiedtests/src/setPublicAccessMode.test.tsdiffbeforeafterboth
--- a/tests/src/setPublicAccessMode.test.ts
+++ b/tests/src/setPublicAccessMode.test.ts
@@ -19,7 +19,6 @@
 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 {
   addToAllowListExpectSuccess,
@@ -41,9 +40,9 @@
 
 describe('Integration Test setPublicAccessMode(): ', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -108,9 +107,9 @@
 
 describe('Negative Integration Test ext. collection admin setPublicAccessMode(): ', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
   it('setPublicAccessMode by collection admin', async () => {
modifiedtests/src/toggleContractAllowList.test.tsdiffbeforeafterboth
--- a/tests/src/toggleContractAllowList.test.ts
+++ b/tests/src/toggleContractAllowList.test.ts
@@ -17,7 +17,6 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import usingApi, {submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import privateKey from './substrate/privateKey';
 import {
   deployFlipper,
   getFlipValue,
@@ -50,8 +49,8 @@
   });
 
   it('Only allowlisted account can call contract', async () => {
-    await usingApi(async api => {
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const bob = privateKeyWrapper!('//Bob');
 
       const [contract, deployer] = await deployFlipper(api);
 
@@ -135,9 +134,9 @@
 describe.skip('Negative Integration Test toggleContractAllowList', () => {
 
   it('Enable allow list for a non-contract', async () => {
-    await usingApi(async api => {
-      const alice = privateKey('//Alice');
-      const bobGuineaPig = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bobGuineaPig = privateKeyWrapper!('//Bob');
 
       const enabledBefore = (await api.query.unique.contractAllowListEnabled(bobGuineaPig.address)).toJSON();
       const enableAllowListTx = api.tx.unique.toggleContractAllowList(bobGuineaPig.address, true);
@@ -150,8 +149,8 @@
   });
 
   it('Enable allow list using a non-owner address', async () => {
-    await usingApi(async api => {
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const bob = privateKeyWrapper!('//Bob');
       const [contract] = await deployFlipper(api);
 
       const enabledBefore = (await api.query.unique.contractAllowListEnabled(contract.address)).toJSON();
modifiedtests/src/transfer.nload.tsdiffbeforeafterboth
--- a/tests/src/transfer.nload.ts
+++ b/tests/src/transfer.nload.ts
@@ -16,7 +16,6 @@
 
 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';
@@ -95,11 +94,11 @@
   });
   const waiting: Promise<void>[] = [];
   console.log(`Starting ${os.cpus().length} workers`);
-  usingApi(async (api) => {
-    const alice = privateKey('//Alice');
+  usingApi(async (api, privateKeyWrapper) => {
+    const alice = privateKeyWrapper!('//Alice');
     for (const id in os.cpus()) {
       const WORKER_NAME = `//LoadWorker${id}_${Date.now()}`;
-      const workerAccount = privateKey(WORKER_NAME);
+      const workerAccount = privateKeyWrapper!(WORKER_NAME);
       const tx = api.tx.balances.transfer(workerAccount.address, 400n * 10n ** 23n);
       await submitTransactionAsync(alice, tx);
 
@@ -119,8 +118,8 @@
   });
 } else {
   increaseCounter('startedWorkers', 1);
-  usingApi(async (api) => {
-    await distributeBalance(privateKey(process.env.WORKER_NAME as string), api, 400n * 10n ** 22n, 10);
+  usingApi(async (api, privateKeyWrapper) => {
+    await distributeBalance(privateKeyWrapper!(process.env.WORKER_NAME as string), api, 400n * 10n ** 22n, 10);
   });
   const interval = setInterval(() => {
     flushCounterToMaster();
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -19,7 +19,6 @@
 import {expect} from 'chai';
 import {alicesPublicKey, bobsPublicKey} from './accounts';
 import getBalance from './substrate/get-balance';
-import privateKey from './substrate/privateKey';
 import {default as usingApi, submitTransactionAsync} from './substrate/substrate-api';
 import {
   burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess,
@@ -49,10 +48,10 @@
 
 describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
   it('Balance transfers and check balance', async () => {
-    await usingApi(async (api: ApiPromise) => {
+    await usingApi(async (api, privateKeyWrapper) => {
       const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
 
-      const alicePrivateKey = privateKey('//Alice');
+      const alicePrivateKey = privateKeyWrapper!('//Alice');
 
       const transfer = api.tx.balances.transfer(bobsPublicKey, 1n);
       const events = await submitTransactionAsync(alicePrivateKey, transfer);
@@ -87,9 +86,9 @@
   });
 
   it('User can transfer owned token', async () => {
-    await usingApi(async () => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
@@ -114,9 +113,9 @@
   });
 
   it('Collection admin can transfer owned token', async () => {
-    await usingApi(async () => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address);
@@ -145,10 +144,10 @@
 
 describe('Negative Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
   it('Transfer with not existed collection_id', async () => {
@@ -258,9 +257,9 @@
 
 describe('Zero value transfer(From)', () => {
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
     });
   });
 
@@ -315,9 +314,9 @@
 });
 
 describe('Transfers to self (potentially over substrate-evm boundary)', () => {
-  itWeb3('Transfers to self. In case of same frontend', async ({api}) => {
+  itWeb3('Transfers to self. In case of same frontend', async ({api, privateKeyWrapper}) => {
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const aliceProxy = subToEth(alice.address);
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
     await transferExpectSuccess(collectionId, tokenId, alice, {Ethereum: aliceProxy}, 10, 'Fungible');
@@ -327,9 +326,9 @@
     expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);
   });
 
-  itWeb3('Transfers to self. In case of substrate-evm boundary', async ({api}) => {
+  itWeb3('Transfers to self. In case of substrate-evm boundary', async ({api, privateKeyWrapper}) => {
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const aliceProxy = subToEth(alice.address);
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
     const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
@@ -339,9 +338,9 @@
     expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);
   });
 
-  itWeb3('Transfers to self. In case of inside substrate-evm', async ({api}) => {
+  itWeb3('Transfers to self. In case of inside substrate-evm', async ({api, privateKeyWrapper}) => {
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
     const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
     await transferExpectSuccess(collectionId, tokenId, alice, alice , 10, 'Fungible');
@@ -350,9 +349,9 @@
     expect(balanceAliceBefore).to.be.eq(balanceAliceAfter);
   });
 
-  itWeb3('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({api}) => {
+  itWeb3('Transfers to self. In case of inside substrate-evm when not enought "Fungibles"', async ({api, privateKeyWrapper}) => {
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-    const alice = privateKey('//Alice');
+    const alice = privateKeyWrapper!('//Alice');
     const tokenId = await createItemExpectSuccess(alice, collectionId, 'Fungible', {Substrate: alice.address});
     const balanceAliceBefore = await getTokenBalance(api, collectionId, normalizeAccountId(alice), tokenId);
     await transferExpectFailure(collectionId, tokenId, alice, alice , 11);
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- a/tests/src/transferFrom.test.ts
+++ b/tests/src/transferFrom.test.ts
@@ -18,7 +18,6 @@
 import {IKeyringPair} from '@polkadot/types/types';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-import privateKey from './substrate/privateKey';
 import {default as usingApi} from './substrate/substrate-api';
 import {
   approveExpectFail,
@@ -43,10 +42,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -83,10 +82,10 @@
   });
 
   it('Should reduce allowance if value is big', async () => {
-    await usingApi(async (api) => {
-      const alice = privateKey('//Alice');
-      const bob = privateKey('//Bob');
-      const charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const alice = privateKeyWrapper!('//Alice');
+      const bob = privateKeyWrapper!('//Bob');
+      const charlie = privateKeyWrapper!('//Charlie');
 
       // fungible
       const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
@@ -112,10 +111,10 @@
   let charlie: IKeyringPair;
 
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
-      bob = privateKey('//Bob');
-      charlie = privateKey('//Charlie');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
+      bob = privateKeyWrapper!('//Bob');
+      charlie = privateKeyWrapper!('//Charlie');
     });
   });
 
@@ -216,8 +215,8 @@
   });
 
   it('execute transferFrom from account that is not owner of collection', async () => {
-    await usingApi(async () => {
-      const dave = privateKey('//Dave');
+    await usingApi(async (api, privateKeyWrapper) => {
+      const dave = privateKeyWrapper!('//Dave');
       // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -24,7 +24,6 @@
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import {alicesPublicKey} from '../accounts';
-import privateKey from '../substrate/privateKey';
 import {default as usingApi, executeTransaction, submitTransactionAsync, submitTransactionExpectFailAsync} from '../substrate/substrate-api';
 import {hexToStr, strToUTF16, utf16ToStr} from './util';
 import {UpDataStructsRpcCollection, UpDataStructsCreateItemData, UpDataStructsProperty} from '@polkadot/types/lookup';
@@ -325,12 +324,12 @@
   const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params};
 
   let collectionId = 0;
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
     // Get number of collections before the transaction
     const collectionCountBefore = await getCreatedCollectionCount(api);
 
     // Run the CreateCollection transaction
-    const alicePrivateKey = privateKey('//Alice');
+    const alicePrivateKey = privateKeyWrapper!('//Alice');
 
     let modeprm = {};
     if (mode.type === 'NFT') {
@@ -378,12 +377,12 @@
   const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params};
 
   let collectionId = 0;
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
     // Get number of collections before the transaction
     const collectionCountBefore = await getCreatedCollectionCount(api);
 
     // Run the CreateCollection transaction
-    const alicePrivateKey = privateKey('//Alice');
+    const alicePrivateKey = privateKeyWrapper!('//Alice');
 
     let modeprm = {};
     if (mode.type === 'NFT') {
@@ -426,12 +425,12 @@
 export async function createCollectionWithPropsExpectFailure(params: Partial<CreateCollectionParams> = {}) {
   const {name, description, mode, tokenPrefix} = {...defaultCreateCollectionParams, ...params};
 
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
     // Get number of collections before the transaction
     const collectionCountBefore = await getCreatedCollectionCount(api);
 
     // Run the CreateCollection transaction
-    const alicePrivateKey = privateKey('//Alice');
+    const alicePrivateKey = privateKeyWrapper!('//Alice');
 
     let modeprm = {};
     if (mode.type === 'NFT') {
@@ -465,12 +464,12 @@
     modeprm = {refungible: null};
   }
 
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
     // Get number of collections before the transaction
     const collectionCountBefore = await getCreatedCollectionCount(api);
 
     // Run the CreateCollection transaction
-    const alicePrivateKey = privateKey('//Alice');
+    const alicePrivateKey = privateKeyWrapper!('//Alice');
     const tx = api.tx.unique.createCollectionEx({name: strToUTF16(name), description: strToUTF16(description), tokenPrefix: strToUTF16(tokenPrefix), mode: modeprm as any});
     await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;
 
@@ -519,18 +518,18 @@
 }
 
 export async function destroyCollectionExpectFailure(collectionId: number, senderSeed = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
     // Run the DestroyCollection transaction
-    const alicePrivateKey = privateKey(senderSeed);
+    const alicePrivateKey = privateKeyWrapper!(senderSeed);
     const tx = api.tx.unique.destroyCollection(collectionId);
     await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;
   });
 }
 
 export async function destroyCollectionExpectSuccess(collectionId: number, senderSeed = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
     // Run the DestroyCollection transaction
-    const alicePrivateKey = privateKey(senderSeed);
+    const alicePrivateKey = privateKeyWrapper!(senderSeed);
     const tx = api.tx.unique.destroyCollection(collectionId);
     const events = await submitTransactionAsync(alicePrivateKey, tx);
     const result = getDestroyResult(events);
@@ -572,10 +571,10 @@
 }
 
 export async function setCollectionSponsorExpectSuccess(collectionId: number, sponsor: string, sender = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
 
     // Run the transaction
-    const senderPrivateKey = privateKey(sender);
+    const senderPrivateKey = privateKeyWrapper!(sender);
     const tx = api.tx.unique.setCollectionSponsor(collectionId, sponsor);
     const events = await submitTransactionAsync(senderPrivateKey, tx);
     const result = getGenericResult(events);
@@ -592,10 +591,10 @@
 }
 
 export async function removeCollectionSponsorExpectSuccess(collectionId: number, sender = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
 
     // Run the transaction
-    const alicePrivateKey = privateKey(sender);
+    const alicePrivateKey = privateKeyWrapper!(sender);
     const tx = api.tx.unique.removeCollectionSponsor(collectionId);
     const events = await submitTransactionAsync(alicePrivateKey, tx);
     const result = getGenericResult(events);
@@ -610,30 +609,30 @@
 }
 
 export async function removeCollectionSponsorExpectFailure(collectionId: number, senderSeed = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
 
     // Run the transaction
-    const alicePrivateKey = privateKey(senderSeed);
+    const alicePrivateKey = privateKeyWrapper!(senderSeed);
     const tx = api.tx.unique.removeCollectionSponsor(collectionId);
     await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;
   });
 }
 
 export async function setCollectionSponsorExpectFailure(collectionId: number, sponsor: string, senderSeed = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
 
     // Run the transaction
-    const alicePrivateKey = privateKey(senderSeed);
+    const alicePrivateKey = privateKeyWrapper!(senderSeed);
     const tx = api.tx.unique.setCollectionSponsor(collectionId, sponsor);
     await expect(submitTransactionExpectFailAsync(alicePrivateKey, tx)).to.be.rejected;
   });
 }
 
 export async function confirmSponsorshipExpectSuccess(collectionId: number, senderSeed = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
 
     // Run the transaction
-    const sender = privateKey(senderSeed);
+    const sender = privateKeyWrapper!(senderSeed);
     const tx = api.tx.unique.confirmSponsorship(collectionId);
     const events = await submitTransactionAsync(sender, tx);
     const result = getGenericResult(events);
@@ -651,10 +650,10 @@
 
 
 export async function confirmSponsorshipExpectFailure(collectionId: number, senderSeed = '//Alice') {
-  await usingApi(async (api) => {
+  await usingApi(async (api, privateKeyWrapper) => {
 
     // Run the transaction
-    const sender = privateKey(senderSeed);
+    const sender = privateKeyWrapper!(senderSeed);
     const tx = api.tx.unique.confirmSponsorship(collectionId);
     await expect(submitTransactionExpectFailAsync(sender, tx)).to.be.rejected;
   });
modifiedtests/src/xcmTransfer.test.tsdiffbeforeafterboth
--- a/tests/src/xcmTransfer.test.ts
+++ b/tests/src/xcmTransfer.test.ts
@@ -20,7 +20,6 @@
 import {WsProvider} from '@polkadot/api';
 import {ApiOptions} from '@polkadot/api/types';
 import {IKeyringPair} from '@polkadot/types/types';
-import privateKey from './substrate/privateKey';
 import usingApi, {submitTransactionAsync} from './substrate/substrate-api';
 import {getGenericResult} from './util/helpers';
 import waitNewBlocks from './substrate/wait-new-blocks';
@@ -38,8 +37,8 @@
   let alice: IKeyringPair;
   
   before(async () => {
-    await usingApi(async () => {
-      alice = privateKey('//Alice');
+    await usingApi(async (api, privateKeyWrapper) => {
+      alice = privateKeyWrapper!('//Alice');
     });
 
     const karuraApiOptions: ApiOptions = {