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

difftreelog

fix tests and weights

Trubnikov Sergey2023-04-28parent: #9e5de5c.patch.diff
in: master

16 files changed

modifiedpallets/balances-adapter/src/erc.rsdiffbeforeafterboth
--- a/pallets/balances-adapter/src/erc.rs
+++ b/pallets/balances-adapter/src/erc.rs
@@ -1,6 +1,7 @@
-use crate::{Config, NativeFungibleHandle};
+use crate::{Config, NativeFungibleHandle, SelfWeightOf};
 use evm_coder::{abi::AbiType, ToLog, generate_stubgen, solidity_interface, types::*};
 use frame_support::traits::{Currency, ExistenceRequirement};
+use pallet_balances::WeightInfo;
 use pallet_common::{
 	erc::{CommonEvmHandler, CrossAccountId, PrecompileHandle, PrecompileResult},
 	eth::CrossAddress,
@@ -73,7 +74,7 @@
 		Ok(total.into())
 	}
 
-	// #[weight(<SelfWeightOf<T>>::transfer())]
+	#[weight(<SelfWeightOf<T>>::transfer())]
 	fn transfer(&mut self, caller: Caller, to: Address, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = T::CrossAccountId::from_eth(to);
@@ -93,7 +94,7 @@
 		Ok(true)
 	}
 
-	// #[weight(<SelfWeightOf<T>>::transfer_from())]
+	#[weight(<SelfWeightOf<T>>::transfer())]
 	fn transfer_from(
 		&mut self,
 		caller: Caller,
@@ -138,7 +139,7 @@
 		Ok(balance.into())
 	}
 
-	// #[weight(<SelfWeightOf<T>>::transfer())]
+	#[weight(<SelfWeightOf<T>>::transfer())]
 	fn transfer_cross(&mut self, caller: Caller, to: CrossAddress, amount: U256) -> Result<bool> {
 		let caller = T::CrossAccountId::from_eth(caller);
 		let to = to.into_sub_cross_account::<T>()?;
@@ -158,7 +159,7 @@
 		Ok(true)
 	}
 
-	// #[weight(<SelfWeightOf<T>>::transfer_from())]
+	#[weight(<SelfWeightOf<T>>::transfer())]
 	fn transfer_from_cross(
 		&mut self,
 		caller: Caller,
modifiedpallets/balances-adapter/src/lib.rsdiffbeforeafterboth
--- a/pallets/balances-adapter/src/lib.rs
+++ b/pallets/balances-adapter/src/lib.rs
@@ -11,6 +11,8 @@
 pub mod common;
 pub mod erc;
 
+pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;
+
 pub struct NativeFungibleHandle<T: Config>(SubstrateRecorder<T>);
 impl<T: Config> NativeFungibleHandle<T> {
 	pub fn new() -> NativeFungibleHandle<T> {
@@ -34,6 +36,7 @@
 pub mod pallet {
 	use alloc::string::String;
 	use frame_support::{traits::Get, sp_runtime::DispatchResult};
+	use pallet_balances::WeightInfo;
 	use sp_core::U256;
 
 	#[pallet::config]
@@ -49,6 +52,8 @@
 		type Decimals: Get<u8>;
 		type Name: Get<String>;
 		type Symbol: Get<String>;
+
+		type WeightInfo: WeightInfo;
 	}
 	#[pallet::pallet]
 	pub struct Pallet<T>(_);
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -94,6 +94,7 @@
 	type Decimals = Decimals;
 	type Name = Name;
 	type Symbol = Symbol;
+	type WeightInfo = pallet_balances::weights::SubstrateWeight<Self>;
 }
 
 parameter_types! {
modifiedtests/src/addCollectionAdmin.test.tsdiffbeforeafterboth
--- a/tests/src/addCollectionAdmin.test.ts
+++ b/tests/src/addCollectionAdmin.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {itSub, usingPlaygrounds, expect} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test addCollectionAdmin(collection_id, new_admin_id):', () => {
   let donor: IKeyringPair;
@@ -82,7 +83,7 @@
 
   itSub("Can't add collection admin of not existing collection.", async ({helper}) => {
     const [alice, bob] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
-    const collectionId = (1 << 32) - 1;
+    const collectionId = NON_EXISTENT_COLLECTION_ID;
 
     await expect(helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address})).to.be.rejectedWith(/common\.CollectionNotFound/);
 
modifiedtests/src/allowLists.test.tsdiffbeforeafterboth
--- a/tests/src/allowLists.test.ts
+++ b/tests/src/allowLists.test.ts
@@ -16,7 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {usingPlaygrounds, expect, itSub} from './util';
-import {ICollectionPermissions} from './util/playgrounds/types';
+import {ICollectionPermissions, NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test ext. Allow list tests', () => {
   let alice: IKeyringPair;
@@ -60,7 +60,7 @@
 
   describe('Negative', () => {
     itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => {
-      const collectionId = (1<<32) - 1;
+      const collectionId = NON_EXISTENT_COLLECTION_ID;
       await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}))
         .to.be.rejectedWith(/common\.CollectionNotFound/);
     });
@@ -140,7 +140,7 @@
     });
 
     itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => {
-      const collectionId = (1<<32) - 1;
+      const collectionId = NON_EXISTENT_COLLECTION_ID;
       await expect(helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}))
         .to.be.rejectedWith(/common\.CollectionNotFound/);
     });
