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
20import {evmToAddress} from '@polkadot/util-crypto';20import {evmToAddress} from '@polkadot/util-crypto';
21import {readFile} from 'fs/promises';21import {readFile} from 'fs/promises';
22import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';22import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';
23import {getCreateCollectionResult, getCreateItemResult, UNIQUE} from '../../util/helpers';23import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers';
24import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';24import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
25import {Contract} from 'web3-eth-contract';25import {Contract} from 'web3-eth-contract';
26import * as solc from 'solc';26import * as solc from 'solc';
116}116}
117117
118describe('Fractionalizer contract usage', () => {118describe('Fractionalizer contract usage', () => {
119 before(async function() {
120 await requirePallets(this, [Pallets.ReFungible]);
121 });
122
119 itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {123 itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {
120 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);124 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
224228
225229
226describe('Negative Integration Tests for fractionalizer', () => {230describe('Negative Integration Tests for fractionalizer', () => {
231 before(async function() {
232 await requirePallets(this, [Pallets.ReFungible]);
233 });
234
227 itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {235 itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {
228 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);236 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -651,6 +651,10 @@
 });
 
 describe('ERC 1633 implementation', () => {
+  before(async function() {
+    await requirePallets(this, [Pallets.ReFungible]);
+  });
+
   itWeb3('Parent NFT token address and id', async ({api, web3, privateKeyWrapper}) => {
     const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);