git.delta.rocks / unique-network / refs/commits / 3d7ffe75f2a8

difftreelog

fix skip refungible and scheduler tests on qtz/unq

Daniel Shiposha2022-08-09parent: #5eadf5f.patch.diff
in: master

43 files changed

modifiedtests/src/approve.test.tsdiffbeforeafterboth
before · tests/src/approve.test.ts
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {IKeyringPair} from '@polkadot/types/types';18import {ApiPromise} from '@polkadot/api';19import chai from 'chai';20import chaiAsPromised from 'chai-as-promised';21import {default as usingApi} from './substrate/substrate-api';22import {23  approveExpectFail,24  approveExpectSuccess,25  createCollectionExpectSuccess,26  createItemExpectSuccess,27  destroyCollectionExpectSuccess,28  setCollectionLimitsExpectSuccess,29  transferExpectSuccess,30  addCollectionAdminExpectSuccess,31  adminApproveFromExpectFail,32  getCreatedCollectionCount,33  transferFromExpectSuccess,34  transferFromExpectFail,35} from './util/helpers';3637chai.use(chaiAsPromised);3839describe('Integration Test approve(spender, collection_id, item_id, amount):', () => {40  let alice: IKeyringPair;41  let bob: IKeyringPair;42  let charlie: IKeyringPair;4344  before(async () => {45    await usingApi(async (api, privateKeyWrapper) => {46      alice =  privateKeyWrapper('//Alice');47      bob =  privateKeyWrapper('//Bob');48      charlie =  privateKeyWrapper('//Charlie');49    });50  });5152  it('Execute the extrinsic and check approvedList', async () => {53    const nftCollectionId = await createCollectionExpectSuccess();54    // nft55    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');56    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address);57    // fungible58    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});59    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');60    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address);61    // reFungible62    const reFungibleCollectionId =63      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});64    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');65    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address);66  });6768  it('Remove approval by using 0 amount', async () => {69    const nftCollectionId = await createCollectionExpectSuccess();70    // nft71    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');72    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 1);73    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 0);74    // fungible75    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});76    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');77    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1);78    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0);79    // reFungible80    const reFungibleCollectionId =81      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});82    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');83    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 1);84    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 0);85  });8687  it('can`t be called by collection owner on non-owned item when OwnerCanTransfer == false', async () => {88    const collectionId = await createCollectionExpectSuccess();89    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);9091    await adminApproveFromExpectFail(collectionId, itemId, alice, bob.address, charlie.address);92  });93});9495describe('Normal user can approve other users to transfer:', () => {96  let alice: IKeyringPair;97  let bob: IKeyringPair;98  let charlie: IKeyringPair;99100  before(async () => {101    await usingApi(async (api, privateKeyWrapper) => {102      alice =  privateKeyWrapper('//Alice');103      bob =  privateKeyWrapper('//Bob');104      charlie =  privateKeyWrapper('//Charlie');105    });106  });  107108  it('NFT', async () => {109    const collectionId = await createCollectionExpectSuccess();110    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);111    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);112  });113114  it('Fungible up to an approved amount', async () => {115    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});116    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); 117    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);118  });119120  it('ReFungible up to an approved amount', async () => {121    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});122    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address);123    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);124  });125});126127describe('Approved users can transferFrom up to approved amount:', () => {128  let alice: IKeyringPair;129  let bob: IKeyringPair;130  let charlie: IKeyringPair;131132  before(async () => {133    await usingApi(async (api, privateKeyWrapper) => {134      alice =  privateKeyWrapper('//Alice');135      bob =  privateKeyWrapper('//Bob');136      charlie =  privateKeyWrapper('//Charlie');137    });138  });  139140  it('NFT', async () => {141    const collectionId = await createCollectionExpectSuccess();142    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);143    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);144    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'NFT');145  });146147  it('Fungible up to an approved amount', async () => {148    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});149    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); 150    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);151    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible');152  });153154  it('ReFungible up to an approved amount', async () => {155    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});156    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address);157    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);158    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'ReFungible');159  });160});161162describe('Approved users cannot use transferFrom to repeat transfers if approved amount was already transferred:', () => {163  let alice: IKeyringPair;164  let bob: IKeyringPair;165  let charlie: IKeyringPair;166167  before(async () => {168    await usingApi(async (api, privateKeyWrapper) => {169      alice =  privateKeyWrapper('//Alice');170      bob =  privateKeyWrapper('//Bob');171      charlie =  privateKeyWrapper('//Charlie');172    });173  });  174175  it('NFT', async () => {176    const collectionId = await createCollectionExpectSuccess();177    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);178    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);179    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'NFT');180    await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1);181  });182183  it('Fungible up to an approved amount', async () => {184    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});185    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); 186    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);187    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible');188    await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1);189  });190191  it('ReFungible up to an approved amount', async () => {192    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});193    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address);194    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);195    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'ReFungible');196    await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1);197  });198});199200describe('Approved amount decreases by the transferred amount.:', () => {201  let alice: IKeyringPair;202  let bob: IKeyringPair;203  let charlie: IKeyringPair;204  let dave: IKeyringPair;205206  before(async () => {207    await usingApi(async (api, privateKeyWrapper) => {208      alice =  privateKeyWrapper('//Alice');209      bob =  privateKeyWrapper('//Bob');210      charlie =  privateKeyWrapper('//Charlie');211      dave =  privateKeyWrapper('//Dave');212    });213  });  214215  it('If a user B is approved to transfer 10 Fungible tokens from user A, they can transfer 2 tokens to user C, which will result in decreasing approval from 10 to 8. Then user B can transfer 8 tokens to user D.', async () => {216    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});217    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', alice.address); 218    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 10);219    await transferFromExpectSuccess(collectionId, itemId, bob, alice, charlie, 2, 'Fungible');220    await transferFromExpectSuccess(collectionId, itemId, bob, alice, dave, 8, 'Fungible');221  });222});223224describe('User may clear the approvals to approving for 0 amount:', () => {225  let alice: IKeyringPair;226  let bob: IKeyringPair;227  let charlie: IKeyringPair;228229  before(async () => {230    await usingApi(async (api, privateKeyWrapper) => {231      alice =  privateKeyWrapper('//Alice');232      bob =  privateKeyWrapper('//Bob');233      charlie =  privateKeyWrapper('//Charlie');234    });235  });236237  it('NFT', async () => {238    const collectionId = await createCollectionExpectSuccess();239    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT');240    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 1);241    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 0);242    await transferFromExpectFail(collectionId, itemId, bob, bob, charlie, 1);243  });244245  it('Fungible', async () => {246    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});247    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');248    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1);249    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0);250    await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, bob, charlie, 1);251  });252253  it('ReFungible', async () => {254    const reFungibleCollectionId =255      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});256    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');257    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 1);258    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 0);259    await transferFromExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, bob, charlie, 1);260  });261});262263describe('User cannot approve for the amount greater than they own:', () => {264  let alice: IKeyringPair;265  let bob: IKeyringPair;266  let charlie: IKeyringPair;267268  before(async () => {269    await usingApi(async (api, privateKeyWrapper) => {270      alice =  privateKeyWrapper('//Alice');271      bob =  privateKeyWrapper('//Bob');272      charlie =  privateKeyWrapper('//Charlie');273    });274  });275276  it('1 for NFT', async () => {277    const collectionId = await createCollectionExpectSuccess();278    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);279    await approveExpectFail(collectionId, itemId, bob, charlie, 2);280  });281282  it('Fungible', async () => {283    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});284    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');285    await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, charlie, 11);286  });287288  it('ReFungible', async () => {289    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});290    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');291    await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, charlie, 101);292  });293});294295describe('Administrator and collection owner do not need approval in order to execute TransferFrom (with owner_can_transfer_flag = true):', () => {296  let alice: IKeyringPair;297  let bob: IKeyringPair;298  let charlie: IKeyringPair;299  let dave: IKeyringPair;300301  before(async () => {302    await usingApi(async (api, privateKeyWrapper) => {303      alice =  privateKeyWrapper('//Alice');304      bob =  privateKeyWrapper('//Bob');305      charlie =  privateKeyWrapper('//Charlie');306      dave =  privateKeyWrapper('//Dave');307    });308  });  309310  it('NFT', async () => {311    const collectionId = await createCollectionExpectSuccess();312    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});313    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', charlie.address);314    await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'NFT');315    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);316    await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'NFT');317  });318319  it('Fungible up to an approved amount', async () => {320    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});321    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});322    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', charlie.address); 323    await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'Fungible');324    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);325    await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'Fungible');326  });327328  it('ReFungible up to an approved amount', async () => {329    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});330    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});331    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', charlie.address);332    await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'ReFungible');333    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);334    await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'ReFungible');335  });336});337338describe('Repeated approvals add up', () => {339  let alice: IKeyringPair;340  let bob: IKeyringPair;341  let charlie: IKeyringPair;342  let dave: IKeyringPair;343344  before(async () => {345    await usingApi(async (api, privateKeyWrapper) => {346      alice =  privateKeyWrapper('//Alice');347      bob =  privateKeyWrapper('//Bob');348      charlie =  privateKeyWrapper('//Charlie');349      dave =  privateKeyWrapper('//Dave');350    });351  });  352353  it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. Fungible', async () => {354    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});355    await createItemExpectSuccess(alice, collectionId, 'Fungible', alice.address);356    await approveExpectSuccess(collectionId, 0, alice, bob.address, 1);357    await approveExpectSuccess(collectionId, 0, alice, charlie.address, 1);358    // const allowances1 = await getAllowance(collectionId, 0, Alice.address, Bob.address);359    // const allowances2 = await getAllowance(collectionId, 0, Alice.address, Charlie.address);360    // expect(allowances1 + allowances2).to.be.eq(BigInt(2));361  });362363  it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. ReFungible', async () => {364    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});365    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', alice.address);366    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 1);367    await approveExpectSuccess(collectionId, itemId, alice, charlie.address, 1);368    // const allowances1 = await getAllowance(collectionId, itemId, Alice.address, Bob.address);369    // const allowances2 = await getAllowance(collectionId, itemId, Alice.address, Charlie.address);370    // expect(allowances1 + allowances2).to.be.eq(BigInt(2));371  });372373  // Canceled by changing approve logic374  it.skip('Cannot approve for more than total user`s amount (owned: 10, approval 1: 5 - should succeed, approval 2: 6 - should fail). Fungible', async () => {375    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});376    await createItemExpectSuccess(alice, collectionId, 'Fungible', dave.address);377    await approveExpectSuccess(collectionId, 0, dave, bob.address, 5);378    await approveExpectFail(collectionId, 0, dave, charlie, 6);379  });380381  // Canceled by changing approve logic382  it.skip('Cannot approve for more than total users amount (owned: 100, approval 1: 50 - should succeed, approval 2: 51 - should fail). ReFungible', async () => {383    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});384    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', dave.address);385    await approveExpectSuccess(collectionId, itemId, dave, bob.address, 50);386    await approveExpectFail(collectionId, itemId, dave, charlie, 51);387  });388});389390describe('Integration Test approve(spender, collection_id, item_id, amount) with collection admin permissions:', () => {391  let alice: IKeyringPair;392  let bob: IKeyringPair;393  let charlie: IKeyringPair;394395  before(async () => {396    await usingApi(async (api, privateKeyWrapper) => {397      alice =  privateKeyWrapper('//Alice');398      bob =  privateKeyWrapper('//Bob');399      charlie =  privateKeyWrapper('//Charlie');400    });401  });402403  it('can be called by collection admin on non-owned item', async () => {404    const collectionId = await createCollectionExpectSuccess();405    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);406407    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);408    await adminApproveFromExpectFail(collectionId, itemId, bob, alice.address, charlie.address);409  });410});411412describe('Negative Integration Test approve(spender, collection_id, item_id, amount):', () => {413  let alice: IKeyringPair;414  let bob: IKeyringPair;415  let charlie: IKeyringPair;416417  before(async () => {418    await usingApi(async (api, privateKeyWrapper) => {419      alice =  privateKeyWrapper('//Alice');420      bob =  privateKeyWrapper('//Bob');421      charlie =  privateKeyWrapper('//Charlie');422    });423  });424425  it('Approve for a collection that does not exist', async () => {426    await usingApi(async (api: ApiPromise) => {427      // nft428      const nftCollectionCount = await getCreatedCollectionCount(api);429      await approveExpectFail(nftCollectionCount + 1, 1, alice, bob);430      // fungible431      const fungibleCollectionCount = await getCreatedCollectionCount(api);432      await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob);433      // reFungible434      const reFungibleCollectionCount = await getCreatedCollectionCount(api);435      await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob);436    });437  });438439  it('Approve for a collection that was destroyed', async () => {440    // nft441    const nftCollectionId = await createCollectionExpectSuccess();442    await destroyCollectionExpectSuccess(nftCollectionId);443    await approveExpectFail(nftCollectionId, 1, alice, bob);444    // fungible445    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});446    await destroyCollectionExpectSuccess(fungibleCollectionId);447    await approveExpectFail(fungibleCollectionId, 0, alice, bob);448    // reFungible449    const reFungibleCollectionId =450      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});451    await destroyCollectionExpectSuccess(reFungibleCollectionId);452    await approveExpectFail(reFungibleCollectionId, 1, alice, bob);453  });454455  it('Approve transfer of a token that does not exist', async () => {456    // nft457    const nftCollectionId = await createCollectionExpectSuccess();458    await approveExpectFail(nftCollectionId, 2, alice, bob);459    // reFungible460    const reFungibleCollectionId =461      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});462    await approveExpectFail(reFungibleCollectionId, 2, alice, bob);463  });464465  it('Approve using the address that does not own the approved token', async () => {466    const nftCollectionId = await createCollectionExpectSuccess();467    // nft468    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');469    await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice);470    // fungible471    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});472    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');473    await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice);474    // reFungible475    const reFungibleCollectionId =476      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});477    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');478    await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, alice);479  });480481  it('should fail if approved more ReFungibles than owned', async () => {482    const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});483    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'ReFungible');484    await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 100, 'ReFungible');485    await approveExpectSuccess(nftCollectionId, newNftTokenId, bob, alice.address, 100);486    await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice, 101);487  });488489  it('should fail if approved more Fungibles than owned', async () => {490    const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});491    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'Fungible');492    await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 10, 'Fungible');493    await approveExpectSuccess(nftCollectionId, newNftTokenId, bob, alice.address, 10);494    await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice, 11);495  });496497  it('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async () => {498    const collectionId = await createCollectionExpectSuccess();499    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);500    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: false});501502    await approveExpectFail(collectionId, itemId, alice, charlie);503  });504});
after · tests/src/approve.test.ts
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {IKeyringPair} from '@polkadot/types/types';18import {ApiPromise} from '@polkadot/api';19import chai from 'chai';20import chaiAsPromised from 'chai-as-promised';21import {default as usingApi} from './substrate/substrate-api';22import {23  approveExpectFail,24  approveExpectSuccess,25  createCollectionExpectSuccess,26  createItemExpectSuccess,27  destroyCollectionExpectSuccess,28  setCollectionLimitsExpectSuccess,29  transferExpectSuccess,30  addCollectionAdminExpectSuccess,31  adminApproveFromExpectFail,32  getCreatedCollectionCount,33  transferFromExpectSuccess,34  transferFromExpectFail,35  requirePallets,36  Pallets37} from './util/helpers';3839chai.use(chaiAsPromised);4041describe('Integration Test approve(spender, collection_id, item_id, amount):', () => {42  let alice: IKeyringPair;43  let bob: IKeyringPair;44  let charlie: IKeyringPair;4546  before(async () => {47    await usingApi(async (api, privateKeyWrapper) => {48      alice =  privateKeyWrapper('//Alice');49      bob =  privateKeyWrapper('//Bob');50      charlie =  privateKeyWrapper('//Charlie');51    });52  });5354  it('[nft] Execute the extrinsic and check approvedList', async () => {55    const nftCollectionId = await createCollectionExpectSuccess();56    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');57    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address);58  });5960  it('[fungible] Execute the extrinsic and check approvedList', async () => {61    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});62    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');63    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address);64  });6566  it('[refungible] Execute the extrinsic and check approvedList', async function() {67    await requirePallets(this, [Pallets.ReFungible]);6869    const reFungibleCollectionId =70      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});71    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');72    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address);73  });7475  it('[nft] Remove approval by using 0 amount', async () => {76    const nftCollectionId = await createCollectionExpectSuccess();77    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');78    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 1);79    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address, 0);80  });8182  it('[fungible] Remove approval by using 0 amount', async () => {83    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});84    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');85    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1);86    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0);87  });8889  it('[refungible] Remove approval by using 0 amount', async function() {90    await requirePallets(this, [Pallets.ReFungible]);9192    const reFungibleCollectionId =93      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});94    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');95    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 1);96    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 0);97  });9899  it('can`t be called by collection owner on non-owned item when OwnerCanTransfer == false', async () => {100    const collectionId = await createCollectionExpectSuccess();101    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);102103    await adminApproveFromExpectFail(collectionId, itemId, alice, bob.address, charlie.address);104  });105});106107describe('Normal user can approve other users to transfer:', () => {108  let alice: IKeyringPair;109  let bob: IKeyringPair;110  let charlie: IKeyringPair;111112  before(async () => {113    await usingApi(async (api, privateKeyWrapper) => {114      alice =  privateKeyWrapper('//Alice');115      bob =  privateKeyWrapper('//Bob');116      charlie =  privateKeyWrapper('//Charlie');117    });118  });  119120  it('NFT', async () => {121    const collectionId = await createCollectionExpectSuccess();122    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);123    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);124  });125126  it('Fungible up to an approved amount', async () => {127    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});128    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); 129    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);130  });131132  it('ReFungible up to an approved amount', async function() {133    await requirePallets(this, [Pallets.ReFungible]);134135    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});136    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address);137    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);138  });139});140141describe('Approved users can transferFrom up to approved amount:', () => {142  let alice: IKeyringPair;143  let bob: IKeyringPair;144  let charlie: IKeyringPair;145146  before(async () => {147    await usingApi(async (api, privateKeyWrapper) => {148      alice =  privateKeyWrapper('//Alice');149      bob =  privateKeyWrapper('//Bob');150      charlie =  privateKeyWrapper('//Charlie');151    });152  });  153154  it('NFT', async () => {155    const collectionId = await createCollectionExpectSuccess();156    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);157    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);158    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'NFT');159  });160161  it('Fungible up to an approved amount', async () => {162    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});163    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); 164    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);165    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible');166  });167168  it('ReFungible up to an approved amount', async function() {169    await requirePallets(this, [Pallets.ReFungible]);170171    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});172    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address);173    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);174    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'ReFungible');175  });176});177178describe('Approved users cannot use transferFrom to repeat transfers if approved amount was already transferred:', () => {179  let alice: IKeyringPair;180  let bob: IKeyringPair;181  let charlie: IKeyringPair;182183  before(async () => {184    await usingApi(async (api, privateKeyWrapper) => {185      alice =  privateKeyWrapper('//Alice');186      bob =  privateKeyWrapper('//Bob');187      charlie =  privateKeyWrapper('//Charlie');188    });189  });  190191  it('NFT', async () => {192    const collectionId = await createCollectionExpectSuccess();193    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);194    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);195    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'NFT');196    await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1);197  });198199  it('Fungible up to an approved amount', async () => {200    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});201    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', bob.address); 202    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);203    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'Fungible');204    await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1);205  });206207  it('ReFungible up to an approved amount', async function() {208    await requirePallets(this, [Pallets.ReFungible]);209210    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});211    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', bob.address);212    await approveExpectSuccess(collectionId, itemId, bob, charlie.address);213    await transferFromExpectSuccess(collectionId, itemId, charlie, bob, alice, 1, 'ReFungible');214    await transferFromExpectFail(collectionId, itemId, charlie, bob, alice, 1);215  });216});217218describe('Approved amount decreases by the transferred amount.:', () => {219  let alice: IKeyringPair;220  let bob: IKeyringPair;221  let charlie: IKeyringPair;222  let dave: IKeyringPair;223224  before(async () => {225    await usingApi(async (api, privateKeyWrapper) => {226      alice =  privateKeyWrapper('//Alice');227      bob =  privateKeyWrapper('//Bob');228      charlie =  privateKeyWrapper('//Charlie');229      dave =  privateKeyWrapper('//Dave');230    });231  });  232233  it('If a user B is approved to transfer 10 Fungible tokens from user A, they can transfer 2 tokens to user C, which will result in decreasing approval from 10 to 8. Then user B can transfer 8 tokens to user D.', async () => {234    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});235    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', alice.address); 236    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 10);237    await transferFromExpectSuccess(collectionId, itemId, bob, alice, charlie, 2, 'Fungible');238    await transferFromExpectSuccess(collectionId, itemId, bob, alice, dave, 8, 'Fungible');239  });240});241242describe('User may clear the approvals to approving for 0 amount:', () => {243  let alice: IKeyringPair;244  let bob: IKeyringPair;245  let charlie: IKeyringPair;246247  before(async () => {248    await usingApi(async (api, privateKeyWrapper) => {249      alice =  privateKeyWrapper('//Alice');250      bob =  privateKeyWrapper('//Bob');251      charlie =  privateKeyWrapper('//Charlie');252    });253  });254255  it('NFT', async () => {256    const collectionId = await createCollectionExpectSuccess();257    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT');258    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 1);259    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 0);260    await transferFromExpectFail(collectionId, itemId, bob, bob, charlie, 1);261  });262263  it('Fungible', async () => {264    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});265    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');266    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 1);267    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address, 0);268    await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, bob, charlie, 1);269  });270271  it('ReFungible', async function() {272    await requirePallets(this, [Pallets.ReFungible]);273274    const reFungibleCollectionId =275      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});276    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');277    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 1);278    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 0);279    await transferFromExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, bob, charlie, 1);280  });281});282283describe('User cannot approve for the amount greater than they own:', () => {284  let alice: IKeyringPair;285  let bob: IKeyringPair;286  let charlie: IKeyringPair;287288  before(async () => {289    await usingApi(async (api, privateKeyWrapper) => {290      alice =  privateKeyWrapper('//Alice');291      bob =  privateKeyWrapper('//Bob');292      charlie =  privateKeyWrapper('//Charlie');293    });294  });295296  it('1 for NFT', async () => {297    const collectionId = await createCollectionExpectSuccess();298    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);299    await approveExpectFail(collectionId, itemId, bob, charlie, 2);300  });301302  it('Fungible', async () => {303    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});304    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');305    await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, charlie, 11);306  });307308  it('ReFungible', async function() {309    await requirePallets(this, [Pallets.ReFungible]);310311    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});312    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');313    await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, charlie, 101);314  });315});316317describe('Administrator and collection owner do not need approval in order to execute TransferFrom (with owner_can_transfer_flag = true):', () => {318  let alice: IKeyringPair;319  let bob: IKeyringPair;320  let charlie: IKeyringPair;321  let dave: IKeyringPair;322323  before(async () => {324    await usingApi(async (api, privateKeyWrapper) => {325      alice =  privateKeyWrapper('//Alice');326      bob =  privateKeyWrapper('//Bob');327      charlie =  privateKeyWrapper('//Charlie');328      dave =  privateKeyWrapper('//Dave');329    });330  });  331332  it('NFT', async () => {333    const collectionId = await createCollectionExpectSuccess();334    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});335    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', charlie.address);336    await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'NFT');337    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);338    await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'NFT');339  });340341  it('Fungible up to an approved amount', async () => {342    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});343    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});344    const itemId = await createItemExpectSuccess(alice, collectionId, 'Fungible', charlie.address); 345    await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'Fungible');346    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);347    await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'Fungible');348  });349350  it('ReFungible up to an approved amount', async function() {351    await requirePallets(this, [Pallets.ReFungible]);352353    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});354    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});355    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', charlie.address);356    await transferFromExpectSuccess(collectionId, itemId, alice, charlie, dave, 1, 'ReFungible');357    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);358    await transferFromExpectSuccess(collectionId, itemId, bob, dave, alice, 1, 'ReFungible');359  });360});361362describe('Repeated approvals add up', () => {363  let alice: IKeyringPair;364  let bob: IKeyringPair;365  let charlie: IKeyringPair;366  let dave: IKeyringPair;367368  before(async () => {369    await usingApi(async (api, privateKeyWrapper) => {370      alice =  privateKeyWrapper('//Alice');371      bob =  privateKeyWrapper('//Bob');372      charlie =  privateKeyWrapper('//Charlie');373      dave =  privateKeyWrapper('//Dave');374    });375  });  376377  it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. Fungible', async () => {378    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});379    await createItemExpectSuccess(alice, collectionId, 'Fungible', alice.address);380    await approveExpectSuccess(collectionId, 0, alice, bob.address, 1);381    await approveExpectSuccess(collectionId, 0, alice, charlie.address, 1);382    // const allowances1 = await getAllowance(collectionId, 0, Alice.address, Bob.address);383    // const allowances2 = await getAllowance(collectionId, 0, Alice.address, Charlie.address);384    // expect(allowances1 + allowances2).to.be.eq(BigInt(2));385  });386387  it.skip('Owned 10, approval 1: 1, approval 2: 1, resulting approved value: 2. ReFungible', async () => {388    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});389    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', alice.address);390    await approveExpectSuccess(collectionId, itemId, alice, bob.address, 1);391    await approveExpectSuccess(collectionId, itemId, alice, charlie.address, 1);392    // const allowances1 = await getAllowance(collectionId, itemId, Alice.address, Bob.address);393    // const allowances2 = await getAllowance(collectionId, itemId, Alice.address, Charlie.address);394    // expect(allowances1 + allowances2).to.be.eq(BigInt(2));395  });396397  // Canceled by changing approve logic398  it.skip('Cannot approve for more than total user`s amount (owned: 10, approval 1: 5 - should succeed, approval 2: 6 - should fail). Fungible', async () => {399    const collectionId = await createCollectionExpectSuccess({mode:{type: 'Fungible', decimalPoints: 0}});400    await createItemExpectSuccess(alice, collectionId, 'Fungible', dave.address);401    await approveExpectSuccess(collectionId, 0, dave, bob.address, 5);402    await approveExpectFail(collectionId, 0, dave, charlie, 6);403  });404405  // Canceled by changing approve logic406  it.skip('Cannot approve for more than total users amount (owned: 100, approval 1: 50 - should succeed, approval 2: 51 - should fail). ReFungible', async () => {407    const collectionId = await createCollectionExpectSuccess({mode:{type: 'ReFungible'}});408    const itemId = await createItemExpectSuccess(alice, collectionId, 'ReFungible', dave.address);409    await approveExpectSuccess(collectionId, itemId, dave, bob.address, 50);410    await approveExpectFail(collectionId, itemId, dave, charlie, 51);411  });412});413414describe('Integration Test approve(spender, collection_id, item_id, amount) with collection admin permissions:', () => {415  let alice: IKeyringPair;416  let bob: IKeyringPair;417  let charlie: IKeyringPair;418419  before(async () => {420    await usingApi(async (api, privateKeyWrapper) => {421      alice =  privateKeyWrapper('//Alice');422      bob =  privateKeyWrapper('//Bob');423      charlie =  privateKeyWrapper('//Charlie');424    });425  });426427  it('can be called by collection admin on non-owned item', async () => {428    const collectionId = await createCollectionExpectSuccess();429    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', alice.address);430431    await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);432    await adminApproveFromExpectFail(collectionId, itemId, bob, alice.address, charlie.address);433  });434});435436describe('Negative Integration Test approve(spender, collection_id, item_id, amount):', () => {437  let alice: IKeyringPair;438  let bob: IKeyringPair;439  let charlie: IKeyringPair;440441  before(async () => {442    await usingApi(async (api, privateKeyWrapper) => {443      alice =  privateKeyWrapper('//Alice');444      bob =  privateKeyWrapper('//Bob');445      charlie =  privateKeyWrapper('//Charlie');446    });447  });448449  it('[nft] Approve for a collection that does not exist', async () => {450    await usingApi(async (api: ApiPromise) => {451      const nftCollectionCount = await getCreatedCollectionCount(api);452      await approveExpectFail(nftCollectionCount + 1, 1, alice, bob);453    });454  });455456  it('[fungible] Approve for a collection that does not exist', async () => {457    await usingApi(async (api: ApiPromise) => {458      const fungibleCollectionCount = await getCreatedCollectionCount(api);459      await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob);460    });461  });462463  it('[refungible] Approve for a collection that does not exist', async function() {464    await requirePallets(this, [Pallets.ReFungible]);465466    await usingApi(async (api: ApiPromise) => {467      const reFungibleCollectionCount = await getCreatedCollectionCount(api);468      await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob);469    });470  });471472  it('[nft] Approve for a collection that was destroyed', async () => {473    const nftCollectionId = await createCollectionExpectSuccess();474    await destroyCollectionExpectSuccess(nftCollectionId);475    await approveExpectFail(nftCollectionId, 1, alice, bob);476  });477478  it('Approve for a collection that was destroyed', async () => {479    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});480    await destroyCollectionExpectSuccess(fungibleCollectionId);481    await approveExpectFail(fungibleCollectionId, 0, alice, bob);482  });483484  it('[refungible] Approve for a collection that was destroyed', async function() {485    await requirePallets(this, [Pallets.ReFungible]);486487    const reFungibleCollectionId =488      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});489    await destroyCollectionExpectSuccess(reFungibleCollectionId);490    await approveExpectFail(reFungibleCollectionId, 1, alice, bob);491  });492493  it('[nft] Approve transfer of a token that does not exist', async () => {494    const nftCollectionId = await createCollectionExpectSuccess();495    await approveExpectFail(nftCollectionId, 2, alice, bob);496  });497498  it('[refungible] Approve transfer of a token that does not exist', async function() {499    await requirePallets(this, [Pallets.ReFungible]);500501    const reFungibleCollectionId =502      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});503    await approveExpectFail(reFungibleCollectionId, 2, alice, bob);504  });505506  it('[nft] Approve using the address that does not own the approved token', async () => {507    const nftCollectionId = await createCollectionExpectSuccess();508    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');509    await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice);510  });511512  it('[fungible] Approve using the address that does not own the approved token', async () => {513    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});514    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');515    await approveExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice);516  });517518  it('[refungible] Approve using the address that does not own the approved token', async function() {519    await requirePallets(this, [Pallets.ReFungible]);520521    const reFungibleCollectionId =522      await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});523    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');524    await approveExpectFail(reFungibleCollectionId, newReFungibleTokenId, bob, alice);525  });526527  it('should fail if approved more ReFungibles than owned', async function() {528    await requirePallets(this, [Pallets.ReFungible]);529530    const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});531    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'ReFungible');532    await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 100, 'ReFungible');533    await approveExpectSuccess(nftCollectionId, newNftTokenId, bob, alice.address, 100);534    await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice, 101);535  });536537  it('should fail if approved more Fungibles than owned', async () => {538    const nftCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});539    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'Fungible');540    await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 10, 'Fungible');541    await approveExpectSuccess(nftCollectionId, newNftTokenId, bob, alice.address, 10);542    await approveExpectFail(nftCollectionId, newNftTokenId, bob, alice, 11);543  });544545  it('fails when called by collection owner on non-owned item when OwnerCanTransfer == false', async () => {546    const collectionId = await createCollectionExpectSuccess();547    const itemId = await createItemExpectSuccess(alice, collectionId, 'NFT', bob.address);548    await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: false});549550    await approveExpectFail(collectionId, itemId, alice, charlie);551  });552});
modifiedtests/src/burnItem.test.tsdiffbeforeafterboth
--- a/tests/src/burnItem.test.ts
+++ b/tests/src/burnItem.test.ts
@@ -25,6 +25,8 @@
   getBalance,
   setCollectionLimitsExpectSuccess,
   isTokenExists,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 
 import chai from 'chai';