modifiedtests/src/change-collection-owner.test.tsdiffbeforeafterboth
--- a/tests/src/change-collection-owner.test.ts
+++ b/tests/src/change-collection-owner.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {usingPlaygrounds, expect, itSub} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test changeCollectionOwner(collection_id, new_owner):', () => {
   let alice: IKeyringPair;
@@ -127,7 +128,7 @@
   });
 
   itSub('Can\'t change owner of a non-existing collection.', async ({helper}) => {
-    const collectionId = (1 << 32) - 1;
+    const collectionId = NON_EXISTENT_COLLECTION_ID;
     const changeOwnerTx = () => helper.collection.changeOwner(bob, collectionId, bob.address);
     await expect(changeOwnerTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
   });
modifiedtests/src/confirmSponsorship.test.tsdiffbeforeafterboth
--- a/tests/src/confirmSponsorship.test.ts
+++ b/tests/src/confirmSponsorship.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {usingPlaygrounds, expect, itSub, Pallets} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 async function setSponsorHelper(collection: any, signer: IKeyringPair, sponsorAddress: string) {
   await collection.setSponsor(signer, sponsorAddress);
@@ -198,7 +199,7 @@
   });
 
   itSub('(!negative test!) Confirm sponsorship for a collection that never existed', async ({helper}) => {
-    const collectionId = (1 << 32) - 1;
+    const collectionId = NON_EXISTENT_COLLECTION_ID;
     const confirmSponsorshipTx = () => helper.collection.confirmSponsorship(bob, collectionId);
     await expect(confirmSponsorshipTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
   });
modifiedtests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth
--- a/tests/src/eth/util/playgrounds/types.ts
+++ b/tests/src/eth/util/playgrounds/types.ts
@@ -48,5 +48,3 @@
   field: CollectionLimitField,
   value: OptionUint,
 }
-
-export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;
\ No newline at end of file
modifiedtests/src/removeCollectionAdmin.test.tsdiffbeforeafterboth
--- a/tests/src/removeCollectionAdmin.test.ts
+++ b/tests/src/removeCollectionAdmin.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {itSub, usingPlaygrounds, expect} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test removeCollectionAdmin(collection_id, account_id):', () => {
   let alice: IKeyringPair;
