git.delta.rocks / unique-network / refs/commits / 2dd0a6af978d

difftreelog

add sub tests for nesting

Trubnikov Sergey2023-05-05parent: #bea0737.patch.diff
in: master

8 files changed

deletedtests/src/NativeFungible.test.tsdiffbeforeafterboth
--- a/tests/src/NativeFungible.test.ts
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright 2019-2023 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// 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 {IKeyringPair} from '@polkadot/types/types';
-import {expect, itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds} from './util';
-import {ICollectionCreationOptions} from './util/playgrounds/types';
-
-describe('Native fungible', () => {
-  let alice: IKeyringPair;
-  let bob: IKeyringPair;
-
-  before(async () => {
-    await usingPlaygrounds(async (helper, privateKey) => {
-      const donor = await privateKey({url: import.meta.url});
-      [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
-    });
-  });
-
-  itSub('destroy_collection()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.burn(alice)).to.be.rejectedWith('common.UnsupportedOperation');
-    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.destroyCollection', [0])).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('add_to_allow_list()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.addToAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('remove_from_allow_list()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.removeFromAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('change_collection_owner()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.changeOwner(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('add_collection_admin()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.addAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('remove_collection_admin()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.removeAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('set_collection_sponsor()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.setSponsor(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('confirm_sponsorship()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.confirmSponsorship(alice)).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('remove_collection_sponsor()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.removeSponsor(alice)).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('create_item()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.mint(alice, 100n, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('set_collection_properties()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.setProperties(alice, [{key: 'value'}])).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('delete_collection_properties()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.deleteProperties(alice, ['key'])).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('set_token_properties()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.setTokenProperties',
-      [0, 0, [{key: 'value'}]],
-      true,
-    )).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('delete_token_properties()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.deleteTokenProperties',
-      [0, 0, ['key']],
-      true,
-    )).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('set_transfers_enabled_flag()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.setTransfersEnabledFlag',
-      [0, true],
-      true,
-    )).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('burn_item()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.burnItem',
-      [0, 0, 100n],
-      true,
-    )).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('burn_from()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.burnTokens(alice, 100n)).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('transfer()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);
-    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);
-    await collection.transfer(alice, {Substrate: bob.address}, 100n);
-    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);
-    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);
-    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;
-    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;
-  });
-
-  itSub('transfer_from()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);
-    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);
-
-    await collection.transferFrom(alice, {Substrate: alice.address}, {Substrate: bob.address}, 100n);
-
-    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);
-    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);
-    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;
-    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;
-
-    await expect(collection.transferFrom(alice, {Substrate: bob.address}, {Substrate: alice.address}, 100n)).to.be.rejectedWith('common.NoPermission');
-  });
-
-  itSub('approve()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.approveTokens(alice, {Substrate: bob.address}, 100n)).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('approve_from()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.approveFrom',
-      [{Substrate: alice.address}, {Substrate: bob.address}, 0, 0, 100n],
-      true,
-    )).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('set_collection_limits()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.setLimits(alice, {accountTokenOwnershipLimit: 1})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('set_collection_permissions()', async ({helper}) => {
-    const collection = helper.ft.getCollectionObject(0);
-    await expect(collection.setPermissions(alice, {access: 'AllowList'})).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('repartition()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.repartition',
-      [0, 0, 100n],
-      true,
-    )).to.be.rejectedWith('unique.RepartitionCalledOnNonRefungibleCollection');
-  });
-
-  itSub('force_repair_collection()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.forceRepairCollection',
-      [0],
-      true,
-    )).to.be.rejectedWith('common.UnsupportedOperation');
-  });
-
-  itSub('force_repair_item()', async ({helper}) => {
-    await expect(helper.executeExtrinsic(
-      alice,
-      'api.tx.unique.forceRepairItem',
-      [0, 0],
-      true,
-    )).to.be.rejectedWith('BadOrigin');
-  });
-});
\ No newline at end of file
modifiedtests/src/eth/nativeFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nativeFungible.test.ts
+++ b/tests/src/eth/nativeFungible.test.ts
@@ -117,7 +117,7 @@
     expect(balanceOwnerBefore - 50n > balanceOwnerAfter).to.be.true;
     expect(balanceReceiverBefore === balanceReceiverAfter - 50n).to.be.true;
 
-    await expect(contract.methods.transferFrom(receiver, receiver, 50).call({from: owner})).to.be.rejectedWith('no permission');
+    await expect(contract.methods.transferFrom(receiver, receiver, 50).call({from: owner})).to.be.rejectedWith('ApprovedValueTooLow');
   });
 });
 