@@ -80,7 +82,9 @@
     });
   });
 
-  it('Burn item in ReFungible collection', async () => {
+  it('Burn item in ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const createMode = 'ReFungible';
     const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}});
     const tokenId = await createItemExpectSuccess(alice, collectionId, createMode);
@@ -99,7 +103,9 @@
     });
   });
 
-  it('Burn owned portion of item in ReFungible collection', async () => {
+  it('Burn owned portion of item in ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const createMode = 'ReFungible';
     const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}});
     const tokenId = await createItemExpectSuccess(alice, collectionId, createMode);
@@ -189,7 +195,9 @@
   });
 
   // TODO: burnFrom
-  it('Burn item in ReFungible collection', async () => {
+  it('Burn item in ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const createMode = 'ReFungible';
     const collectionId = await createCollectionExpectSuccess({mode: {type: createMode}});
     await setCollectionLimitsExpectSuccess(alice, collectionId, {ownerCanTransfer: true});
modifiedtests/src/confirmSponsorship.test.tsdiffbeforeafterboth
--- a/tests/src/confirmSponsorship.test.ts
+++ b/tests/src/confirmSponsorship.test.ts
@@ -33,6 +33,8 @@
   addCollectionAdminExpectSuccess,
   getCreatedCollectionCount,
   UNIQUE,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
 
@@ -124,7 +126,9 @@
     });
   });
 