@@ -68,7 +69,7 @@
   });
 
   itSub('Can\'t remove collection admin from not existing collection', async ({helper}) => {
-    const collectionId = (1 << 32) - 1;
+    const collectionId = NON_EXISTENT_COLLECTION_ID;
 
     await expect(helper.collection.removeAdmin(alice, collectionId, {Substrate: bob.address}))
       .to.be.rejectedWith(/common\.CollectionNotFound/);
modifiedtests/src/removeCollectionSponsor.test.tsdiffbeforeafterboth
before · tests/src/removeCollectionSponsor.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 {itSub, usingPlaygrounds, expect} from './util';1920describe('integration test: ext. removeCollectionSponsor():', () => {21  let donor: IKeyringPair;22  let alice: IKeyringPair;23  let bob: IKeyringPair;24  let charlie: IKeyringPair;2526  before(async () => {27    await usingPlaygrounds(async (helper, privateKey) => {28      donor = await privateKey({url: import.meta.url});29      [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor);30    });31  });3233  itSub('Removing NFT collection sponsor stops sponsorship', async ({helper}) => {34    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-1', tokenPrefix: 'RCS'});35    await collection.setSponsor(alice, bob.address);36    await collection.confirmSponsorship(bob);37    await collection.removeSponsor(alice);3839    // Find unused address40    const [zeroBalance] = await helper.arrange.createAccounts([0n], donor);4142    // Mint token for unused address43    const token = await collection.mintToken(alice, {Substrate: zeroBalance.address});4445    // Transfer this tokens from unused address to Alice - should fail46    const sponsorBalanceBefore = await helper.balance.getSubstrate(bob.address);47    await expect(token.transfer(zeroBalance, {Substrate: alice.address}))48      .to.be.rejectedWith('Inability to pay some fees');49    const sponsorBalanceAfter = await helper.balance.getSubstrate(bob.address);5051    expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore);52  });5354  itSub('Remove a sponsor after it was already removed', async ({helper}) => {55    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-2', tokenPrefix: 'RCS'});56    await collection.setSponsor(alice, bob.address);57    await collection.confirmSponsorship(bob);58    await expect(collection.removeSponsor(alice)).to.not.be.rejected;59    await expect(collection.removeSponsor(alice)).to.not.be.rejected;60  });6162  itSub('Remove sponsor in a collection that never had the sponsor set', async ({helper}) => {63    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-3', tokenPrefix: 'RCS'});64    await expect(collection.removeSponsor(alice)).to.not.be.rejected;65  });6667  itSub('Remove sponsor for a collection that had the sponsor set, but not confirmed', async ({helper}) => {68    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-4', tokenPrefix: 'RCS'});69    await collection.setSponsor(alice, bob.address);70    await expect(collection.removeSponsor(alice)).to.not.be.rejected;71  });7273  itSub('Remove a sponsor from a collection with collection admin permissions', async ({helper}) => {74    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-1', tokenPrefix: 'RCS'});75    await collection.setSponsor(alice, bob.address);76    await collection.addAdmin(alice, {Substrate: charlie.address});77    await expect(collection.removeSponsor(charlie)).not.to.be.rejected;78  });79});8081describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {82  let alice: IKeyringPair;83  let bob: IKeyringPair;84  let charlie: IKeyringPair;8586  before(async () => {87    await usingPlaygrounds(async (helper, privateKey) => {88      const donor = await privateKey({url: import.meta.url});89      [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor);90    });91  });9293  itSub('(!negative test!) Remove sponsor for a collection that never existed', async ({helper}) => {94    const collectionId = (1 << 32) - 1;95    await expect(helper.collection.removeSponsor(alice, collectionId)).to.be.rejectedWith(/common\.CollectionNotFound/);96  });9798  itSub('(!negative test!) Remove sponsor for a collection by regular user', async ({helper}) => {99    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-2', tokenPrefix: 'RCS'});100    await collection.setSponsor(alice, bob.address);101    await expect(collection.removeSponsor(charlie)).to.be.rejectedWith(/common\.NoPermission/);102  });103104  itSub('(!negative test!) Remove sponsor in a destroyed collection', async ({helper}) => {105    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-3', tokenPrefix: 'RCS'});106    await collection.setSponsor(alice, bob.address);107    await collection.burn(alice);108    await expect(collection.removeSponsor(alice)).to.be.rejectedWith(/common\.CollectionNotFound/);109  });110111  itSub('Set - remove - confirm: fails', async ({helper}) => {112    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-4', tokenPrefix: 'RCS'});113    await collection.setSponsor(alice, bob.address);114    await collection.removeSponsor(alice);115    await expect(collection.confirmSponsorship(bob)).to.be.rejectedWith(/common\.ConfirmSponsorshipFail/);116  });117118  itSub('Set - confirm - remove - confirm: Sponsor cannot come back', async ({helper}) => {119    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-5', tokenPrefix: 'RCS'});120    await collection.setSponsor(alice, bob.address);121    await collection.confirmSponsorship(bob);122    await collection.removeSponsor(alice);123    await expect(collection.confirmSponsorship(bob)).to.be.rejectedWith(/common\.ConfirmSponsorshipFail/);124  });125});
after · tests/src/removeCollectionSponsor.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 {itSub, usingPlaygrounds, expect} from './util';19import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';2021describe('integration test: ext. removeCollectionSponsor():', () => {22  let donor: IKeyringPair;23  let alice: IKeyringPair;24  let bob: IKeyringPair;25  let charlie: IKeyringPair;2627  before(async () => {28    await usingPlaygrounds(async (helper, privateKey) => {29      donor = await privateKey({url: import.meta.url});30      [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor);31    });32  });3334  itSub('Removing NFT collection sponsor stops sponsorship', async ({helper}) => {35    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-1', tokenPrefix: 'RCS'});36    await collection.setSponsor(alice, bob.address);37    await collection.confirmSponsorship(bob);38    await collection.removeSponsor(alice);3940    // Find unused address41    const [zeroBalance] = await helper.arrange.createAccounts([0n], donor);4243    // Mint token for unused address44    const token = await collection.mintToken(alice, {Substrate: zeroBalance.address});4546    // Transfer this tokens from unused address to Alice - should fail47    const sponsorBalanceBefore = await helper.balance.getSubstrate(bob.address);48    await expect(token.transfer(zeroBalance, {Substrate: alice.address}))49      .to.be.rejectedWith('Inability to pay some fees');50    const sponsorBalanceAfter = await helper.balance.getSubstrate(bob.address);5152    expect(sponsorBalanceAfter).to.be.equal(sponsorBalanceBefore);53  });5455  itSub('Remove a sponsor after it was already removed', async ({helper}) => {56    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-2', tokenPrefix: 'RCS'});57    await collection.setSponsor(alice, bob.address);58    await collection.confirmSponsorship(bob);59    await expect(collection.removeSponsor(alice)).to.not.be.rejected;60    await expect(collection.removeSponsor(alice)).to.not.be.rejected;61  });6263  itSub('Remove sponsor in a collection that never had the sponsor set', async ({helper}) => {64    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-3', tokenPrefix: 'RCS'});65    await expect(collection.removeSponsor(alice)).to.not.be.rejected;66  });6768  itSub('Remove sponsor for a collection that had the sponsor set, but not confirmed', async ({helper}) => {69    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-4', tokenPrefix: 'RCS'});70    await collection.setSponsor(alice, bob.address);71    await expect(collection.removeSponsor(alice)).to.not.be.rejected;72  });7374  itSub('Remove a sponsor from a collection with collection admin permissions', async ({helper}) => {75    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-1', tokenPrefix: 'RCS'});76    await collection.setSponsor(alice, bob.address);77    await collection.addAdmin(alice, {Substrate: charlie.address});78    await expect(collection.removeSponsor(charlie)).not.to.be.rejected;79  });80});8182describe('(!negative test!) integration test: ext. removeCollectionSponsor():', () => {83  let alice: IKeyringPair;84  let bob: IKeyringPair;85  let charlie: IKeyringPair;8687  before(async () => {88    await usingPlaygrounds(async (helper, privateKey) => {89      const donor = await privateKey({url: import.meta.url});90      [alice, bob, charlie] = await helper.arrange.createAccounts([20n, 10n, 10n], donor);91    });92  });9394  itSub('(!negative test!) Remove sponsor for a collection that never existed', async ({helper}) => {95    const collectionId = NON_EXISTENT_COLLECTION_ID;96    await expect(helper.collection.removeSponsor(alice, collectionId)).to.be.rejectedWith(/common\.CollectionNotFound/);97  });9899  itSub('(!negative test!) Remove sponsor for a collection by regular user', async ({helper}) => {100    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-2', tokenPrefix: 'RCS'});101    await collection.setSponsor(alice, bob.address);102    await expect(collection.removeSponsor(charlie)).to.be.rejectedWith(/common\.NoPermission/);103  });104105  itSub('(!negative test!) Remove sponsor in a destroyed collection', async ({helper}) => {106    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-3', tokenPrefix: 'RCS'});107    await collection.setSponsor(alice, bob.address);108    await collection.burn(alice);109    await expect(collection.removeSponsor(alice)).to.be.rejectedWith(/common\.CollectionNotFound/);110  });111112  itSub('Set - remove - confirm: fails', async ({helper}) => {113    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-4', tokenPrefix: 'RCS'});114    await collection.setSponsor(alice, bob.address);115    await collection.removeSponsor(alice);116    await expect(collection.confirmSponsorship(bob)).to.be.rejectedWith(/common\.ConfirmSponsorshipFail/);117  });118119  itSub('Set - confirm - remove - confirm: Sponsor cannot come back', async ({helper}) => {120    const collection = await helper.nft.mintCollection(alice, {name: 'RemoveCollectionSponsor-Neg-5', tokenPrefix: 'RCS'});121    await collection.setSponsor(alice, bob.address);122    await collection.confirmSponsorship(bob);123    await collection.removeSponsor(alice);124    await expect(collection.confirmSponsorship(bob)).to.be.rejectedWith(/common\.ConfirmSponsorshipFail/);125  });126});
modifiedtests/src/setCollectionLimits.test.tsdiffbeforeafterboth
--- a/tests/src/setCollectionLimits.test.ts
+++ b/tests/src/setCollectionLimits.test.ts
@@ -17,6 +17,7 @@
 // https://unique-network.readthedocs.io/en/latest/jsapi.html#setchainlimits
 import {IKeyringPair} from '@polkadot/types/types';
 import {itSub, usingPlaygrounds, expect} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 const accountTokenOwnershipLimit = 0;
 const sponsoredDataSize = 0;