addedtests/src/nativeFungible.test.tsdiffbeforeafterboth
--- /dev/null
+++ b/tests/src/nativeFungible.test.ts
@@ -0,0 +1,219 @@
+// Copyright 2019-2023 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// 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 {IKeyringPair} from '@polkadot/types/types';
+import {expect, itSub, usingPlaygrounds} from './util';
+
+describe('Native fungible', () => {
+  let alice: IKeyringPair;
+  let bob: IKeyringPair;
+
+  before(async () => {
+    await usingPlaygrounds(async (helper, privateKey) => {
+      const donor = await privateKey({url: import.meta.url});
+      [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
+    });
+  });
+
+  itSub('destroy_collection()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.burn(alice)).to.be.rejectedWith('common.UnsupportedOperation');
+    await expect(helper.executeExtrinsic(alice, 'api.tx.unique.destroyCollection', [0])).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('add_to_allow_list()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.addToAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('remove_from_allow_list()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.removeFromAllowList(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('change_collection_owner()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.changeOwner(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('add_collection_admin()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.addAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('remove_collection_admin()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.removeAdmin(alice, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('set_collection_sponsor()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.setSponsor(alice, bob.address)).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('confirm_sponsorship()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.confirmSponsorship(alice)).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('remove_collection_sponsor()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.removeSponsor(alice)).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('create_item()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.mint(alice, 100n, {Substrate: bob.address})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('set_collection_properties()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.setProperties(alice, [{key: 'value'}])).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('delete_collection_properties()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.deleteProperties(alice, ['key'])).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('set_token_properties()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.setTokenProperties',
+      [0, 0, [{key: 'value'}]],
+      true,
+    )).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('delete_token_properties()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.deleteTokenProperties',
+      [0, 0, ['key']],
+      true,
+    )).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('set_transfers_enabled_flag()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.setTransfersEnabledFlag',
+      [0, true],
+      true,
+    )).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('burn_item()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.burnItem',
+      [0, 0, 100n],
+      true,
+    )).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('burn_from()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.burnTokens(alice, 100n)).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('transfer()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);
+    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);
+    await collection.transfer(alice, {Substrate: bob.address}, 100n);
+    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);
+    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);
+    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;
+    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;
+  });
+
+  itSub('transfer_from()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    const balanceAliceBefore = await helper.balance.getSubstrate(alice.address);
+    const balanceBobBefore = await helper.balance.getSubstrate(bob.address);
+
+    await collection.transferFrom(alice, {Substrate: alice.address}, {Substrate: bob.address}, 100n);
+
+    const balanceAliceAfter = await helper.balance.getSubstrate(alice.address);
+    const balanceBobAfter = await helper.balance.getSubstrate(bob.address);
+    expect(balanceAliceBefore - balanceAliceAfter > 100n).to.be.true;
+    expect(balanceBobAfter - balanceBobBefore === 100n).to.be.true;
+
+    await expect(collection.transferFrom(alice, {Substrate: bob.address}, {Substrate: alice.address}, 100n)).to.be.rejectedWith('common.ApprovedValueTooLow');
+  });
+
+  itSub('approve()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.approveTokens(alice, {Substrate: bob.address}, 100n)).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('approve_from()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.approveFrom',
+      [{Substrate: alice.address}, {Substrate: bob.address}, 0, 0, 100n],
+      true,
+    )).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('set_collection_limits()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.setLimits(alice, {accountTokenOwnershipLimit: 1})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('set_collection_permissions()', async ({helper}) => {
+    const collection = helper.ft.getCollectionObject(0);
+    await expect(collection.setPermissions(alice, {access: 'AllowList'})).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('repartition()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.repartition',
+      [0, 0, 100n],
+      true,
+    )).to.be.rejectedWith('unique.RepartitionCalledOnNonRefungibleCollection');
+  });
+
+  itSub('force_repair_collection()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.forceRepairCollection',
+      [0],
+      true,
+    )).to.be.rejectedWith('common.UnsupportedOperation');
+  });
+
+  itSub('force_repair_item()', async ({helper}) => {
+    await expect(helper.executeExtrinsic(
+      alice,
+      'api.tx.unique.forceRepairItem',
+      [0, 0],
+      true,
+    )).to.be.rejectedWith('BadOrigin');
+  });
+
+  itSub.only('Nest into NFT token()', async ({helper}) => {
+    const nftCollection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});
+    const targetToken = await nftCollection.mintToken(alice);
+
+    const collection = helper.ft.getCollectionObject(0);
+    await collection.transfer(alice, targetToken.nestingAccount(), 100n);
+
+    await collection.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 100n);
+  });
+});
\ No newline at end of file
modifiedtests/src/nesting/unnest.test.tsdiffbeforeafterboth
before · tests/src/nesting/unnest.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 {expect, itSub, Pallets, usingPlaygrounds} from '../util';19import {UniqueFTCollection, UniqueNFToken, UniqueRFToken} from '../util/playgrounds/unique';2021describe('Integration Test: Unnesting', () => {22  let alice: IKeyringPair;23  let bob: IKeyringPair;24  let charlie: IKeyringPair;2526  before(async () => {27    await usingPlaygrounds(async (helper, privateKey) => {28      const donor = await privateKey({url: import.meta.url});29      [alice, bob, charlie] = await helper.arrange.createAccounts([200n, 50n, 50n], donor);30    });31  });3233  itSub('NFT: allows the owner to successfully unnest a token', async ({helper}) => {34    const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});35    const targetToken = await collection.mintToken(alice);3637    // Create a nested token38    const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount());3940    // Unnest41    await expect(nestedToken.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}), 'while unnesting').to.be.fulfilled;42    expect(await nestedToken.getOwner()).to.be.deep.equal({Substrate: alice.address});4344    // Nest and burn45    await nestedToken.nest(alice, targetToken);46    await expect(nestedToken.burnFrom(alice, targetToken.nestingAccount()), 'while burning').to.be.fulfilled;47    await expect(nestedToken.getOwner()).to.be.rejected;48  });4950  itSub('Fungible: allows the owner to successfully unnest a token', async ({helper}) => {51    const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});52    const targetToken = await collection.mintToken(alice);5354    const collectionFT = await helper.ft.mintCollection(alice);5556    // Nest and unnest57    await collectionFT.mint(alice, 10n, targetToken.nestingAccount());58    await expect(collectionFT.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled;59    expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(9n);60    expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(1n);6162    // Nest and burn63    await collectionFT.transfer(alice, targetToken.nestingAccount(), 5n);64    await expect(collectionFT.burnTokensFrom(alice, targetToken.nestingAccount(), 6n), 'while burning').to.be.fulfilled;65    expect(await collectionFT.getBalance({Substrate: alice.address})).to.be.equal(4n);66    expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(0n);67    expect(await targetToken.getChildren()).to.be.length(0);68  });6970  itSub.ifWithPallets('ReFungible: allows the owner to successfully unnest a token', [Pallets.ReFungible], async ({helper}) => {71    const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});72    const targetToken = await collection.mintToken(alice);7374    const collectionRFT = await helper.rft.mintCollection(alice);7576    // Nest and unnest77    const token = await collectionRFT.mintToken(alice, 10n, targetToken.nestingAccount());78    await expect(token.transferFrom(alice, targetToken.nestingAccount(), {Substrate: alice.address}, 9n), 'while unnesting').to.be.fulfilled;79    expect(await token.getBalance({Substrate: alice.address})).to.be.equal(9n);80    expect(await token.getBalance(targetToken.nestingAccount())).to.be.equal(1n);8182    // Nest and burn83    await token.transfer(alice, targetToken.nestingAccount(), 5n);84    await expect(token.burnFrom(alice, targetToken.nestingAccount(), 6n), 'while burning').to.be.fulfilled;85    expect(await token.getBalance({Substrate: alice.address})).to.be.equal(4n);86    expect(await token.getBalance(targetToken.nestingAccount())).to.be.equal(0n);87    expect(await targetToken.getChildren()).to.be.length(0);88  });8990  async function checkNestedAmountState({91    expectedBalance,92    childrenShouldPresent,93    nested,94    targetNft,95  }: {96    expectedBalance: bigint,97    childrenShouldPresent: boolean,98    nested: UniqueFTCollection | UniqueRFToken,99    targetNft: UniqueNFToken,100  }) {101    const balance = await nested.getBalance(targetNft.nestingAccount());102    expect(balance).to.be.equal(expectedBalance);103104    const children = await targetNft.getChildren();105106    if (childrenShouldPresent) {107      expect(children[0]).to.be.deep.equal({108        collectionId: nested.collectionId,109        tokenId: (nested instanceof UniqueFTCollection) ? 0 : nested.tokenId,110      });111    } else {112      expect(children.length).to.be.equal(0);113    }114  }115116  function ownerOrAdminUnnestCases(modes: ('ft' | 'nft' | 'rft')[]): {117    mode: 'ft' | 'nft' | 'rft',118    sender: string,119    op: 'transfer' | 'burn',120    requiredPallets: Pallets[],121  }[] {122    const senders = ['owner', 'admin'];123    const ops = ['transfer', 'burn'];124125    const cases = [];126    for (const mode of modes) {127      const requiredPallets = (mode === 'rft')128        ? [Pallets.ReFungible]129        : [];130131      for (const sender of senders) {132        for (const op of ops) {133          cases.push({134            mode: mode as 'ft' | 'nft' | 'rft',135            sender,136            op: op as 'transfer' | 'burn',137            requiredPallets,138          });139        }140      }141    }142143    return cases;144  }145146  ownerOrAdminUnnestCases(['ft', 'rft']).map(testCase =>147    itSub.ifWithPallets(`[${testCase.mode}]: allows a collection ${testCase.sender} to ${testCase.op} nested token`, testCase.requiredPallets, async({helper}) => {148      const owner = alice;149      const admin = bob;150151      const unnester = (testCase.sender === 'owner')152        ? owner153        : admin;154155      const collectionNFT = await helper.nft.mintCollection(owner);156      await collectionNFT.setPermissions(owner, {nesting: {tokenOwner: true}});157158      const collectionNested = await helper[testCase.mode as 'ft' | 'rft'].mintCollection(owner, {159        limits: {160          ownerCanTransfer: true,161        },162      });163      await collectionNested.addAdmin(owner, {Substrate: admin.address});164165      const targetNft = await collectionNFT.mintToken(owner, {Substrate: charlie.address});166167      let nested: UniqueFTCollection | UniqueRFToken;168      const totalAmount = 5n;169      const firstUnnestAmount = 2n;170      const restUnnestAmount = totalAmount - firstUnnestAmount;171172      if (collectionNested instanceof UniqueFTCollection) {173        await collectionNested.mint(owner, totalAmount, {Substrate: charlie.address});174        nested = collectionNested;175      } else {176        nested = await collectionNested.mintToken(owner, totalAmount, {Substrate: charlie.address});177      }178179      // transfer/burn `amount` of nested assets by `unnester`.180      const doOperationAndCheck = async ({181        amount,182        shouldBeNestedAfterOp,183      }: {184        amount: bigint,185        shouldBeNestedAfterOp: boolean,186      }) => {187        const nestedBalanceBeforeOp = await nested.getBalance(targetNft.nestingAccount());188189        if (testCase.op === 'transfer') {190          const bobBalanceBeforeOp = await nested.getBalance({Substrate: bob.address});191192          await nested.transferFrom(unnester, targetNft.nestingAccount(), {Substrate: bob.address}, amount);193          expect(await nested.getBalance({Substrate: bob.address})).to.be.equal(bobBalanceBeforeOp + amount);194        } else {195          if (nested instanceof UniqueFTCollection) {196            await nested.burnTokensFrom(unnester, targetNft.nestingAccount(), amount);197          } else {198            await nested.burnFrom(unnester, targetNft.nestingAccount(), amount);199          }200        }201202        await checkNestedAmountState({203          expectedBalance: nestedBalanceBeforeOp - amount,204          childrenShouldPresent: shouldBeNestedAfterOp,205          nested,206          targetNft,207        });208      };209210      // Initial setup: nest (fungibles/rft parts).211      // Check NFT's balance of nested assets and NFT's children.212      await nested.transfer(charlie, targetNft.nestingAccount(), totalAmount);213      await checkNestedAmountState({214        expectedBalance: totalAmount,215        childrenShouldPresent: true,216        nested,217        targetNft,218      });219220      // Transfer/burn only a part of nested assets.221      // Check that NFT's balance of the nested assets correctly decreased and NFT's children are not changed.222      await doOperationAndCheck({223        amount: firstUnnestAmount,224        shouldBeNestedAfterOp: true,225      });226227      // Transfer/burn all remaining nested assets.228      // Check that NFT's balance of the nested assets is 0 and NFT has no more children.229      await doOperationAndCheck({230        amount: restUnnestAmount,231        shouldBeNestedAfterOp: false,232      });233    }));234235  ownerOrAdminUnnestCases(['nft']).map(testCase =>236    itSub(`[nft]: allows a collection ${testCase.sender} to ${testCase.op} nested token`, async ({helper}) => {237      const owner = alice;238      const admin = bob;239240      const unnester = (testCase.sender === 'owner')241        ? owner242        : admin;243244      const collectionNFT = await helper.nft.mintCollection(owner);245      await collectionNFT.setPermissions(owner, {nesting: {tokenOwner: true}});246247      const collectionNested = await helper.nft.mintCollection(owner, {248        limits: {249          ownerCanTransfer: true,250        },251      });252      await collectionNested.addAdmin(owner, {Substrate: admin.address});253254      const targetNft = await collectionNFT.mintToken(owner, {Substrate: charlie.address});255      const nested = await collectionNested.mintToken(owner, {Substrate: charlie.address});256257      await nested.transfer(charlie, targetNft.nestingAccount());258      expect(await targetNft.getChildren()).to.be.deep.equal([{259        collectionId: nested.collectionId,260        tokenId: nested.tokenId,261      }]);262263      if (testCase.op === 'transfer') {264        await nested.transferFrom(unnester, targetNft.nestingAccount(), {Substrate: bob.address});265      } else {266        await nested.burnFrom(unnester, targetNft.nestingAccount());267      }268269      expect((await targetNft.getChildren()).length).to.be.equal(0);270    }));271});272273describe('Negative Test: Unnesting', () => {274  let alice: IKeyringPair;275  let bob: IKeyringPair;276277  before(async () => {278    await usingPlaygrounds(async (helper, privateKey) => {279      const donor = await privateKey({url: import.meta.url});280      [alice, bob] = await helper.arrange.createAccounts([50n, 10n], donor);281    });282  });283284  itSub('Disallows a non-owner to unnest/burn a token', async ({helper}) => {285    const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});286    const targetToken = await collection.mintToken(alice);287288    // Create a nested token289    const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount());290291    // Try to unnest292    await expect(nestedToken.unnest(bob, targetToken, {Substrate: alice.address})).to.be.rejectedWith(/common\.ApprovedValueTooLow/);293    expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());294295    // Try to burn296    await expect(nestedToken.burnFrom(bob, targetToken.nestingAccount())).to.be.rejectedWith(/common\.ApprovedValueTooLow/);297    expect(await nestedToken.getOwner()).to.be.deep.equal(targetToken.nestingAccount().toLowerCase());298  });299300  // todo another test for creating excessive depth matryoshka with Ethereum?301302  // Recursive nesting303  itSub('Prevents Ouroboros creation', async ({helper}) => {304    const collection = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});305    const targetToken = await collection.mintToken(alice);306307    // Fail to create a nested token ouroboros308    const nestedToken = await collection.mintToken(alice, targetToken.nestingAccount());309    await expect(targetToken.nest(alice, nestedToken)).to.be.rejectedWith(/^structure\.OuroborosDetected$/);310  });311});
modifiedtests/src/sub/nesting/common.test.tsdiffbeforeafterboth
--- a/tests/src/sub/nesting/common.test.ts
+++ b/tests/src/sub/nesting/common.test.ts
@@ -88,6 +88,27 @@
   });
 });
 