-  it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async () => {
+  it('ReFungible: Transfer fees are paid by the sponsor after confirmation', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     await setCollectionSponsorExpectSuccess(collectionId, bob.address);
     await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
@@ -252,7 +256,9 @@
     });
   });
 
-  it('ReFungible: Sponsoring is rate limited', async () => {
+  it('ReFungible: Sponsoring is rate limited', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     await setCollectionSponsorExpectSuccess(collectionId, bob.address);
     await confirmSponsorshipExpectSuccess(collectionId, '//Bob');
modifiedtests/src/createCollection.test.tsdiffbeforeafterboth
--- a/tests/src/createCollection.test.ts
+++ b/tests/src/createCollection.test.ts
@@ -16,7 +16,7 @@
 
 import {expect} from 'chai';
 import usingApi, {executeTransaction, submitTransactionAsync} from './substrate/substrate-api';
-import {createCollectionWithPropsExpectFailure, createCollectionExpectFailure, createCollectionExpectSuccess, getCreateCollectionResult, getDetailedCollectionInfo, createCollectionWithPropsExpectSuccess} from './util/helpers';
+import {createCollectionWithPropsExpectFailure, createCollectionExpectFailure, createCollectionExpectSuccess, getCreateCollectionResult, getDetailedCollectionInfo, createCollectionWithPropsExpectSuccess, requirePallets, Pallets} from './util/helpers';
 
 describe('integration test: ext. createCollection():', () => {
   it('Create new NFT collection', async () => {
@@ -34,7 +34,9 @@
   it('Create new Fungible collection', async () => {
     await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
   });
-  it('Create new ReFungible collection', async () => {
+  it('Create new ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
   });
 
modifiedtests/src/createItem.test.tsdiffbeforeafterboth
--- a/tests/src/createItem.test.ts
+++ b/tests/src/createItem.test.ts
@@ -29,6 +29,8 @@
   itApi,
   normalizeAccountId,
   getCreateItemResult,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 
 const expect = chai.expect;
@@ -79,7 +81,9 @@
     }
 
   });
-  it('Create new item in ReFungible collection', async () => {
+  it('Create new item in ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const createMode = 'ReFungible';
     const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
     await createItemExpectSuccess(alice, newCollectionID, createMode);
@@ -96,7 +100,9 @@
     await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address);
     await createItemExpectSuccess(bob, newCollectionID, createMode);
   });
-  it('Create new item in ReFungible collection with collection admin permissions', async () => {
+  it('Create new item in ReFungible collection with collection admin permissions', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const createMode = 'ReFungible';
     const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
     await addCollectionAdminExpectSuccess(alice, newCollectionID, bob.address);
@@ -175,7 +181,9 @@
     });
   });
 
-  it('Check total pieces of ReFungible token', async () => {
+  it('Check total pieces of ReFungible token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const createMode = 'ReFungible';
       const createCollectionResult = await createCollection(api, alice, {mode: {type: createMode}});
@@ -219,7 +227,9 @@
     const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode, decimalPoints: 0}});
     await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected;
   });
-  it('Regular user cannot create new item in ReFungible collection', async () => {
+  it('Regular user cannot create new item in ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const createMode = 'ReFungible';
     const newCollectionID = await createCollectionExpectSuccess({mode: {type: createMode}});
     await expect(createItemExpectSuccess(bob, newCollectionID, createMode)).to.be.rejected;
@@ -296,7 +306,9 @@
     });
   });
 
-  it('Check total pieces for invalid Refungible token', async () => {
+  it('Check total pieces for invalid Refungible token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const createCollectionResult = await createCollection(api, alice, {mode: {type: 'ReFungible'}});
       const collectionId  = createCollectionResult.collectionId;
modifiedtests/src/createMultipleItems.test.tsdiffbeforeafterboth
--- a/tests/src/createMultipleItems.test.ts
+++ b/tests/src/createMultipleItems.test.ts
@@ -33,6 +33,9 @@
   createCollectionWithPropsExpectSuccess,
   createMultipleItemsWithPropsExpectSuccess,
   getTokenProperties,
+  requirePallets,
+  Pallets,
+  checkPalletsPresence
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
@@ -91,7 +94,9 @@
     });
   });
 
