git.delta.rocks / unique-network / refs/commits / 008dfe41f9df

difftreelog

feat erc nesting tests + some fixes

Trubnikov Sergey2023-05-10parent: #2dd0a6a.patch.diff
in: master

5 files changed

modifiedpallets/balances-adapter/src/lib.rsdiffbeforeafterboth
--- a/pallets/balances-adapter/src/lib.rs
+++ b/pallets/balances-adapter/src/lib.rs
@@ -104,22 +104,20 @@
 			from: &T::CrossAccountId,
 			nesting_budget: &dyn Budget,
 		) -> Result<u128, DispatchError> {
-			if spender.conv_eq(from) {
-				return Ok(0);
-			}
-
-			if let Some(source) = T::CrossTokenAddressMapping::address_to_token(from) {
+			if let Some((collection_id, token_id)) =
+				T::CrossTokenAddressMapping::address_to_token(from)
+			{
 				ensure!(
 					<PalletStructure<T>>::check_indirectly_owned(
 						spender.clone(),
-						source.0,
-						source.1,
+						collection_id,
+						token_id,
 						None,
 						nesting_budget
 					)?,
 					<CommonError<T>>::ApprovedValueTooLow,
 				);
-			} else if spender != from {
+			} else if !spender.conv_eq(from) {
 				return Ok(0);
 			}
 
@@ -183,7 +181,7 @@
 			amount: u128,
 			nesting_budget: &dyn Budget,
 		) -> DispatchResultWithPostInfo {
-			let allowance = Self::check_allowed(collection, spender, from, amount, nesting_budget)?;
+			let allowance = Self::check_allowed(spender, from, nesting_budget)?;
 			if allowance < amount {
 				return Err(<CommonError<T>>::ApprovedValueTooLow.into());
 			}
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -109,7 +109,8 @@
 			.recorder
 			.weight_calls_budget(<StructureWeight<T>>::find_parent());
 
-		<Pallet<T>>::transfer(self, &caller, &to, amount, &budget).map_err(|_| "transfer error")?;
+		<Pallet<T>>::transfer(self, &caller, &to, amount, &budget)
+			.map_err(|e| dispatch_to_evm::<T>(e.error))?;
 		Ok(true)
 	}
 
modifiedtests/src/eth/nesting/nest.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nesting/nest.test.ts
+++ b/tests/src/eth/nesting/nest.test.ts
@@ -187,4 +187,80 @@
         .call()).to.be.rejectedWith('SourceCollectionIsNotAllowedToNest');
     });
   });