+[
+  {restrictedMode: true},
+  {restrictedMode: false},
+].map(testCase => {
+  itSub(`Token owner can nest Native FT in NFT if "tokenOwner" permission set  ${testCase.restrictedMode ? 'in restricted mode': ''}`, async ({helper}) => {
+    // Only NFT allows nesting, permissions should be set:
+    const targetNFTCollection = await helper.nft.mintCollection(alice);
+    const targetTokenBob = await targetNFTCollection.mintToken(alice, {Substrate: bob.address});
+
+    const collectionForNesting = helper.ft.getCollectionObject(0);
+    // permissions should be set:
+    await targetNFTCollection.setPermissions(alice, {
+      nesting: {tokenOwner: true, restricted: testCase.restrictedMode ? [collectionForNesting.collectionId] : null},
+    });
+
+    // Alice can mint and nest token:
+    await collectionForNesting.transfer(bob, targetTokenBob.nestingAccount(), 50n);
+    expect(await collectionForNesting.getBalance(targetTokenBob.nestingAccount())).eq(50n);
+  });
+});
+
 
 itSub.ifWithPallets('Owner can unnest tokens using transferFrom', [Pallets.ReFungible], async ({helper}) => {
   const collectionToNest = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});
@@ -98,18 +119,22 @@
   const nftCollectionToBeNested = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});
   const rftCollectionToBeNested = await helper.rft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});
   const ftCollectionToBeNested = await helper.ft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});