-  it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async () => {
+  it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
@@ -272,7 +277,9 @@
     });
   });
 
-  it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async () => {
+  it('Create 0x31, 0x32, 0x33 items in active ReFungible collection and verify tokens data in chain', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api: ApiPromise) => {
       const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
@@ -335,7 +342,9 @@
     });
   });
 
-  it('Regular user cannot create items in active ReFungible collection', async () => {
+  it('Regular user cannot create items in active ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api: ApiPromise) => {
       const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const itemsListIndexBefore = await getLastTokenId(api, collectionId);
@@ -358,9 +367,8 @@
     });
   });
 
-  it('Create NFT and Re-fungible tokens that has reached the maximum data limit', async () => {
+  it('Create NFTs that has reached the maximum data limit', async function() {
     await usingApi(async (api, privateKeyWrapper) => {
-      // NFT
       const collectionId = await createCollectionWithPropsExpectSuccess({
         propPerm: [{key: 'key', permission: {mutable: true, collectionAdmin: true, tokenOwner: true}}],
       });
@@ -372,8 +380,13 @@
       ];
       const createMultipleItemsTx = api.tx.unique.createMultipleItems(collectionId, normalizeAccountId(alice.address), args);
       await expect(submitTransactionExpectFailAsync(alice, createMultipleItemsTx)).to.be.rejected;
+    });
+  });
 
-      // ReFungible
+  it('Create Refungible tokens that has reached the maximum data limit', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    await usingApi(async api => {
       const collectionIdReFungible =
         await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       {
@@ -402,8 +415,15 @@
   it('Create tokens with different types', async () => {
     await usingApi(async (api: ApiPromise) => {
       const collectionId = await createCollectionExpectSuccess();
+
+      let types = ['NFT', 'Fungible'];
+
+      if (await checkPalletsPresence([Pallets.ReFungible])) {
+        types.push('ReFungible');
+      }
+
       const createMultipleItemsTx = api.tx.unique
-        .createMultipleItems(collectionId, normalizeAccountId(alice.address), ['NFT', 'Fungible', 'ReFungible']);
+        .createMultipleItems(collectionId, normalizeAccountId(alice.address), types);
       await expect(executeTransaction(api, alice, createMultipleItemsTx)).to.be.rejectedWith(/nonfungible\.NotNonfungibleDataUsedToMintFungibleCollectionToken/);
       // garbage collection :-D // lol
       await destroyCollectionExpectSuccess(collectionId);
modifiedtests/src/createMultipleItemsEx.test.tsdiffbeforeafterboth
--- a/tests/src/createMultipleItemsEx.test.ts
+++ b/tests/src/createMultipleItemsEx.test.ts
@@ -16,7 +16,7 @@
 
 import {expect} from 'chai';
 import usingApi, {executeTransaction} from './substrate/substrate-api';
-import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties} from './util/helpers';
+import {addCollectionAdminExpectSuccess, createCollectionExpectSuccess, createCollectionWithPropsExpectSuccess, getBalance, getLastTokenId, getTokenProperties, requirePallets, Pallets} from './util/helpers';
 
 describe.only('Integration Test: createMultipleItemsEx', () => {
   it('can initialize multiple NFT with different owners', async () => {
@@ -146,7 +146,9 @@
     });
   });
 
-  it('can initialize an RFT with multiple owners', async () => {
+  it('can initialize an RFT with multiple owners', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       const alice = privateKeyWrapper('//Alice');
       const bob = privateKeyWrapper('//Bob');
@@ -178,7 +180,9 @@
     });
   });
 
-  it('can initialize multiple RFTs with the same owner', async () => {
+  it('can initialize multiple RFTs with the same owner', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       const alice = privateKeyWrapper('//Alice');
       const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
@@ -389,7 +393,9 @@
     });
   });
 
-  it('fails when trying to set multiple owners when creating multiple refungibles', async () => {
+  it('fails when trying to set multiple owners when creating multiple refungibles', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
 
     await usingApi(async (api, privateKeyWrapper) => {
modifiedtests/src/destroyCollection.test.tsdiffbeforeafterboth
--- a/tests/src/destroyCollection.test.ts
+++ b/tests/src/destroyCollection.test.ts
@@ -25,6 +25,8 @@
   addCollectionAdminExpectSuccess,
   getCreatedCollectionCount,
   createItemExpectSuccess,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
@@ -38,7 +40,9 @@
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
     await destroyCollectionExpectSuccess(collectionId);
   });
-  it('ReFungible collection can be destroyed', async () => {
+  it('ReFungible collection can be destroyed', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     await destroyCollectionExpectSuccess(collectionId);
   });
modifiedtests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth
--- a/tests/src/eth/createRFTCollection.test.ts
+++ b/tests/src/eth/createRFTCollection.test.ts
@@ -16,7 +16,7 @@
 
 import {evmToAddress} from '@polkadot/util-crypto';
 import {expect} from 'chai';
-import {getCreatedCollectionCount, getDetailedCollectionInfo} from '../util/helpers';
+import {getCreatedCollectionCount, getDetailedCollectionInfo, requirePallets, Pallets} from '../util/helpers';
 import {
   evmCollectionHelpers,
   collectionIdToAddress,
@@ -28,6 +28,10 @@
 } from './util/helpers';
 
 describe('Create RFT collection from EVM', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Create collection', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const collectionHelper = evmCollectionHelpers(web3, owner);
@@ -146,6 +150,10 @@
 });
 
 describe('(!negative tests!) Create RFT collection from EVM', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('(!negative test!) Create collection (bad lengths)', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, owner);
@@ -228,4 +236,4 @@
       .setCollectionLimit('badLimit', 'true')
       .call()).to.be.rejectedWith('unknown boolean limit "badLimit"');
   });
-});
\ No newline at end of file
+});
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -14,12 +14,16 @@
 // 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 {createCollectionExpectSuccess, UNIQUE} from '../util/helpers';
+import {createCollectionExpectSuccess, UNIQUE, requirePallets, Pallets} from '../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, tokenIdToAddress} from './util/helpers';
 import reFungibleTokenAbi from './reFungibleTokenAbi.json';
 import {expect} from 'chai';
 
 describe('Refungible: Information getting', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
@@ -120,6 +124,10 @@
 });
 
 describe('Refungible: Plain calls', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, owner);
@@ -399,6 +407,10 @@
 });
 
 describe('RFT: Fees', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, caller);
