git.delta.rocks / unique-network / refs/commits / 5b68c20d6e2c

difftreelog

fix(rft) fractionalizer tests run only when rft pallet is on

Daniel Shiposha2022-08-16parent: #83d3baa.patch.diff
in: master

2 files changed

modifiedtests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -20,7 +20,7 @@
 import {evmToAddress} from '@polkadot/util-crypto';
 import {readFile} from 'fs/promises';
 import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';
-import {getCreateCollectionResult, getCreateItemResult, UNIQUE} from '../../util/helpers';
+import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers';
 import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
 import {Contract} from 'web3-eth-contract';
 import * as solc from 'solc';
@@ -116,6 +116,10 @@
 }
 
 describe('Fractionalizer contract usage', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const fractionalizer = await deployFractionalizer(web3, owner);
@@ -224,6 +228,10 @@
 
 
 describe('Negative Integration Tests for fractionalizer', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
     const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
@@ -467,4 +475,4 @@
     await expect(fractionalizer.methods.nft2rft(nftCollectionAddress, nftTokenId, 100n).call())
       .to.be.rejectedWith(/TransferNotAllowed$/g);
   });
-});
\ No newline at end of file
+});
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
651});651});
652652
653describe('ERC 1633 implementation', () => {653describe('ERC 1633 implementation', () => {
654 before(async function() {
655 await requirePallets(this, [Pallets.ReFungible]);
656 });
657
654 itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => {658 itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => {
655 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);659 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);