+  const nativeFtCollectionToBeNested = helper.ft.getCollectionObject(0);
 
   const nestedNFT = await nftCollectionToBeNested.mintToken(alice, tokenA.nestingAccount());
   const nestedRFT = await rftCollectionToBeNested.mintToken(alice, 100n, tokenA.nestingAccount());
   const _nestedFT = await ftCollectionToBeNested.mint(alice, 100n, tokenA.nestingAccount());
+  await nativeFtCollectionToBeNested.transfer(alice, tokenA.nestingAccount(), 100n);
   expect(await nestedNFT.getOwner()).to.be.deep.equal(tokenA.nestingAccount().toLowerCase());
   expect(await nestedRFT.getOwner()).to.be.deep.equal(tokenA.nestingAccount().toLowerCase());
   expect(await ftCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(100n);
+  expect(await nativeFtCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(100n);
 
   // Transfer the nested token to another token
   await nestedNFT.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount());
   await nestedRFT.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);
   await ftCollectionToBeNested.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);
+  await nativeFtCollectionToBeNested.transferFrom(alice, tokenA.nestingAccount(), tokenB.nestingAccount(), 25n);
 
   expect(await nestedNFT.getTopmostOwner()).to.be.deep.equal({Substrate: alice.address});
   expect(await nestedNFT.getOwner()).to.be.deep.equal(tokenB.nestingAccount().toLowerCase());