@@ -435,6 +447,10 @@
 });
 
 describe('Common metadata', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Returns collection name', async ({api, web3, privateKeyWrapper}) => {
     const collection = await createCollectionExpectSuccess({
       name: 'token name',
@@ -462,4 +478,4 @@
 
     expect(symbol).to.equal('TOK');
   });
-});
\ No newline at end of file
+});
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -14,7 +14,7 @@
 // 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 {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE} from '../util/helpers';
+import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers';
 import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, evmCollection, evmCollectionHelpers, GAS_ARGS, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth} from './util/helpers';
 import reFungibleTokenAbi from './reFungibleTokenAbi.json';
 
@@ -24,6 +24,10 @@
 const expect = chai.expect;
 
 describe('Refungible token: Information getting', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {
     const alice = privateKeyWrapper('//Alice');
 
@@ -75,6 +79,10 @@
 
 // FIXME: Need erc721 for ReFubgible.
 describe('Check ERC721 token URI for ReFungible', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Empty tokenURI', async ({web3, api, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const helper = evmCollectionHelpers(web3, owner);
@@ -216,6 +224,10 @@
 });
 
 describe('Refungible: Plain calls', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Can perform approve()', async ({web3, api, privateKeyWrapper}) => {
     const alice = privateKeyWrapper('//Alice');
 
@@ -477,6 +489,10 @@
 });
 
 describe('Refungible: Fees', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('approve() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {
     const alice = privateKeyWrapper('//Alice');
 
@@ -532,6 +548,10 @@
 });
 
 describe('Refungible: Substrate calls', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Events emitted for approve()', async ({web3, api, privateKeyWrapper}) => {
     const alice = privateKeyWrapper('//Alice');
 
modifiedtests/src/eth/scheduling.test.tsdiffbeforeafterboth
--- a/tests/src/eth/scheduling.test.ts
+++ b/tests/src/eth/scheduling.test.ts
@@ -16,9 +16,13 @@
 
 import {expect} from 'chai';
 import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';
-import {scheduleExpectSuccess, waitNewBlocks} from '../util/helpers';
+import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers';
 
 describe('Scheduing EVM smart contracts', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.Scheduler]);
+  });
+
   itWeb3('Successfully schedules and periodically executes an EVM contract', async ({api, web3, privateKeyWrapper}) => {
     const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const flipper = await deployFlipper(web3, deployer);
@@ -51,4 +55,4 @@
       expect(await flipper.methods.getValue().call()).to.be.equal(initialValue);
     }
   });
-});
\ No newline at end of file
+});
modifiedtests/src/limits.test.tsdiffbeforeafterboth
--- a/tests/src/limits.test.ts
+++ b/tests/src/limits.test.ts
@@ -27,6 +27,8 @@
   transferExpectSuccess,
   getFreeBalance,
   waitNewBlocks, burnItemExpectSuccess,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 import {expect} from 'chai';
 
@@ -67,7 +69,9 @@
 describe('Number of tokens per address (ReFungible)', () => {
   let alice: IKeyringPair;
 
-  before(async () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       alice = privateKeyWrapper('//Alice');
     });
@@ -367,7 +371,9 @@
   let bob: IKeyringPair;
   let charlie: IKeyringPair;
 
-  before(async () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       alice = privateKeyWrapper('//Alice');
       bob = privateKeyWrapper('//Bob');
modifiedtests/src/nesting/nest.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/nest.test.ts
+++ b/tests/src/nesting/nest.test.ts
@@ -17,6 +17,8 @@
   transferExpectSuccess,
   transferFromExpectSuccess,
   setCollectionLimitsExpectSuccess,
+  requirePallets,
+  Pallets
 } from '../util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
 
@@ -311,7 +313,9 @@
 
   // ---------- Re-Fungible ----------
 
-  it('ReFungible: allows an Owner to nest/unnest their token', async () => {
+  it('ReFungible: allows an Owner to nest/unnest their token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});
@@ -333,7 +337,9 @@
     });
   });
 
-  it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {
+  it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});
@@ -715,7 +721,9 @@
 
   // ---------- Re-Fungible ----------
 
-  it('ReFungible: disallows to nest token if nesting is disabled', async () => {
+  it('ReFungible: disallows to nest token if nesting is disabled', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}});
@@ -745,7 +753,9 @@
     });
   });
 
-  it('ReFungible: disallows a non-Owner to nest someone else\'s token', async () => {
+  it('ReFungible: disallows a non-Owner to nest someone else\'s token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});
@@ -773,7 +783,9 @@
     });
   });
 
-  it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {
+  it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);
@@ -800,7 +812,9 @@
     });
   });
 
-  it('ReFungible: disallows to nest token to an unlisted collection', async () => {
+  it('ReFungible: disallows to nest token to an unlisted collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}});
modifiedtests/src/nesting/properties.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/properties.test.ts
+++ b/tests/src/nesting/properties.test.ts
@@ -8,6 +8,8 @@
   createItemExpectSuccess,
   getCreateCollectionResult,
   transferExpectSuccess,
+  requirePallets,
+  Pallets
 } from '../util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
 import {tokenIdToAddress} from '../eth/util/helpers';
@@ -64,7 +66,9 @@
     await testMakeSureSuppliesRequired({type: 'NFT'});
   });
 
-  it('Makes sure collectionById supplies required fields for ReFungible', async () => {
+  it('Makes sure collectionById supplies required fields for ReFungible', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testMakeSureSuppliesRequired({type: 'ReFungible'});
   });
 });
@@ -120,7 +124,9 @@
   it('Sets properties for a NFT collection', async () => {
     await testSetsPropertiesForCollection('NFT');
   });
-  it('Sets properties for a ReFungible collection', async () => {
+  it('Sets properties for a ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testSetsPropertiesForCollection('ReFungible');
   });
 
@@ -178,7 +184,9 @@
   it('Check valid names for NFT collection properties keys', async () => {
     await testCheckValidNames('NFT');
   });
-  it('Check valid names for ReFungible collection properties keys', async () => {
+  it('Check valid names for ReFungible collection properties keys', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testCheckValidNames('ReFungible');
   });
 
@@ -209,7 +217,9 @@
   it('Changes properties of a NFT collection', async () => {
     await testChangesProperties({type: 'NFT'});
   });
-  it('Changes properties of a ReFungible collection', async () => {
+  it('Changes properties of a ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testChangesProperties({type: 'ReFungible'});
   });
 
@@ -238,7 +248,9 @@
   it('Deletes properties of a NFT collection', async () => {
     await testDeleteProperties({type: 'NFT'});
   });
-  it('Deletes properties of a ReFungible collection', async () => {
+  it('Deletes properties of a ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testDeleteProperties({type: 'ReFungible'});
   });
 });
@@ -269,7 +281,9 @@
   it('Fails to set properties in a NFT collection if not its onwer/administrator', async () => {
     await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'NFT'});
   });
-  it('Fails to set properties in a ReFungible collection if not its onwer/administrator', async () => {
+  it('Fails to set properties in a ReFungible collection if not its onwer/administrator', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testFailsSetPropertiesIfNotOwnerOrAdmin({type: 'ReFungible'});
   });
   
@@ -307,7 +321,9 @@
   it('Fails to set properties that exceed the limits (NFT)', async () => {
     await testFailsSetPropertiesThatExeedLimits({type: 'NFT'});
   });
-  it('Fails to set properties that exceed the limits (ReFungible)', async () => {
+  it('Fails to set properties that exceed the limits (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testFailsSetPropertiesThatExeedLimits({type: 'ReFungible'});
   });
   
@@ -337,7 +353,9 @@
   it('Fails to set more properties than it is allowed (NFT)', async () => {
     await testFailsSetMorePropertiesThanAllowed({type: 'NFT'});
   });
-  it('Fails to set more properties than it is allowed (ReFungible)', async () => {
+  it('Fails to set more properties than it is allowed (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testFailsSetMorePropertiesThanAllowed({type: 'ReFungible'});
   });
   
@@ -392,7 +410,9 @@
   it('Fails to set properties with invalid names (NFT)', async () => {
     await testFailsSetPropertiesWithInvalidNames({type: 'NFT'});
   });
-  it('Fails to set properties with invalid names (ReFungible)', async () => {
+  it('Fails to set properties with invalid names (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testFailsSetPropertiesWithInvalidNames({type: 'ReFungible'});
   });
 });
@@ -443,7 +463,9 @@
   it('Sets access rights to properties of a collection (NFT)', async () => {
     await testSetsAccessRightsToProperties({type: 'NFT'});
   });
-  it('Sets access rights to properties of a collection (ReFungible)', async () => {
+  it('Sets access rights to properties of a collection (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testSetsAccessRightsToProperties({type: 'ReFungible'});
   });
   
@@ -472,7 +494,9 @@
   it('Changes access rights to properties of a NFT collection', async () => {
     await testChangesAccessRightsToProperty({type: 'NFT'});
   });
-  it('Changes access rights to properties of a ReFungible collection', async () => {
+  it('Changes access rights to properties of a ReFungible collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testChangesAccessRightsToProperty({type: 'ReFungible'});
   });
 });
@@ -502,7 +526,9 @@
   it('Prevents from setting access rights to properties of a NFT collection if not an onwer/admin', async () => {
     await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'NFT'});
   });