+
+  describe('Fungible', () => {
+    async function createFungibleCollection(helper: EthUniqueHelper, owner: string, mode: 'ft' | 'native ft') {
+      if (mode === 'ft') {
+        const {collectionAddress} = await helper.eth.createFungibleCollection(owner, '', 18, '', '');
+        const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+        await contract.methods.mint(owner, 100n).send({from: owner});
+        return {collectionAddress, contract};
+      }
+
+      // native ft
+      const collectionAddress = helper.ethAddress.fromCollectionId(0);
+      const contract = await helper.ethNativeContract.collection(collectionAddress, 'ft', owner);
+      return {collectionAddress, contract};
+    }
+
+    [
+      {mode: 'ft' as const},
+      {mode: 'native ft' as const},
+    ].map(testCase => {
+      itEth(`Allow nest [${testCase.mode}]`, async ({helper}) => {
+        const owner = await helper.eth.createAccountWithBalance(donor);
+        const {collectionId: targetCollectionId, contract: targetContract} = await createNestingCollection(helper, owner);
+        const {contract: ftContract} = await createFungibleCollection(helper, owner, testCase.mode);
+
+        const mintingTargetTokenIdResult = await targetContract.methods.mint(owner).send({from: owner});
+        const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId;
+        const targetTokenAddress = helper.ethAddress.fromTokenId(targetCollectionId, targetTokenId);
+
+        await ftContract.methods.transfer(targetTokenAddress, 10n).send({from: owner});
+        expect(await ftContract.methods.balanceOf(targetTokenAddress).call({from: owner})).to.be.equal('10');
+      });
+    });
+
+    [
+      {mode: 'ft' as const},
+      {mode: 'native ft' as const},
+    ].map(testCase => {
+      itEth(`Allow partial/full unnest [${testCase.mode}]`, async ({helper}) => {
+        const owner = await helper.eth.createAccountWithBalance(donor);
+        const {collectionId: targetCollectionId, contract: targetContract} = await createNestingCollection(helper, owner);
+        const {contract: ftContract} = await createFungibleCollection(helper, owner, testCase.mode);
+
+        const mintingTargetTokenIdResult = await targetContract.methods.mint(owner).send({from: owner});
+        const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId;
+        const targetTokenAddress = helper.ethAddress.fromTokenId(targetCollectionId, targetTokenId);
+
+        await ftContract.methods.transfer(targetTokenAddress, 10n).send({from: owner});
+
+        await ftContract.methods.transferFrom(targetTokenAddress, owner, 5n).send({from: owner});
+        expect(await ftContract.methods.balanceOf(targetTokenAddress).call({from: owner})).to.be.equal('5');
+
+        await ftContract.methods.transferFrom(targetTokenAddress, owner, 5n).send({from: owner});
+        expect(await ftContract.methods.balanceOf(targetTokenAddress).call({from: owner})).to.be.equal('0');
+      });
+    });
+
+    [
+      {mode: 'ft' as const},
+      {mode: 'native ft' as const},
+    ].map(testCase => {
+      itEth(`Disallow nest into collection without nesting permission [${testCase.mode}]`, async ({helper}) => {
+        const owner = await helper.eth.createAccountWithBalance(donor);
+        const {collectionId: targetCollectionId, contract: targetContract} = await createNestingCollection(helper, owner);
+        await targetContract.methods.setCollectionNesting(false).send({from: owner});
+
+        const {contract: ftContract} = await createFungibleCollection(helper, owner, testCase.mode);
+
+        const mintingTargetTokenIdResult = await targetContract.methods.mint(owner).send({from: owner});
+        const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId;
+        const targetTokenAddress = helper.ethAddress.fromTokenId(targetCollectionId, targetTokenId);
+
+        await expect(ftContract.methods.transfer(targetTokenAddress, 10n).call({from: owner})).to.be.rejectedWith('UserIsNotAllowedToNest');
+      });
+    });
+  });
 });