@@ -119,4 +144,7 @@
 
   expect(await ftCollectionToBeNested.getBalance(tokenB.nestingAccount())).to.equal(25n);
   expect(await ftCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(75n);
+
+  expect(await nativeFtCollectionToBeNested.getBalance(tokenB.nestingAccount())).to.equal(25n);
+  expect(await nativeFtCollectionToBeNested.getBalance(tokenA.nestingAccount())).to.equal(75n);
 });
modifiedtests/src/sub/nesting/e2e.test.tsdiffbeforeafterboth
--- a/tests/src/sub/nesting/e2e.test.ts
+++ b/tests/src/sub/nesting/e2e.test.ts
@@ -32,6 +32,7 @@
     const collectionA = await helper.nft.mintCollection(alice, {permissions: {nesting: {tokenOwner: true}}});
     const collectionB = await helper.ft.mintCollection(alice);
     const collectionC = await helper.rft.mintCollection(alice);
+    const collectionD = helper.ft.getCollectionObject(0);
 
     const targetToken = await collectionA.mintToken(alice);
     expect((await targetToken.getChildren()).length).to.be.equal(0, 'Children length check at creation');
@@ -73,20 +74,31 @@
       {tokenId: tokenC.tokenId, collectionId: collectionC.collectionId},
     ]).and.has.length(3);
 