-  it('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', async () => {
+  it('Prevents from setting access rights to properties of a ReFungible collection if not an onwer/admin', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testPreventsFromSettingAccessRightsNotAdminOrOwner({type: 'ReFungible'});
   });
 
@@ -531,7 +557,9 @@
   it('Prevents from adding too many possible properties (NFT)', async () => {
     await testPreventFromAddingTooManyPossibleProperties({type: 'NFT'});
   });
-  it('Prevents from adding too many possible properties (ReFungible)', async () => {
+  it('Prevents from adding too many possible properties (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testPreventFromAddingTooManyPossibleProperties({type: 'ReFungible'});
   });
 
@@ -560,7 +588,9 @@
   it('Prevents access rights to be modified if constant (NFT)', async () => {
     await testPreventAccessRightsModifiedIfConstant({type: 'NFT'});
   });
-  it('Prevents access rights to be modified if constant (ReFungible)', async () => {
+  it('Prevents access rights to be modified if constant (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testPreventAccessRightsModifiedIfConstant({type: 'ReFungible'});
   });
 
@@ -608,7 +638,9 @@
   it('Prevents adding properties with invalid names (NFT)', async () => {
     await testPreventsAddingPropertiesWithInvalidNames({type: 'NFT'});
   });
-  it('Prevents adding properties with invalid names (ReFungible)', async () => {
+  it('Prevents adding properties with invalid names (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testPreventsAddingPropertiesWithInvalidNames({type: 'ReFungible'});
   });
 });
@@ -651,7 +683,9 @@
   it('Reads yet empty properties of a token (NFT)', async () => {
     await testReadsYetEmptyProperties({type: 'NFT'});
   });
-  it('Reads yet empty properties of a token (ReFungible)', async () => {
+  it('Reads yet empty properties of a token (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testReadsYetEmptyProperties({type: 'ReFungible'});
   });
 
@@ -696,7 +730,9 @@
   it('Assigns properties to a token according to permissions (NFT)', async () => {
     await testAssignPropertiesAccordingToPermissions({type: 'NFT'}, 1);
   });
-  it('Assigns properties to a token according to permissions (ReFungible)', async () => {
+  it('Assigns properties to a token according to permissions (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testAssignPropertiesAccordingToPermissions({type: 'ReFungible'}, 100);
   });
 
@@ -749,7 +785,9 @@
   it('Changes properties of a token according to permissions (NFT)', async () => {
     await testChangesPropertiesAccordingPermission({type: 'NFT'}, 1);
   });
-  it('Changes properties of a token according to permissions (ReFungible)', async () => {
+  it('Changes properties of a token according to permissions (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testChangesPropertiesAccordingPermission({type: 'ReFungible'}, 100);
   });
 
@@ -802,7 +840,9 @@
   it('Deletes properties of a token according to permissions (NFT)', async () => {
     await testDeletePropertiesAccordingPermission({type: 'NFT'}, 1);
   });
-  it('Deletes properties of a token according to permissions (ReFungible)', async () => {
+  it('Deletes properties of a token according to permissions (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testDeletePropertiesAccordingPermission({type: 'ReFungible'}, 100);
   });
 
@@ -1029,7 +1069,9 @@
   it('Forbids changing/deleting properties of a token if the user is outside of permissions (NFT)', async () => {
     await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'NFT'}, 1);
   });
-  it('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', async () => {
+  it('Forbids changing/deleting properties of a token if the user is outside of permissions (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testForbidsChangingDeletingPropertiesUserOutsideOfPermissions({type: 'ReFungible'}, 100);
   });
 
@@ -1062,7 +1104,9 @@
   it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (NFT)', async () => {
     await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'NFT'}, 1);
   });
-  it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', async () => {
+  it('Forbids changing/deleting properties of a token if the property is permanent (immutable) (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testForbidsChangingDeletingPropertiesIfPropertyImmutable({type: 'ReFungible'}, 100);
   });
 
@@ -1096,7 +1140,9 @@
   it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (NFT)', async () => {
     await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'NFT'}, 1);
   });
-  it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', async () => {
+  it('Forbids adding properties to a token if the property is not declared / forbidden with the \'None\' permission (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testForbidsAddingPropertiesIfPropertyNotDeclared({type: 'ReFungible'}, 100);
   });
 
@@ -1140,7 +1186,9 @@
   it('Forbids adding too many properties to a token (NFT)', async () => {
     await testForbidsAddingTooManyProperties({type: 'NFT'}, 1);
   });
-  it('Forbids adding too many properties to a token (ReFungible)', async () => {
+  it('Forbids adding too many properties to a token (ReFungible)', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await testForbidsAddingTooManyProperties({type: 'ReFungible'}, 100);
   });
 });
@@ -1149,7 +1197,9 @@
   let collection: number;
   let token: number;
 
-  before(async () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       alice = privateKeyWrapper('//Alice');
       bob = privateKeyWrapper('//Bob');
modifiedtests/src/nesting/rules-smoke.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/rules-smoke.test.ts
+++ b/tests/src/nesting/rules-smoke.test.ts
@@ -1,7 +1,7 @@
 import {expect} from 'chai';
 import {tokenIdToAddress} from '../eth/util/helpers';
 import usingApi, {executeTransaction} from '../substrate/substrate-api';
-import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, CrossAccountId, getCreateCollectionResult} from '../util/helpers';
+import {createCollectionExpectSuccess, createFungibleItemExpectSuccess, createItemExpectSuccess, CrossAccountId, getCreateCollectionResult, requirePallets, Pallets} from '../util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
 
 describe('nesting check', () => {
@@ -47,7 +47,9 @@
     });
   });
 
-  it('called for refungible', async () => {
+  it('called for refungible', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collection = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       await expect(executeTransaction(api, alice, api.tx.unique.createItem(collection, nestTarget, {ReFungible: {}})))
modifiedtests/src/nesting/unnest.test.tsdiffbeforeafterboth
--- a/tests/src/nesting/unnest.test.ts
+++ b/tests/src/nesting/unnest.test.ts
@@ -10,6 +10,8 @@
   setCollectionPermissionsExpectSuccess,
   transferExpectSuccess,
   transferFromExpectSuccess,
+  requirePallets,
+  Pallets
 } from '../util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
 
@@ -80,7 +82,9 @@
     });
   });
 
-  it('ReFungible: allows the owner to successfully unnest a token', async () => {
+  it('ReFungible: allows the owner to successfully unnest a token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async api => {
       const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
       await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});
modifiedtests/src/nextSponsoring.test.tsdiffbeforeafterboth
--- a/tests/src/nextSponsoring.test.ts
+++ b/tests/src/nextSponsoring.test.ts
@@ -27,6 +27,8 @@
   transferExpectSuccess,
   normalizeAccountId,
   getNextSponsored,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
@@ -89,7 +91,9 @@
     });
   });
 
-  it('ReFungible', async () => {
+  it('ReFungible', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api: ApiPromise) => {
 
       const createMode = 'ReFungible';
modifiedtests/src/pallet-presence.test.tsdiffbeforeafterboth
--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -49,8 +49,6 @@
   'inflation',
   'unique',
   'nonfungible',
-  'refungible',
-  'scheduler',
   'charging',
 ];
 
@@ -66,8 +64,16 @@
     await usingApi(async api => {
       const chain = await api.rpc.system.chain();
 
-      if (!chain.eq('UNIQUE')) {
-        requiredPallets.push(...['rmrkcore', 'rmrkequip']);
+      const refungible = 'refungible';
+      const scheduler = 'scheduler';
+      const rmrkPallets = ['rmrkcore', 'rmrkequip'];
+
+      if (chain.eq('OPAL by UNIQUE')) {
+        requiredPallets.push(refungible, scheduler, ...rmrkPallets);
+      } else if (chain.eq('QUARTZ by UNIQUE')) {
+        // Insert Quartz additional pallets here
+      } else if (chain.eq('UNIQUE')) {
+        // Insert Unique additional pallets here
       }
     });
   });
modifiedtests/src/refungible.test.tsdiffbeforeafterboth
--- a/tests/src/refungible.test.ts
+++ b/tests/src/refungible.test.ts
@@ -38,6 +38,7 @@
   getDestroyItemsResult,
   getModuleNames,
   Pallets,
+  requirePallets
 } from './util/helpers';
 
 import chai from 'chai';