@@ -110,7 +111,7 @@
   });
 
   itSub('execute setCollectionLimits for not exists collection', async ({helper}) => {
-    const nonExistentCollectionId = (1 << 32) - 1;
+    const nonExistentCollectionId = NON_EXISTENT_COLLECTION_ID;
     await expect(helper.collection.setLimits(
       alice,
       nonExistentCollectionId,
modifiedtests/src/setCollectionSponsor.test.tsdiffbeforeafterboth
--- a/tests/src/setCollectionSponsor.test.ts
+++ b/tests/src/setCollectionSponsor.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {itSub, usingPlaygrounds, expect, Pallets} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('integration test: ext. setCollectionSponsor():', () => {
   let alice: IKeyringPair;
@@ -105,7 +106,7 @@
   });
 
   itSub('(!negative test!) Add sponsor to a collection that never existed', async ({helper}) => {
-    const collectionId = (1 << 32) - 1;
+    const collectionId = NON_EXISTENT_COLLECTION_ID;
     await expect(helper.collection.setSponsor(alice, collectionId, bob.address))
       .to.be.rejectedWith(/common\.CollectionNotFound/);
   });
modifiedtests/src/setPermissions.test.tsdiffbeforeafterboth
--- a/tests/src/setPermissions.test.ts
+++ b/tests/src/setPermissions.test.ts
@@ -16,6 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {itSub, usingPlaygrounds, expect} from './util';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test: Set Permissions', () => {
   let alice: IKeyringPair;
@@ -85,7 +86,7 @@
   });
 
   itSub('fails on not existing collection', async ({helper}) => {
-    const collectionId = (1 << 32) - 1;
+    const collectionId = NON_EXISTENT_COLLECTION_ID;
     await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}))
       .to.be.rejectedWith(/common\.CollectionNotFound/);
   });
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -17,7 +17,7 @@
 import {IKeyringPair} from '@polkadot/types/types';
 import {itEth, usingEthPlaygrounds} from './eth/util';
 import {itSub, Pallets, usingPlaygrounds, expect} from './util';
-import {NON_EXISTENT_COLLECTION_ID} from './eth/util/playgrounds/types';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test Transfer(recipient, collection_id, item_id, value)', () => {
   let donor: IKeyringPair;
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- a/tests/src/transferFrom.test.ts
+++ b/tests/src/transferFrom.test.ts
@@ -16,7 +16,7 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 import {itSub, Pallets, usingPlaygrounds, expect} from './util';
-import {NON_EXISTENT_COLLECTION_ID} from './eth/util/playgrounds/types';
+import {NON_EXISTENT_COLLECTION_ID} from './util/playgrounds/types';
 
 describe('Integration Test transferFrom(from, recipient, collection_id, item_id, value):', () => {
   let alice: IKeyringPair;
modifiedtests/src/util/playgrounds/types.tsdiffbeforeafterboth
--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -3,6 +3,8 @@
 
 import {IKeyringPair} from '@polkadot/types/types';
 
+export const NON_EXISTENT_COLLECTION_ID = 4_294_967_295;
+
 export interface IEvent {
   section: string;
   method: string;