+    // Nest native fungible token into another collection
+    await collectionD.transfer(alice, targetToken.nestingAccount(), 2n);
+    expect(await targetToken.getChildren()).to.have.deep.members([
+      {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId},
+      {tokenId: 0, collectionId: collectionB.collectionId},
+      {tokenId: tokenC.tokenId, collectionId: collectionC.collectionId},
+      {tokenId: 0, collectionId: collectionD.collectionId},
+    ]).and.has.length(4);
+
     // Burn all nested pieces
     await tokenC.burnFrom(alice, targetToken.nestingAccount(), 2n);
     expect(await targetToken.getChildren()).to.have.deep.members([
       {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId},
       {tokenId: 0, collectionId: collectionB.collectionId},
+      {tokenId: 0, collectionId: collectionD.collectionId},
     ])
-      .and.has.length(2);
+      .and.has.length(3);
 
     // Move part of the fungible token inside token A deeper in the nesting tree
     await collectionB.transferFrom(alice, targetToken.nestingAccount(), tokenA.nestingAccount(), 1n);
     expect(await targetToken.getChildren()).to.be.have.deep.members([
       {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId},
       {tokenId: 0, collectionId: collectionB.collectionId},
-    ]).and.has.length(2);
+      {tokenId: 0, collectionId: collectionD.collectionId},
+    ]).and.has.length(3);
     // Nested token also has children now:
     expect(await tokenA.getChildren()).to.have.deep.members([
       {tokenId: 0, collectionId: collectionB.collectionId},
@@ -96,7 +108,8 @@
     await collectionB.transferFrom(alice, targetToken.nestingAccount(), tokenA.nestingAccount(), 1n);
     expect(await targetToken.getChildren()).to.have.deep.members([
       {tokenId: tokenA.tokenId, collectionId: collectionA.collectionId},
-    ]).and.has.length(1);
+      {tokenId: 0, collectionId: collectionD.collectionId},
+    ]).and.has.length(2);
     expect(await tokenA.getChildren()).to.have.deep.members([
       {tokenId: 0, collectionId: collectionB.collectionId},
     ]).and.has.length(1);
modifiedtests/src/sub/nesting/nesting.negative.test.tsdiffbeforeafterboth
--- a/tests/src/sub/nesting/nesting.negative.test.ts
+++ b/tests/src/sub/nesting/nesting.negative.test.ts
@@ -53,25 +53,35 @@
   });
 });
 