@@ -52,6 +53,8 @@
 
 describe('integration test: Refungible functionality:', async () => {
   before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api, privateKeyWrapper) => {
       alice = privateKeyWrapper('//Alice');
       bob = privateKeyWrapper('//Bob');
modifiedtests/src/rmrk/acceptNft.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/acceptNft.test.ts
+++ b/tests/src/rmrk/acceptNft.test.ts
@@ -14,7 +14,7 @@
   let api: any;
   before(async function() {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
   
   
modifiedtests/src/rmrk/addResource.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/addResource.test.ts
+++ b/tests/src/rmrk/addResource.test.ts
@@ -27,7 +27,7 @@
   let api: any;
   before(async function() {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   it('add resource', async () => {
modifiedtests/src/rmrk/addTheme.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/addTheme.test.ts
+++ b/tests/src/rmrk/addTheme.test.ts
@@ -9,7 +9,7 @@
   let api: any;
   before(async function() {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkEquip]);
+    await requirePallets(this, [Pallets.RmrkEquip]);
   });
 
   const alice = '//Alice';
modifiedtests/src/rmrk/burnNft.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/burnNft.test.ts
+++ b/tests/src/rmrk/burnNft.test.ts
@@ -17,7 +17,7 @@
   let api: any;
   before(async function() {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
 
modifiedtests/src/rmrk/changeCollectionIssuer.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/changeCollectionIssuer.test.ts
+++ b/tests/src/rmrk/changeCollectionIssuer.test.ts
@@ -13,7 +13,7 @@
   let api: any;
   before(async function() {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
 
modifiedtests/src/rmrk/createBase.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/createBase.test.ts
+++ b/tests/src/rmrk/createBase.test.ts
@@ -6,7 +6,7 @@
   let api: any;
   before(async function() {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore, Pallets.RmrkEquip]);
+    await requirePallets(this, [Pallets.RmrkCore, Pallets.RmrkEquip]);
   });
 
   const alice = '//Alice';
modifiedtests/src/rmrk/createCollection.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/createCollection.test.ts
+++ b/tests/src/rmrk/createCollection.test.ts
@@ -6,7 +6,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
 
modifiedtests/src/rmrk/deleteCollection.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/deleteCollection.test.ts
+++ b/tests/src/rmrk/deleteCollection.test.ts
@@ -7,7 +7,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   const Alice = '//Alice';
modifiedtests/src/rmrk/equipNft.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/equipNft.test.ts
+++ b/tests/src/rmrk/equipNft.test.ts
@@ -126,7 +126,7 @@
   
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore, Pallets.RmrkEquip]);
+    await requirePallets(this, [Pallets.RmrkCore, Pallets.RmrkEquip]);
   });
 
   it('equip nft', async () => {
modifiedtests/src/rmrk/getOwnedNfts.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/getOwnedNfts.test.ts
+++ b/tests/src/rmrk/getOwnedNfts.test.ts
@@ -9,7 +9,7 @@
   
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
 
modifiedtests/src/rmrk/lockCollection.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/lockCollection.test.ts
+++ b/tests/src/rmrk/lockCollection.test.ts
@@ -11,7 +11,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   it('lock collection', async () => {
modifiedtests/src/rmrk/mintNft.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/mintNft.test.ts
+++ b/tests/src/rmrk/mintNft.test.ts
@@ -10,7 +10,7 @@
  
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
 
modifiedtests/src/rmrk/rejectNft.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/rejectNft.test.ts
+++ b/tests/src/rmrk/rejectNft.test.ts
@@ -14,7 +14,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
 
modifiedtests/src/rmrk/removeResource.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/removeResource.test.ts
+++ b/tests/src/rmrk/removeResource.test.ts
@@ -20,7 +20,7 @@
   before(async function() {
     api = await getApiConnection();
     ss58Format = api.registry.getChainProperties()!.toJSON().ss58Format;
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   const Alice = '//Alice';
modifiedtests/src/rmrk/rmrkIsolation.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/rmrkIsolation.test.ts
+++ b/tests/src/rmrk/rmrkIsolation.test.ts
@@ -64,7 +64,7 @@
   before(async function() {
     await usingApi(async (api, privateKeyWrapper) => {
       alice = privateKeyWrapper('//Alice');
-      requirePallets(this, api, [Pallets.RmrkCore]);
+      await requirePallets(this, [Pallets.RmrkCore]);
     });
   });
 
modifiedtests/src/rmrk/sendNft.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/sendNft.test.ts
+++ b/tests/src/rmrk/sendNft.test.ts
@@ -9,7 +9,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   const maxNftId = 0xFFFFFFFF;
modifiedtests/src/rmrk/setCollectionProperty.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/setCollectionProperty.test.ts
+++ b/tests/src/rmrk/setCollectionProperty.test.ts
@@ -10,7 +10,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   it('set collection property', async () => {
modifiedtests/src/rmrk/setEquippableList.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/setEquippableList.test.ts
+++ b/tests/src/rmrk/setEquippableList.test.ts
@@ -7,7 +7,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   const alice = '//Alice';
modifiedtests/src/rmrk/setNftProperty.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/setNftProperty.test.ts
+++ b/tests/src/rmrk/setNftProperty.test.ts
@@ -8,7 +8,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   const alice = '//Alice';
modifiedtests/src/rmrk/setResourcePriorities.test.tsdiffbeforeafterboth
--- a/tests/src/rmrk/setResourcePriorities.test.ts
+++ b/tests/src/rmrk/setResourcePriorities.test.ts
@@ -7,7 +7,7 @@
   let api: any;
   before(async function () {
     api = await getApiConnection();
-    requirePallets(this, api, [Pallets.RmrkCore]);
+    await requirePallets(this, [Pallets.RmrkCore]);
   });
 
   const alice = '//Alice';
modifiedtests/src/setCollectionSponsor.test.tsdiffbeforeafterboth
--- a/tests/src/setCollectionSponsor.test.ts
+++ b/tests/src/setCollectionSponsor.test.ts
@@ -23,6 +23,8 @@
   setCollectionSponsorExpectFailure,
   addCollectionAdminExpectSuccess,
   getCreatedCollectionCount,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 import {IKeyringPair} from '@polkadot/types/types';
 
@@ -50,7 +52,9 @@
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
     await setCollectionSponsorExpectSuccess(collectionId, bob.address);
   });
-  it('Set ReFungible collection sponsor', async () => {
+  it('Set ReFungible collection sponsor', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const collectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     await setCollectionSponsorExpectSuccess(collectionId, bob.address);
   });
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -35,11 +35,14 @@
   getBalance as getTokenBalance,
   transferFromExpectSuccess,
   transferFromExpectFail,
+  requirePallets,
+  Pallets,
 } from './util/helpers';
 import {
   subToEth,
   itWeb3, 
 } from './eth/util/helpers';
+import { request } from 'https';
 
 let alice: IKeyringPair;
 let bob: IKeyringPair;
@@ -89,56 +92,61 @@
     });
   });
 
-  it('User can transfer owned token', async () => {
-    await usingApi(async (api, privateKeyWrapper) => {
-      // nft
-      const nftCollectionId = await createCollectionExpectSuccess();
-      const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
-      await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 1, 'NFT');
-      // fungible
-      const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-      const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
-      await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob, 1, 'Fungible');
-      // reFungible
-      const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-      const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
-      await transferExpectSuccess(
-        reFungibleCollectionId,
-        newReFungibleTokenId,
-        alice,
-        bob,
-        100,
-        'ReFungible',
-      );
-    });
+  it('[nft] User can transfer owned token', async () => {
+    const nftCollectionId = await createCollectionExpectSuccess();
+    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
+    await transferExpectSuccess(nftCollectionId, newNftTokenId, alice, bob, 1, 'NFT');
+  });
+
+  it('[fungible] User can transfer owned token', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
+    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
+    await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob, 1, 'Fungible');
+  });
+
+  it('[refungible] User can transfer owned token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
+    await transferExpectSuccess(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      alice,
+      bob,
+      100,
+      'ReFungible',
+    );
+  });
+
+  it('[nft] Collection admin can transfer owned token', async () => {
+    const nftCollectionId = await createCollectionExpectSuccess();
+    await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address);
+    const newNftTokenId = await createItemExpectSuccess(bob, nftCollectionId, 'NFT', bob.address);
+    await transferExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, 1, 'NFT');
+  });
+
+  it('[fungible] Collection admin can transfer owned token', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
+    await addCollectionAdminExpectSuccess(alice, fungibleCollectionId, bob.address);
+    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible', bob.address);
+    await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, 1, 'Fungible');
   });
 
-  it('Collection admin can transfer owned token', async () => {
-    await usingApi(async (api, privateKeyWrapper) => {
-      // nft
-      const nftCollectionId = await createCollectionExpectSuccess();
-      await addCollectionAdminExpectSuccess(alice, nftCollectionId, bob.address);
-      const newNftTokenId = await createItemExpectSuccess(bob, nftCollectionId, 'NFT', bob.address);
-      await transferExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, 1, 'NFT');
-      // fungible
-      const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-      await addCollectionAdminExpectSuccess(alice, fungibleCollectionId, bob.address);
-      const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible', bob.address);
-      await transferExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, 1, 'Fungible');
-      // reFungible
-      const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-      await addCollectionAdminExpectSuccess(alice, reFungibleCollectionId, bob.address);
-      const newReFungibleTokenId = await createItemExpectSuccess(bob, reFungibleCollectionId, 'ReFungible', bob.address);
-      await transferExpectSuccess(
-        reFungibleCollectionId,
-        newReFungibleTokenId,
-        bob,
-        alice,
-        100,
-        'ReFungible',
-      );
-    });
+  it('[refungible] Collection admin can transfer owned token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    await addCollectionAdminExpectSuccess(alice, reFungibleCollectionId, bob.address);
+    const newReFungibleTokenId = await createItemExpectSuccess(bob, reFungibleCollectionId, 'ReFungible', bob.address);
+    await transferExpectSuccess(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      bob,
+      alice,
+      100,
+      'ReFungible',
+    );
   });
 });
 
@@ -150,33 +158,49 @@
       charlie = privateKeyWrapper('//Charlie');
     });
   });
-  it('Transfer with not existed collection_id', async () => {
+
+  it('[nft] Transfer with not existed collection_id', async () => {
     await usingApi(async (api) => {
-      // nft
       const nftCollectionCount = await getCreatedCollectionCount(api);
       await transferExpectFailure(nftCollectionCount + 1, 1, alice, bob, 1);
-      // fungible
+    });
+  });
+
+  it('[fungible] Transfer with not existed collection_id', async () => {
+    await usingApi(async (api) => {
       const fungibleCollectionCount = await getCreatedCollectionCount(api);
       await transferExpectFailure(fungibleCollectionCount + 1, 0, alice, bob, 1);
-      // reFungible
+    });
+  });
+
+  it('[refungible] Transfer with not existed collection_id', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    await usingApi(async (api) => {
       const reFungibleCollectionCount = await getCreatedCollectionCount(api);
       await transferExpectFailure(reFungibleCollectionCount + 1, 1, alice, bob, 1);
     });
   });
-  it('Transfer with deleted collection_id', async () => {
-    // nft
+
+  it('[nft] Transfer with deleted collection_id', async () => {
     const nftCollectionId = await createCollectionExpectSuccess();
     const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
     await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId);
     await destroyCollectionExpectSuccess(nftCollectionId);
     await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1);
-    // fungible
+  });
+
+  it('[fungible] Transfer with deleted collection_id', async () => {
     const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
     const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
     await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10);
     await destroyCollectionExpectSuccess(fungibleCollectionId);
     await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, alice, bob, 1);
-    // reFungible
+  });
+
+  it('[refungible] Transfer with deleted collection_id', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const reFungibleCollectionId = await
     createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
@@ -190,16 +214,21 @@
       1,
     );
   });