modifiedtests/src/nativeFungible.test.tsdiffbeforeafterboth
before · tests/src/nativeFungible.test.ts
1// Copyright 2019-2023 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 {expect, itSub, usingPlaygrounds} from './util';1920describe('Native fungible', () => {21  let alice: IKeyringPair;22  let bob: IKeyringPair;2324  before(async () => {25    await usingPlaygrounds(async (helper, privateKey) => {26      const donor = await privateKey({url: import.meta.url});27      [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);28    });29  });3031  itSub('destroy_collection()', async ({helper}) => {32    const collection = helper.ft.getCollectionObject(0);33    await expect(collection.burn(alice)).to.be.rejectedWith('common.UnsupportedOperation');34    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.destroyCollection', [0])).to.be.rejectedWith('common.UnsupportedOperation');35  });3637  itSub('add_to_allow_list()', async ({helper}) => {38    const collection = helper.ft.getCollectionObject(0);39    await expect(collection.addToAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');40  });4142  itSub('remove_from_allow_list()', async ({helper}) => {43    const collection = helper.ft.getCollectionObject(0);44    await expect(collection.removeFromAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');45  });4647  itSub('change_collection_owner()', async ({helper}) => {48    const collection = helper.ft.getCollectionObject(0);49    await expect(collection.changeOwner(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');50  });5152  itSub('add_collection_admin()', async ({helper}) => {53    const collection = helper.ft.getCollectionObject(0);54    await expect(collection.addAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');55  });5657  itSub('remove_collection_admin()', async ({helper}) => {58    const collection = helper.ft.getCollectionObject(0);59    await expect(collection.removeAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');60  });6162  itSub('set_collection_sponsor()', async ({helper}) => {63    const collection = helper.ft.getCollectionObject(0);64    await expect(collection.setSponsor(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');65  });6667  itSub('confirm_sponsorship()', async ({helper}) => {68    const collection = helper.ft.getCollectionObject(0);69    await expect(collection.confirmSponsorship(alice)).to.be.rejectedWith('common.UnsupportedOperation');70  });7172  itSub('remove_collection_sponsor()', async ({helper}) => {73    const collection = helper.ft.getCollectionObject(0);74    await expect(collection.removeSponsor(alice)).to.be.rejectedWith('common.UnsupportedOperation');75  });7677  itSub('create_item()', async ({helper}) => {78    const collection = helper.ft.getCollectionObject(0);79    await expect(collection.mint(alice, 100n, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');80  });8182  itSub('set_collection_properties()', async ({helper}) => {83    const collection = helper.ft.getCollectionObject(0);84    await expect(collection.setProperties(alice, [{key: 'value'}])).to.be.rejectedWith('common.UnsupportedOperation');85  });8687  itSub('delete_collection_properties()', async ({helper}) => {88    const collection = helper.ft.getCollectionObject(0);89    await expect(collection.deleteProperties(alice, ['key'])).to.be.rejectedWith('common.UnsupportedOperation');90  });9192  itSub('set_token_properties()', async ({helper}) => {93    await expect(helper.executeExtrinsic(94      alice,95      'api.tx.unique.setTokenProperties',96      [0, 0, [{key: 'value'}]],97      true,98    )).to.be.rejectedWith('common.UnsupportedOperation');99  });100101  itSub('delete_token_properties()', async ({helper}) => {102    await expect(helper.executeExtrinsic(103      alice,104      'api.tx.unique.deleteTokenProperties',105      [0, 0, ['key']],106      true,107    )).to.be.rejectedWith('common.UnsupportedOperation');108  });109110  itSub('set_transfers_enabled_flag()', async ({helper}) => {111    await expect(helper.executeExtrinsic(112      alice,113      'api.tx.unique.setTransfersEnabledFlag',114      [0, true],115      true,116    )).to.be.rejectedWith('common.UnsupportedOperation');117  });118119  itSub('burn_item()', async ({helper}) => {120    await expect(helper.executeExtrinsic(121      alice,122      'api.tx.unique.burnItem',123      [0, 0, 100n],124      true,125    )).to.be.rejectedWith('common.UnsupportedOperation');126  });127128  itSub('burn_from()', async ({helper}) => {129    const collection = helper.ft.getCollectionObject(0);130    await expect(collection.burnTokens(alice, 100n)).to.be.rejectedWith('common.UnsupportedOperation');131  });132133  itSub('transfer()', async ({helper}) => {134    const collection = helper.ft.getCollectionObject(0);135    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);136    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);137    await collection.transfer(alice, {Substrate: bob.address}, 100n);138    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);139    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);140    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;141    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;142  });143144  itSub('transfer_from()', async ({helper}) => {145    const collection = helper.ft.getCollectionObject(0);146    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);147    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);148149    await collection.transferFrom(alice, {Substrate: alice.address}, {Substrate: bob.address}, 100n);150151    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);152    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);153    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;154    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;155156    await expect(collection.transferFrom(alice, {Substrate: bob.address}, {Substrate: alice.address}, 100n)).to.be.rejectedWith('common.ApprovedValueTooLow');157  });158159  itSub('approve()', async ({helper}) => {160    const collection = helper.ft.getCollectionObject(0);161    await expect(collection.approveTokens(alice, {Substrate: bob.address}, 100n)).to.be.rejectedWith('common.UnsupportedOperation');162  });163164  itSub('approve_from()', async ({helper}) => {165    await expect(helper.executeExtrinsic(166      alice,167      'api.tx.unique.approveFrom',168      [{Substrate: alice.address}, {Substrate: bob.address}, 0, 0, 100n],169      true,170    )).to.be.rejectedWith('common.UnsupportedOperation');171  });172173  itSub('set_collection_limits()', async ({helper}) => {174    const collection = helper.ft.getCollectionObject(0);175    await expect(collection.setLimits(alice, {accountTokenOwnershipLimit: 1})).to.be.rejectedWith('common.UnsupportedOperation');176  });177178  itSub('set_collection_permissions()', async ({helper}) => {179    const collection = helper.ft.getCollectionObject(0);180    await expect(collection.setPermissions(alice, {access: 'AllowList'})).to.be.rejectedWith('common.UnsupportedOperation');181  });182183  itSub('repartition()', async ({helper}) => {184    await expect(helper.executeExtrinsic(185      alice,186      'api.tx.unique.repartition',187      [0, 0, 100n],188      true,189    )).to.be.rejectedWith('unique.RepartitionCalledOnNonRefungibleCollection');190  });191192  itSub('force_repair_collection()', async ({helper}) => {193    await expect(helper.executeExtrinsic(194      alice,195      'api.tx.unique.forceRepairCollection',196      [0],197      true,198    )).to.be.rejectedWith('common.UnsupportedOperation');199  });200201  itSub('force_repair_item()', async ({helper}) => {202    await expect(helper.executeExtrinsic(203      alice,204      'api.tx.unique.forceRepairItem',205      [0, 0],206      true,207    )).to.be.rejectedWith('BadOrigin');208  });209210  itSub.only('Nest into NFT token()', async ({helper}) => {211    const nftCollection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});212    const targetToken = await nftCollection.mintToken(alice);213214    const collection = helper.ft.getCollectionObject(0);215    await collection.transfer(alice, targetToken.nestingAccount(), 100n);216217    await collection.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 100n);218  });219});
after · tests/src/nativeFungible.test.ts
1// Copyright 2019-2023 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 {expect, itSub, usingPlaygrounds} from './util';1920describe('Native fungible', () => {21  let alice: IKeyringPair;22  let bob: IKeyringPair;2324  before(async () => {25    await usingPlaygrounds(async (helper, privateKey) => {26      const donor = await privateKey({url: import.meta.url});27      [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);28    });29  });3031  itSub('destroy_collection()', async ({helper}) => {32    const collection = helper.ft.getCollectionObject(0);33    await expect(collection.burn(alice)).to.be.rejectedWith('common.UnsupportedOperation');34    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.destroyCollection', [0])).to.be.rejectedWith('common.UnsupportedOperation');35  });3637  itSub('add_to_allow_list()', async ({helper}) => {38    const collection = helper.ft.getCollectionObject(0);39    await expect(collection.addToAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');40  });4142  itSub('remove_from_allow_list()', async ({helper}) => {43    const collection = helper.ft.getCollectionObject(0);44    await expect(collection.removeFromAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');45  });4647  itSub('change_collection_owner()', async ({helper}) => {48    const collection = helper.ft.getCollectionObject(0);49    await expect(collection.changeOwner(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');50  });5152  itSub('add_collection_admin()', async ({helper}) => {53    const collection = helper.ft.getCollectionObject(0);54    await expect(collection.addAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');55  });5657  itSub('remove_collection_admin()', async ({helper}) => {58    const collection = helper.ft.getCollectionObject(0);59    await expect(collection.removeAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');60  });6162  itSub('set_collection_sponsor()', async ({helper}) => {63    const collection = helper.ft.getCollectionObject(0);64    await expect(collection.setSponsor(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');65  });6667  itSub('confirm_sponsorship()', async ({helper}) => {68    const collection = helper.ft.getCollectionObject(0);69    await expect(collection.confirmSponsorship(alice)).to.be.rejectedWith('common.UnsupportedOperation');70  });7172  itSub('remove_collection_sponsor()', async ({helper}) => {73    const collection = helper.ft.getCollectionObject(0);74    await expect(collection.removeSponsor(alice)).to.be.rejectedWith('common.UnsupportedOperation');75  });7677  itSub('create_item()', async ({helper}) => {78    const collection = helper.ft.getCollectionObject(0);79    await expect(collection.mint(alice, 100n, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');80  });8182  itSub('set_collection_properties()', async ({helper}) => {83    const collection = helper.ft.getCollectionObject(0);84    await expect(collection.setProperties(alice, [{key: 'value'}])).to.be.rejectedWith('common.UnsupportedOperation');85  });8687  itSub('delete_collection_properties()', async ({helper}) => {88    const collection = helper.ft.getCollectionObject(0);89    await expect(collection.deleteProperties(alice, ['key'])).to.be.rejectedWith('common.UnsupportedOperation');90  });9192  itSub('set_token_properties()', async ({helper}) => {93    await expect(helper.executeExtrinsic(94      alice,95      'api.tx.unique.setTokenProperties',96      [0, 0, [{key: 'value'}]],97      true,98    )).to.be.rejectedWith('common.UnsupportedOperation');99  });100101  itSub('delete_token_properties()', async ({helper}) => {102    await expect(helper.executeExtrinsic(103      alice,104      'api.tx.unique.deleteTokenProperties',105      [0, 0, ['key']],106      true,107    )).to.be.rejectedWith('common.UnsupportedOperation');108  });109110  itSub('set_transfers_enabled_flag()', async ({helper}) => {111    await expect(helper.executeExtrinsic(112      alice,113      'api.tx.unique.setTransfersEnabledFlag',114      [0, true],115      true,116    )).to.be.rejectedWith('common.UnsupportedOperation');117  });118119  itSub('burn_item()', async ({helper}) => {120    await expect(helper.executeExtrinsic(121      alice,122      'api.tx.unique.burnItem',123      [0, 0, 100n],124      true,125    )).to.be.rejectedWith('common.UnsupportedOperation');126  });127128  itSub('burn_from()', async ({helper}) => {129    const collection = helper.ft.getCollectionObject(0);130    await expect(collection.burnTokens(alice, 100n)).to.be.rejectedWith('common.UnsupportedOperation');131  });132133  itSub('transfer()', async ({helper}) => {134    const collection = helper.ft.getCollectionObject(0);135    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);136    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);137    await collection.transfer(alice, {Substrate: bob.address}, 100n);138    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);139    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);140    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;141    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;142  });143144  itSub('transfer_from()', async ({helper}) => {145    const collection = helper.ft.getCollectionObject(0);146    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);147    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);148149    await collection.transferFrom(alice, {Substrate: alice.address}, {Substrate: bob.address}, 100n);150151    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);152    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);153    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;154    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;155156    await expect(collection.transferFrom(alice, {Substrate: bob.address}, {Substrate: alice.address}, 100n)).to.be.rejectedWith('common.ApprovedValueTooLow');157  });158159  itSub('approve()', async ({helper}) => {160    const collection = helper.ft.getCollectionObject(0);161    await expect(collection.approveTokens(alice, {Substrate: bob.address}, 100n)).to.be.rejectedWith('common.UnsupportedOperation');162  });163164  itSub('approve_from()', async ({helper}) => {165    await expect(helper.executeExtrinsic(166      alice,167      'api.tx.unique.approveFrom',168      [{Substrate: alice.address}, {Substrate: bob.address}, 0, 0, 100n],169      true,170    )).to.be.rejectedWith('common.UnsupportedOperation');171  });172173  itSub('set_collection_limits()', async ({helper}) => {174    const collection = helper.ft.getCollectionObject(0);175    await expect(collection.setLimits(alice, {accountTokenOwnershipLimit: 1})).to.be.rejectedWith('common.UnsupportedOperation');176  });177178  itSub('set_collection_permissions()', async ({helper}) => {179    const collection = helper.ft.getCollectionObject(0);180    await expect(collection.setPermissions(alice, {access: 'AllowList'})).to.be.rejectedWith('common.UnsupportedOperation');181  });182183  itSub('repartition()', async ({helper}) => {184    await expect(helper.executeExtrinsic(185      alice,186      'api.tx.unique.repartition',187      [0, 0, 100n],188      true,189    )).to.be.rejectedWith('unique.RepartitionCalledOnNonRefungibleCollection');190  });191192  itSub('force_repair_collection()', async ({helper}) => {193    await expect(helper.executeExtrinsic(194      alice,195      'api.tx.unique.forceRepairCollection',196      [0],197      true,198    )).to.be.rejectedWith('common.UnsupportedOperation');199  });200201  itSub('force_repair_item()', async ({helper}) => {202    await expect(helper.executeExtrinsic(203      alice,204      'api.tx.unique.forceRepairItem',205      [0, 0],206      true,207    )).to.be.rejectedWith('BadOrigin');208  });209210  itSub('Nest into NFT token()', async ({helper}) => {211    const nftCollection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});212    const targetToken = await nftCollection.mintToken(alice);213214    const collection = helper.ft.getCollectionObject(0);215    await collection.transfer(alice, targetToken.nestingAccount(), 100n);216217    await collection.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 100n);218  });219});
modifiedtests/src/sub/nesting/unnesting.negative.test.tsdiffbeforeafterboth
--- a/tests/src/sub/nesting/unnesting.negative.test.ts
+++ b/tests/src/sub/nesting/unnesting.negative.test.ts
@@ -58,7 +58,7 @@
     {mode: md.mode, restrictedMode: true},
     {mode: md.mode, restrictedMode: false},
   ].map(testCase => {
-    itSub.only(`Fungible: disallows a non-Owner to unnest someone else's token [${testCase.mode}${testCase.restrictedMode ? ' (Restricted nesting)' : ''}]`, async ({helper}) => {
+    itSub(`Fungible: disallows a non-Owner to unnest someone else's token [${testCase.mode}${testCase.restrictedMode ? ' (Restricted nesting)' : ''}]`, async ({helper}) => {
       const collectionNFT = await helper.nft.mintCollection(alice);
       const collectionFT = await (
         testCase.mode === 'ft'