-itSub('Owner cannot nest FT if nesting is disabled', async ({helper}) => {
+[
+  {mode: 'ft'},
+  {mode: 'nativeFt'},
+].map(testCase => {
+  itSub(`Owner cannot nest [${testCase.mode}] if nesting is disabled`, async ({helper}) => {
   // Create default collection, permissions are not set:
-  const aliceNFTCollection = await helper.nft.mintCollection(alice);
-  const targetToken = await aliceNFTCollection.mintToken(alice);
+    const aliceNFTCollection = await helper.nft.mintCollection(alice);
+    const targetToken = await aliceNFTCollection.mintToken(alice);
 
-  const collectionForNesting = await helper.ft.mintCollection(alice);
+    const collectionForNesting = testCase.mode === 'ft' ? await helper.ft.mintCollection(alice) : helper.ft.getCollectionObject(0);
 
-  // 1. Alice cannot create immediately nested tokens:
-  await expect(collectionForNesting.mint(alice, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest');
+    // Alice cannot create immediately nested tokens:
+    await expect(testCase.mode === 'ft'
+      ? collectionForNesting.mint(alice, 100n, targetToken.nestingAccount())
+      : collectionForNesting.transfer(alice, targetToken.nestingAccount(), 100n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');
 
-  // 2. Alice can mint and nest token:
-  await collectionForNesting.mint(alice, 100n);
-  await expect(collectionForNesting.transfer(alice, targetToken.nestingAccount(), 50n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');
+    // Alice can mint and nest token:
+    if (testCase.mode === 'ft') {
+      await collectionForNesting.mint(alice, 100n);
+    }
+    await expect(collectionForNesting.transfer(alice, targetToken.nestingAccount(), 50n)).to.be.rejectedWith('common.UserIsNotAllowedToNest');
+  });
 });
 
 [
   {mode: 'nft' as const},
   {mode: 'rft' as const},
   {mode: 'ft' as const},
+  {mode: 'native ft' as const},
 ].map(testCase => {
   itSub(`Non-owner and non-admin cannot nest ${testCase.mode.toUpperCase()} in someone else's tokens`, async ({helper}) => {
     const targetCollection = await helper.nft.mintCollection(alice, {permissions:
@@ -79,13 +89,18 @@
     });
     const targetToken = await targetCollection.mintToken(alice);
 
-    const nestedCollectionBob = await helper[testCase.mode].mintCollection(bob);
+    const nestedCollectionBob = await (
+      testCase.mode === 'native ft'
+        ? helper.ft.getCollectionObject(0)
+        : helper[testCase.mode].mintCollection(bob)
+    );
 
     let nestedTokenBob: UniqueNFToken | UniqueRFToken;
     switch (testCase.mode) {
       case 'nft': nestedTokenBob = await (nestedCollectionBob as UniqueNFTCollection).mintToken(bob); break;
       case 'rft': nestedTokenBob = await (nestedCollectionBob as UniqueRFTCollection).mintToken(bob, 100n); break;
       case 'ft': await (nestedCollectionBob as UniqueFTCollection).mint(bob, 100n); break;
+      case 'native ft': break;
     }
 
     // Bob non-owner of targetToken and non admin of targetCollection, so
@@ -94,6 +109,7 @@
       case 'nft': await expect((nestedCollectionBob as UniqueNFTCollection).mintToken(bob, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
       case 'rft': await expect((nestedCollectionBob as UniqueRFTCollection).mintToken(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
       case 'ft': await expect((nestedCollectionBob as UniqueFTCollection).mint(bob, 100n, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
+      case 'native ft': break;
     }
 
     // 2. cannot nest existing token:
@@ -101,6 +117,7 @@
       case 'nft':
       case 'rft': await expect(nestedTokenBob!.transfer(bob, targetToken.nestingAccount())).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
       case 'ft': await expect((nestedCollectionBob as UniqueFTCollection).transfer(bob, targetToken.nestingAccount(), 100n)).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
+      case 'native ft': await expect((nestedCollectionBob as UniqueFTCollection).transfer(bob, targetToken.nestingAccount(), 100n)).to.be.rejectedWith('common.UserIsNotAllowedToNest'); break;
     }
   });
 });
@@ -140,6 +157,7 @@
   const nftCollectionForNesting = await helper.nft.mintCollection(alice);
   const rftCollectionForNesting = await helper.rft.mintCollection(alice);
   const ftCollectionForNesting = await helper.ft.mintCollection(alice);
+  const nativeFtCollectionForNesting = helper.ft.getCollectionObject(0);
 
   const testCases = [
     {token: tokenFromNonExistingCollection, error: 'CollectionNotFound'},
@@ -160,6 +178,7 @@
     await expect(nft.transfer(alice, testCase.token.nestingAccount())).to.be.rejectedWith(testCase.error);
     await expect(rft.transfer(alice, testCase.token.nestingAccount())).to.be.rejectedWith(testCase.error);
     await expect(ftCollectionForNesting.transfer(alice, testCase.token.nestingAccount(), 50n)).to.be.rejectedWith(testCase.error);
+    await expect(nativeFtCollectionForNesting.transfer(alice, testCase.token.nestingAccount(), 50n)).to.be.rejectedWith(testCase.error);
   }
 });
 
@@ -184,6 +203,7 @@
   // Create default collection, permissions are not set:
   const rftCollection = await helper.rft.mintCollection(alice);
   const ftCollection = await helper.ft.mintCollection(alice);
+  const nativeFtCollection = helper.ft.getCollectionObject(0);
 
   const rftToken = await rftCollection.mintToken(alice);
   const _ftToken = await ftCollection.mint(alice, 100n);
@@ -193,11 +213,13 @@
   // 1. Alice cannot create immediately nested tokens:
   await expect(collectionForNesting.mintToken(alice, rftToken.nestingAccount())).to.be.rejectedWith('refungible.RefungibleDisallowsNesting');
   await expect(collectionForNesting.mintToken(alice, {Ethereum: helper.ethAddress.fromTokenId(ftCollection.collectionId, 0)})).to.be.rejectedWith('fungible.FungibleDisallowsNesting');
+  await expect(collectionForNesting.mintToken(alice, {Ethereum: helper.ethAddress.fromTokenId(nativeFtCollection.collectionId, 0)})).to.be.rejectedWith('common.UnsupportedOperation');
 
   // 2. Alice cannot mint and nest token:
   const nestedToken2 = await collectionForNesting.mintToken(alice);
   await expect(nestedToken2.nest(alice, rftToken)).to.be.rejectedWith('refungible.RefungibleDisallowsNesting');
   await expect(ftCollection.transfer(alice, {Ethereum: helper.ethAddress.fromTokenId(ftCollection.collectionId, 0)})).to.be.rejectedWith('fungible.FungibleDisallowsNesting');
+  await expect(nativeFtCollection.transfer(alice, {Ethereum: helper.ethAddress.fromTokenId(nativeFtCollection.collectionId, 0)})).to.be.rejectedWith('common.UnsupportedOperation');
 });
 
 itSub('Cannot nest in restricted collection if collection is not in the list', async ({helper}) => {
@@ -205,6 +227,7 @@
   const notAllowedCollectionNFT = await helper.nft.mintCollection(alice);
   const notAllowedCollectionRFT = await helper.rft.mintCollection(alice);
   const notAllowedCollectionFT = await helper.ft.mintCollection(alice);
+  const notAllowedCollectionNativeFT = helper.ft.getCollectionObject(0);
 
   // Collection restricted to allowedCollectionId
   const restrictedCollectionA = await helper.nft.mintCollection(alice, {permissions:
@@ -229,6 +252,8 @@
   await expect(notAllowedCollectionRFT.mintToken(alice, 100n, targetTokenB.nestingAccount())).to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);
   await expect(notAllowedCollectionFT.mint(alice, 100n, targetTokenA.nestingAccount())).to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);
   await expect(notAllowedCollectionFT.mint(alice, 100n, targetTokenB.nestingAccount())).to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);
+  await expect(notAllowedCollectionNativeFT.transfer(alice, targetTokenA.nestingAccount(), 100n)).to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);
+  await expect(notAllowedCollectionNativeFT.transfer(alice, targetTokenB.nestingAccount(), 100n)).to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);
 });
 
 itSub('Cannot create nesting chains greater than 5', async ({helper}) => {
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
@@ -52,12 +52,19 @@
   });
 
   [
-    {restrictedMode: true},
-    {restrictedMode: false},
+    {mode: 'ft' as const},
+    {mode: 'native ft' as const},
+  ].map(md => [
+    {mode: md.mode, restrictedMode: true},
+    {mode: md.mode, restrictedMode: false},
   ].map(testCase => {
-    itSub(`Fungible: disallows a non-Owner to unnest someone else's token ${testCase.restrictedMode ? '(Restricted nesting)' : ''}`, async ({helper}) => {
+    itSub.only(`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 helper.ft.mintCollection(alice);
+      const collectionFT = await (
+        testCase.mode === 'ft'
+          ? helper.ft.mintCollection(alice)
+          : helper.ft.getCollectionObject(0)
+      );
       const targetToken = await collectionNFT.mintToken(alice, {Substrate: bob.address});
 
       await collectionNFT.setPermissions(alice, {nesting: {
@@ -65,12 +72,16 @@
       }});
 
       // Nest some tokens as Alice into Bob's token
-      await collectionFT.mint(alice, 5n, targetToken.nestingAccount());
+      await (
+        testCase.mode === 'ft'
+          ? collectionFT.mint(alice, 5n, targetToken.nestingAccount())
+          : collectionFT.transfer(alice, targetToken.nestingAccount(), 5n)
+      );
 
       // Try to pull it out as Alice still
       await expect(collectionFT.transferFrom(alice, targetToken.nestingAccount(), {Substrate: bob.address}, 1n))
         .to.be.rejectedWith(/common\.ApprovedValueTooLow/);
       expect(await collectionFT.getBalance(targetToken.nestingAccount())).to.be.equal(5n);
     });
-  });
+  }));
 });