-  it('Transfer with not existed item_id', async () => {
-    // nft
+
+  it('[nft] Transfer with not existed item_id', async () => {
     const nftCollectionId = await createCollectionExpectSuccess();
     await transferExpectFailure(nftCollectionId, 2, alice, bob, 1);
-    // fungible
+  });
+
+  it('[fungible] Transfer with not existed item_id', async () => {
     const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
     await transferExpectFailure(fungibleCollectionId, 2, alice, bob, 1);
-    // reFungible
-    const reFungibleCollectionId = await
-    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+  });
+
+  it('[refungible] Transfer with not existed item_id', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     await transferExpectFailure(
       reFungibleCollectionId,
       2,
@@ -208,18 +237,24 @@
       1,
     );
   });
-  it('Transfer with deleted item_id', async () => {
-    // nft
+
+  it('[nft] Transfer with deleted item_id', async () => {
     const nftCollectionId = await createCollectionExpectSuccess();
     const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
     await burnItemExpectSuccess(alice, nftCollectionId, newNftTokenId, 1);
     await transferExpectFailure(nftCollectionId, newNftTokenId, alice, bob, 1);
-    // fungible
+  });
+
+  it('[fungible] Transfer with deleted item_id', async () => {
     const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
     const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
     await burnItemExpectSuccess(alice, fungibleCollectionId, newFungibleTokenId, 10);
     await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, alice, bob, 1);
-    // reFungible
+  });
+
+  it('[refungible] Transfer with deleted item_id', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     const reFungibleCollectionId = await
     createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
@@ -232,18 +267,23 @@
       1,
     );
   });
-  it('Transfer with recipient that is not owner', async () => {
-    // nft
+
+  it('[nft] Transfer with recipient that is not owner', async () => {
     const nftCollectionId = await createCollectionExpectSuccess();
     const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
     await transferExpectFailure(nftCollectionId, newNftTokenId, charlie, bob, 1);
-    // fungible
+  });
+
+  it('[fungible] Transfer with recipient that is not owner', async () => {
     const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
     const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
     await transferExpectFailure(fungibleCollectionId, newFungibleTokenId, charlie, bob, 1);
-    // reFungible
-    const reFungibleCollectionId = await
-    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+  });
+
+  it('[refungible] Transfer with recipient that is not owner', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
     const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
     await transferExpectFailure(
       reFungibleCollectionId,
@@ -276,7 +316,9 @@
     });
   });
 
-  it('RFT', async () => {
+  it('RFT', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async (api: ApiPromise) => {
       const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- a/tests/src/transferFrom.test.ts
+++ b/tests/src/transferFrom.test.ts
@@ -31,6 +31,8 @@
   burnItemExpectSuccess,
   setCollectionLimitsExpectSuccess,
   getCreatedCollectionCount,
+  requirePallets,
+  Pallets
 } from './util/helpers';
 
 chai.use(chaiAsPromised);
@@ -49,36 +51,36 @@
     });
   });
 
-  it('Execute the extrinsic and check nftItemList - owner of token', async () => {
-    await usingApi(async () => {
-      // nft
-      const nftCollectionId = await createCollectionExpectSuccess();
-      const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
-      await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address);
+  it('[nft] Execute the extrinsic and check nftItemList - owner of token', async () => {
+    const nftCollectionId = await createCollectionExpectSuccess();
+    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
+    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address);
 
-      await transferFromExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, charlie, 1, 'NFT');
+    await transferFromExpectSuccess(nftCollectionId, newNftTokenId, bob, alice, charlie, 1, 'NFT');
+  });
 
-      // fungible
-      const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-      const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
-      await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address);
-      await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1, 'Fungible');
+  it('[fungible] Execute the extrinsic and check nftItemList - owner of token', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
+    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
+    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address);
+    await transferFromExpectSuccess(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1, 'Fungible');
+  });
 
-      // reFungible
-      const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-      const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
-      await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 100);
-      await transferFromExpectSuccess(
-        reFungibleCollectionId,
-        newReFungibleTokenId,
-        bob,
-        alice,
-        charlie,
-        100,
-        'ReFungible',
-      );
-    });
+  it('[refungible] Execute the extrinsic and check nftItemList - owner of token', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
+    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address, 100);
+    await transferFromExpectSuccess(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      bob,
+      alice,
+      charlie,
+      100,
+      'ReFungible',
+    );
   });
 
   it('Should reduce allowance if value is big', async () => {
@@ -119,20 +121,28 @@
     });
   });
 
-  it('transferFrom for a collection that does not exist', async () => {
+  it('[nft] transferFrom for a collection that does not exist', async () => {
     await usingApi(async (api: ApiPromise) => {
-      // nft
       const nftCollectionCount = await getCreatedCollectionCount(api);
       await approveExpectFail(nftCollectionCount + 1, 1, alice, bob);
 
       await transferFromExpectFail(nftCollectionCount + 1, 1, bob, alice, charlie, 1);
+    });
+  });
 
-      // fungible
+  it('[fungible] transferFrom for a collection that does not exist', async () => {
+    await usingApi(async (api: ApiPromise) => {
       const fungibleCollectionCount = await getCreatedCollectionCount(api);
       await approveExpectFail(fungibleCollectionCount + 1, 0, alice, bob);
 
       await transferFromExpectFail(fungibleCollectionCount + 1, 0, bob, alice, charlie, 1);
-      // reFungible
+    });
+  });
+
+  it('[refungible] transferFrom for a collection that does not exist', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    await usingApi(async (api: ApiPromise) => {
       const reFungibleCollectionCount = await getCreatedCollectionCount(api);
       await approveExpectFail(reFungibleCollectionCount + 1, 1, alice, bob);
 
@@ -158,67 +168,70 @@
     });
   }); */
 
-  it('transferFrom for not approved address', async () => {
-    await usingApi(async () => {
-      // nft
-      const nftCollectionId = await createCollectionExpectSuccess();
-      const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
+  it('[nft] transferFrom for not approved address', async () => {
+    const nftCollectionId = await createCollectionExpectSuccess();
+    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
 
-      await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1);
+    await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 1);
+  });
 
-      // fungible
-      const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-      const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
-      await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1);
-      // reFungible
-      const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-      const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
-      await transferFromExpectFail(
-        reFungibleCollectionId,
-        newReFungibleTokenId,
-        bob,
-        alice,
-        charlie,
-        1,
-      );
-    });
+  it('[fungible] transferFrom for not approved address', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
+    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
+    await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 1);
+  });
+
+  it('[refungible] transferFrom for not approved address', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    const reFungibleCollectionId = await
+    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
+    await transferFromExpectFail(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      bob,
+      alice,
+      charlie,
+      1,
+    );
+  });
+
+  it('[nft] transferFrom incorrect token count', async () => {
+    const nftCollectionId = await createCollectionExpectSuccess();
+    const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
+    await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address);
+
+    await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 2);
   });
 
-  it('transferFrom incorrect token count', async () => {
-    await usingApi(async () => {
-      // nft
-      const nftCollectionId = await createCollectionExpectSuccess();
-      const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
-      await approveExpectSuccess(nftCollectionId, newNftTokenId, alice, bob.address);
+  it('[fungible] transferFrom incorrect token count', async () => {
+    const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
+    const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
+    await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address);
+    await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 2);
+  });
 
-      await transferFromExpectFail(nftCollectionId, newNftTokenId, bob, alice, charlie, 2);
+  it('[refungible] transferFrom incorrect token count', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
 
-      // fungible
-      const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
-      const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
-      await approveExpectSuccess(fungibleCollectionId, newFungibleTokenId, alice, bob.address);
-      await transferFromExpectFail(fungibleCollectionId, newFungibleTokenId, bob, alice, charlie, 2);
-      // reFungible
-      const reFungibleCollectionId = await
-      createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
-      const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
-      await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address);
-      await transferFromExpectFail(
-        reFungibleCollectionId,
-        newReFungibleTokenId,
-        bob,
-        alice,
-        charlie,
-        2,
-      );
-    });
+    const reFungibleCollectionId = await
+    createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
+    const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
+    await approveExpectSuccess(reFungibleCollectionId, newReFungibleTokenId, alice, bob.address);
+    await transferFromExpectFail(
+      reFungibleCollectionId,
+      newReFungibleTokenId,
+      bob,
+      alice,
+      charlie,
+      2,
+    );
   });
 
-  it('execute transferFrom from account that is not owner of collection', async () => {
+  it('[nft] execute transferFrom from account that is not owner of collection', async () => {
     await usingApi(async (api, privateKeyWrapper) => {
       const dave = privateKeyWrapper('//Dave');
-      // nft
       const nftCollectionId = await createCollectionExpectSuccess();
       const newNftTokenId = await createItemExpectSuccess(alice, nftCollectionId, 'NFT');
       try {
@@ -230,8 +243,13 @@
       }
 
       // await transferFromExpectFail(nftCollectionId, newNftTokenId, Dave, Alice, Charlie, 1);
+    });
+  });
 
-      // fungible
+  it('[fungible] execute transferFrom from account that is not owner of collection', async () => {
+    await usingApi(async (api, privateKeyWrapper) => {
+      const dave = privateKeyWrapper('//Dave');
+
       const fungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});
       const newFungibleTokenId = await createItemExpectSuccess(alice, fungibleCollectionId, 'Fungible');
       try {
@@ -241,7 +259,14 @@
         // tslint:disable-next-line:no-unused-expression
         expect(e).to.be.exist;
       }
-      // reFungible
+    });
+  });
+
+  it('[refungible] execute transferFrom from account that is not owner of collection', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
+    await usingApi(async (api, privateKeyWrapper) => {
+      const dave = privateKeyWrapper('//Dave');
       const reFungibleCollectionId = await
       createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');
@@ -276,7 +301,9 @@
 
     });
   });
-  it('transferFrom burnt token before approve ReFungible', async () => {
+  it('transferFrom burnt token before approve ReFungible', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async () => {
       const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       await setCollectionLimitsExpectSuccess(alice, reFungibleCollectionId, {ownerCanTransfer: true});
@@ -308,7 +335,9 @@
 
     });
   });
-  it('transferFrom burnt token after approve ReFungible', async () => {
+  it('transferFrom burnt token after approve ReFungible', async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+
     await usingApi(async () => {
       const reFungibleCollectionId = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});
       const newReFungibleTokenId = await createItemExpectSuccess(alice, reFungibleCollectionId, 'ReFungible');