git.delta.rocks / unique-network / refs/commits / 55d2f5bff434

difftreelog

Style update

str-mv2021-08-31parent: #8057bdd.patch.diff
in: master

6 files changed

modifiedpallets/nft/src/mock.rsdiffbeforeafterboth
before · pallets/nft/src/mock.rs
1#![allow(clippy::from_over_into)]23use crate as pallet_template;4use sp_core::H256;5use frame_support::{parameter_types, weights::IdentityFee};6use sp_runtime::{7	traits::{BlakeTwo256, IdentityLookup},8	testing::Header,9};10use pallet_transaction_payment::{CurrencyAdapter};11use frame_system as system;12use pallet_evm::AddressMapping;13use crate::{EvmBackwardsAddressMapping, CrossAccountId};14use codec::{Encode, Decode};1516type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;17type Block = frame_system::mocking::MockBlock<Test>;1819// Configure a mock runtime to test the pallet.20frame_support::construct_runtime!(21	pub enum Test where22		Block = Block,23		NodeBlock = Block,24		UncheckedExtrinsic = UncheckedExtrinsic,25	{26		System: frame_system::{Pallet, Call, Config, Storage, Event<T>},27		TemplateModule: pallet_template::{Pallet, Call, Storage},28		Balances: pallet_balances::{Pallet, Call, Storage},29	}30);3132parameter_types! {33	pub const BlockHashCount: u64 = 250;34	pub const SS58Prefix: u8 = 42;35}3637impl system::Config for Test {38	type BaseCallFilter = ();39	type BlockWeights = ();40	type BlockLength = ();41	type DbWeight = ();42	type Origin = Origin;43	type Call = Call;44	type Index = u64;45	type BlockNumber = u64;46	type Hash = H256;47	type Hashing = BlakeTwo256;48	type AccountId = u64;49	type Lookup = IdentityLookup<Self::AccountId>;50	type Header = Header;51	type Event = ();52	type BlockHashCount = BlockHashCount;53	type Version = ();54	type PalletInfo = PalletInfo;55	type AccountData = pallet_balances::AccountData<u64>;56	type OnNewAccount = ();57	type OnKilledAccount = ();58	type SystemWeightInfo = ();59	type SS58Prefix = SS58Prefix;60	type OnSetCode = ();61}6263parameter_types! {64	pub const ExistentialDeposit: u64 = 1;65	pub const MaxLocks: u32 = 50;66}67//frame_system::Module<Test>;68impl pallet_balances::Config for Test {69	type AccountStore = System;70	type Balance = u64;71	type DustRemoval = ();72	type Event = ();73	type ExistentialDeposit = ExistentialDeposit;74	type WeightInfo = ();75	type MaxLocks = MaxLocks;76	type MaxReserves = ();77	type ReserveIdentifier = [u8; 8];78}7980parameter_types! {81	pub const TransactionByteFee: u64 = 1;82}8384impl pallet_transaction_payment::Config for Test {85	type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;86	type TransactionByteFee = TransactionByteFee;87	type WeightToFee = IdentityFee<u64>;88	type FeeMultiplierUpdate = ();89}9091parameter_types! {92	pub const MinimumPeriod: u64 = 1;93}94impl pallet_timestamp::Config for Test {95	type Moment = u64;96	type OnTimestampSet = ();97	type MinimumPeriod = MinimumPeriod;98	type WeightInfo = ();99}100101<<<<<<< HEAD102type Timestamp = pallet_timestamp::Pallet<Test>;103type Randomness = pallet_randomness_collective_flip::Pallet<Test>;104105=======106>>>>>>> origin/develop107parameter_types! {108	pub const CollectionCreationPrice: u32 = 0;109	pub TreasuryAccountId: u64 = 1234;110	pub EthereumChainId: u32 = 1111;111}112113pub struct TestEvmAddressMapping;114impl AddressMapping<u64> for TestEvmAddressMapping {115	fn into_account_id(_addr: sp_core::H160) -> u64 {116		unimplemented!()117	}118}119120pub struct TestEvmBackwardsAddressMapping;121impl EvmBackwardsAddressMapping<u64> for TestEvmBackwardsAddressMapping {122	fn from_account_id(_account_id: u64) -> sp_core::H160 {123		unimplemented!()124	}125}126127#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]128pub struct TestCrossAccountId(u64, sp_core::H160);129impl CrossAccountId<u64> for TestCrossAccountId {130	fn from_sub(sub: u64) -> Self {131		let mut eth = [0; 20];132		eth[12..20].copy_from_slice(&sub.to_be_bytes());133		Self(sub, sp_core::H160(eth))134	}135	fn as_sub(&self) -> &u64 {136		&self.0137	}138	fn from_eth(eth: sp_core::H160) -> Self {139		let mut sub_raw = [0; 8];140		sub_raw.copy_from_slice(&eth.0[0..8]);141		let sub = u64::from_be_bytes(sub_raw);142		Self(sub, eth)143	}144	fn as_eth(&self) -> &sp_core::H160 {145		&self.1146	}147}148149pub struct TestEtheremTransactionSender;150impl pallet_ethereum::EthereumTransactionSender for TestEtheremTransactionSender {151	fn submit_logs_transaction(152		_tx: pallet_ethereum::Transaction,153		_logs: Vec<pallet_ethereum::Log>,154	) -> Result<(), sp_runtime::DispatchError> {155		Ok(())156	}157}158159impl pallet_evm_coder_substrate::Config for Test {160	type EthereumTransactionSender = TestEtheremTransactionSender;161}162163impl pallet_template::Config for Test {164	type Event = ();165	type WeightInfo = ();166	type CollectionCreationPrice = CollectionCreationPrice;167	type Currency = pallet_balances::Pallet<Test>;168	type TreasuryAccountId = TreasuryAccountId;169	type EvmAddressMapping = TestEvmAddressMapping;170	type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;171	type CrossAccountId = TestCrossAccountId;172}173174// Build genesis storage according to the mock runtime.175pub fn new_test_ext() -> sp_io::TestExternalities {176	system::GenesisConfig::default()177		.build_storage::<Test>()178		.unwrap()179		.into()180}
after · pallets/nft/src/mock.rs
1#![allow(clippy::from_over_into)]23use crate as pallet_template;4use sp_core::H256;5use frame_support::{parameter_types, weights::IdentityFee};6use sp_runtime::{7	traits::{BlakeTwo256, IdentityLookup},8	testing::Header,9};10use pallet_transaction_payment::{CurrencyAdapter};11use frame_system as system;12use pallet_evm::AddressMapping;13use crate::{EvmBackwardsAddressMapping, CrossAccountId};14use codec::{Encode, Decode};1516type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;17type Block = frame_system::mocking::MockBlock<Test>;1819// Configure a mock runtime to test the pallet.20frame_support::construct_runtime!(21	pub enum Test where22		Block = Block,23		NodeBlock = Block,24		UncheckedExtrinsic = UncheckedExtrinsic,25	{26		System: frame_system::{Pallet, Call, Config, Storage, Event<T>},27		TemplateModule: pallet_template::{Pallet, Call, Storage},28		Balances: pallet_balances::{Pallet, Call, Storage},29	}30);3132parameter_types! {33	pub const BlockHashCount: u64 = 250;34	pub const SS58Prefix: u8 = 42;35}3637impl system::Config for Test {38	type BaseCallFilter = ();39	type BlockWeights = ();40	type BlockLength = ();41	type DbWeight = ();42	type Origin = Origin;43	type Call = Call;44	type Index = u64;45	type BlockNumber = u64;46	type Hash = H256;47	type Hashing = BlakeTwo256;48	type AccountId = u64;49	type Lookup = IdentityLookup<Self::AccountId>;50	type Header = Header;51	type Event = ();52	type BlockHashCount = BlockHashCount;53	type Version = ();54	type PalletInfo = PalletInfo;55	type AccountData = pallet_balances::AccountData<u64>;56	type OnNewAccount = ();57	type OnKilledAccount = ();58	type SystemWeightInfo = ();59	type SS58Prefix = SS58Prefix;60	type OnSetCode = ();61}6263parameter_types! {64	pub const ExistentialDeposit: u64 = 1;65	pub const MaxLocks: u32 = 50;66}67//frame_system::Module<Test>;68impl pallet_balances::Config for Test {69	type AccountStore = System;70	type Balance = u64;71	type DustRemoval = ();72	type Event = ();73	type ExistentialDeposit = ExistentialDeposit;74	type WeightInfo = ();75	type MaxLocks = MaxLocks;76	type MaxReserves = ();77	type ReserveIdentifier = [u8; 8];78}7980parameter_types! {81	pub const TransactionByteFee: u64 = 1;82}8384impl pallet_transaction_payment::Config for Test {85	type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;86	type TransactionByteFee = TransactionByteFee;87	type WeightToFee = IdentityFee<u64>;88	type FeeMultiplierUpdate = ();89}9091parameter_types! {92	pub const MinimumPeriod: u64 = 1;93}94impl pallet_timestamp::Config for Test {95	type Moment = u64;96	type OnTimestampSet = ();97	type MinimumPeriod = MinimumPeriod;98	type WeightInfo = ();99}100101parameter_types! {102	pub const CollectionCreationPrice: u32 = 0;103	pub TreasuryAccountId: u64 = 1234;104	pub EthereumChainId: u32 = 1111;105}106107pub struct TestEvmAddressMapping;108impl AddressMapping<u64> for TestEvmAddressMapping {109	fn into_account_id(_addr: sp_core::H160) -> u64 {110		unimplemented!()111	}112}113114pub struct TestEvmBackwardsAddressMapping;115impl EvmBackwardsAddressMapping<u64> for TestEvmBackwardsAddressMapping {116	fn from_account_id(_account_id: u64) -> sp_core::H160 {117		unimplemented!()118	}119}120121#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]122pub struct TestCrossAccountId(u64, sp_core::H160);123impl CrossAccountId<u64> for TestCrossAccountId {124	fn from_sub(sub: u64) -> Self {125		let mut eth = [0; 20];126		eth[12..20].copy_from_slice(&sub.to_be_bytes());127		Self(sub, sp_core::H160(eth))128	}129	fn as_sub(&self) -> &u64 {130		&self.0131	}132	fn from_eth(eth: sp_core::H160) -> Self {133		let mut sub_raw = [0; 8];134		sub_raw.copy_from_slice(&eth.0[0..8]);135		let sub = u64::from_be_bytes(sub_raw);136		Self(sub, eth)137	}138	fn as_eth(&self) -> &sp_core::H160 {139		&self.1140	}141}142143pub struct TestEtheremTransactionSender;144impl pallet_ethereum::EthereumTransactionSender for TestEtheremTransactionSender {145	fn submit_logs_transaction(146		_tx: pallet_ethereum::Transaction,147		_logs: Vec<pallet_ethereum::Log>,148	) -> Result<(), sp_runtime::DispatchError> {149		Ok(())150	}151}152153impl pallet_evm_coder_substrate::Config for Test {154	type EthereumTransactionSender = TestEtheremTransactionSender;155}156157impl pallet_template::Config for Test {158	type Event = ();159	type WeightInfo = ();160	type CollectionCreationPrice = CollectionCreationPrice;161	type Currency = pallet_balances::Pallet<Test>;162	type TreasuryAccountId = TreasuryAccountId;163	type EvmAddressMapping = TestEvmAddressMapping;164	type EvmBackwardsAddressMapping = TestEvmBackwardsAddressMapping;165	type CrossAccountId = TestCrossAccountId;166}167168// Build genesis storage according to the mock runtime.169pub fn new_test_ext() -> sp_io::TestExternalities {170	system::GenesisConfig::default()171		.build_storage::<Test>()172		.unwrap()173		.into()174}
modifiedpallets/nft/src/tests.rsdiffbeforeafterboth
--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -2080,206 +2080,210 @@
 			Error::<Test>::NoPermission
 		);
 
-#[test]
-fn collection_transfer_flag_works() {
-	new_test_ext().execute_with(|| {
-		let origin1 = Origin::signed(1);
+		#[test]
+		fn collection_transfer_flag_works() {
+			new_test_ext().execute_with(|| {
+				let origin1 = Origin::signed(1);
 
-		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-		assert_ok!(TemplateModule::set_transfers_enabled_flag(origin1, 1, true));
+				let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+				assert_ok!(TemplateModule::set_transfers_enabled_flag(origin1, 1, true));
 
-		let data = default_nft_data();
-		create_test_item(collection_id, &data.into());
-		assert_eq!(TemplateModule::balance_count(1, 1), 1);
-		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+				let data = default_nft_data();
+				create_test_item(collection_id, &data.into());
+				assert_eq!(TemplateModule::balance_count(1, 1), 1);
+				assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
-		let origin1 = Origin::signed(1);
+				let origin1 = Origin::signed(1);
 
-		// default scenario
-		assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1000));
-		assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(2));
-		assert_eq!(TemplateModule::balance_count(1, 1), 0);
-		assert_eq!(TemplateModule::balance_count(1, 2), 1);
+				// default scenario
+				assert_ok!(TemplateModule::transfer(origin1, account(2), 1, 1, 1000));
+				assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(2));
+				assert_eq!(TemplateModule::balance_count(1, 1), 0);
+				assert_eq!(TemplateModule::balance_count(1, 2), 1);
 
-		assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
-	});
-}
+				assert_eq!(TemplateModule::address_tokens(1, 2), [1]);
+			});
+		}
 
-#[test]
-fn set_variable_meta_data_on_nft_with_admin_flag() {
-	new_test_ext().execute_with(|| {
-		default_limits();
+		#[test]
+		fn set_variable_meta_data_on_nft_with_admin_flag() {
+			new_test_ext().execute_with(|| {
+				default_limits();
 
-		let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 2, 1);
+				let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 2, 1);
 
-		let origin1 = Origin::signed(1);
-		let origin2 = Origin::signed(2);
+				let origin1 = Origin::signed(1);
+				let origin2 = Origin::signed(2);
 
-		assert_ok!(TemplateModule::set_mint_permission(
-			origin2.clone(),
-			collection_id,
-			true
-		));
-		assert_ok!(TemplateModule::add_to_white_list(
-			origin2.clone(),
-			collection_id,
-			account(1)
-		));
+				assert_ok!(TemplateModule::set_mint_permission(
+					origin2.clone(),
+					collection_id,
+					true
+				));
+				assert_ok!(TemplateModule::add_to_white_list(
+					origin2.clone(),
+					collection_id,
+					account(1)
+				));
 
-		assert_ok!(TemplateModule::add_collection_admin(
-			origin2.clone(),
-			collection_id,
-			account(1)
-		));
+				assert_ok!(TemplateModule::add_collection_admin(
+					origin2.clone(),
+					collection_id,
+					account(1)
+				));
 
-		let data = default_nft_data();
-		create_test_item(1, &data.into());
+				let data = default_nft_data();
+				create_test_item(1, &data.into());
 
-		TemplateModule::set_meta_update_permission_flag(
-			origin2.clone(),
-			collection_id,
-			MetaUpdatePermission::Admin,
-		);
+				TemplateModule::set_meta_update_permission_flag(
+					origin2.clone(),
+					collection_id,
+					MetaUpdatePermission::Admin,
+				);
 
-		let variable_data = b"test set_variable_meta_data method.".to_vec();
-		assert_ok!(TemplateModule::set_variable_meta_data(
-			origin1,
-			collection_id,
-			1,
-			variable_data.clone()
-		));
+				let variable_data = b"test set_variable_meta_data method.".to_vec();
+				assert_ok!(TemplateModule::set_variable_meta_data(
+					origin1,
+					collection_id,
+					1,
+					variable_data.clone()
+				));
 
-		assert_eq!(
-			TemplateModule::nft_item_id(collection_id, 1)
-				.unwrap()
-				.variable_data,
-			variable_data
-		);
-	});
-}
+				assert_eq!(
+					TemplateModule::nft_item_id(collection_id, 1)
+						.unwrap()
+						.variable_data,
+					variable_data
+				);
+			});
+		}
 
-#[test]
-fn set_variable_meta_data_on_nft_with_admin_flag_neg() {
-	new_test_ext().execute_with(|| {
-		default_limits();
+		#[test]
+		fn set_variable_meta_data_on_nft_with_admin_flag_neg() {
+			new_test_ext().execute_with(|| {
+				default_limits();
 
-		let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 2, 1);
+				let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 2, 1);
 
-		let origin1 = Origin::signed(1);
-		let origin2 = Origin::signed(2);
+				let origin1 = Origin::signed(1);
+				let origin2 = Origin::signed(2);
 
-		assert_ok!(TemplateModule::set_mint_permission(
-			origin2.clone(),
-			collection_id,
-			true
-		));
-		assert_ok!(TemplateModule::add_to_white_list(
-			origin2.clone(),
-			collection_id,
-			account(1)
-		));
+				assert_ok!(TemplateModule::set_mint_permission(
+					origin2.clone(),
+					collection_id,
+					true
+				));
+				assert_ok!(TemplateModule::add_to_white_list(
+					origin2.clone(),
+					collection_id,
+					account(1)
+				));
 
-		let data = default_nft_data();
-		create_test_item(1, &data.into());
+				let data = default_nft_data();
+				create_test_item(1, &data.into());
 
-		TemplateModule::set_meta_update_permission_flag(
-			origin2.clone(),
-			collection_id,
-			MetaUpdatePermission::Admin,
-		);
+				TemplateModule::set_meta_update_permission_flag(
+					origin2.clone(),
+					collection_id,
+					MetaUpdatePermission::Admin,
+				);
 
-		let variable_data = b"test set_variable_meta_data method.".to_vec();
-		assert_noop!(
-			TemplateModule::set_variable_meta_data(
-				origin1,
-				collection_id,
-				1,
-				variable_data.clone()
-			),
-			Error::<Test>::NoPermission
-		);
-	});
-}
+				let variable_data = b"test set_variable_meta_data method.".to_vec();
+				assert_noop!(
+					TemplateModule::set_variable_meta_data(
+						origin1,
+						collection_id,
+						1,
+						variable_data.clone()
+					),
+					Error::<Test>::NoPermission
+				);
+			});
+		}
 
-#[test]
-fn set_variable_meta_flag_after_freeze() {
-	new_test_ext().execute_with(|| {
-		default_limits();
+		#[test]
+		fn set_variable_meta_flag_after_freeze() {
+			new_test_ext().execute_with(|| {
+				default_limits();
 
-		let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 2, 1);
+				let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 2, 1);
 
-		let origin2 = Origin::signed(2);
+				let origin2 = Origin::signed(2);
 
-		TemplateModule::set_meta_update_permission_flag(
-			origin2.clone(),
-			collection_id,
-			MetaUpdatePermission::None,
-		);
-		assert_noop!(
-			TemplateModule::set_meta_update_permission_flag(
-				origin2.clone(),
-				collection_id,
-				MetaUpdatePermission::Admin
-			),
-			Error::<Test>::MetadataFlagFrozen
-		);
-	});
-}
+				TemplateModule::set_meta_update_permission_flag(
+					origin2.clone(),
+					collection_id,
+					MetaUpdatePermission::None,
+				);
+				assert_noop!(
+					TemplateModule::set_meta_update_permission_flag(
+						origin2.clone(),
+						collection_id,
+						MetaUpdatePermission::Admin
+					),
+					Error::<Test>::MetadataFlagFrozen
+				);
+			});
+		}
 
-#[test]
-fn set_variable_meta_data_on_nft_with_none_flag_neg() {
-	new_test_ext().execute_with(|| {
-		default_limits();
+		#[test]
+		fn set_variable_meta_data_on_nft_with_none_flag_neg() {
+			new_test_ext().execute_with(|| {
+				default_limits();
 
-		let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
-		let origin1 = Origin::signed(1);
+				let collection_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
+				let origin1 = Origin::signed(1);
 
-		let data = default_nft_data();
-		create_test_item(1, &data.into());
+				let data = default_nft_data();
+				create_test_item(1, &data.into());
 
-		TemplateModule::set_meta_update_permission_flag(
-			origin1.clone(),
-			collection_id,
-			MetaUpdatePermission::None,
-		);
+				TemplateModule::set_meta_update_permission_flag(
+					origin1.clone(),
+					collection_id,
+					MetaUpdatePermission::None,
+				);
 
-		let variable_data = b"test set_variable_meta_data method.".to_vec();
-		assert_noop!(
-			TemplateModule::set_variable_meta_data(
-				origin1.clone(),
-				collection_id,
-				1,
-				variable_data.clone()
-			),
-			Error::<Test>::MetadataUpdateDenied
-		);
+				let variable_data = b"test set_variable_meta_data method.".to_vec();
+				assert_noop!(
+					TemplateModule::set_variable_meta_data(
+						origin1.clone(),
+						collection_id,
+						1,
+						variable_data.clone()
+					),
+					Error::<Test>::MetadataUpdateDenied
+				);
+			});
+		}
 
-#[test]
-fn collection_transfer_flag_works_neg() {
-	new_test_ext().execute_with(|| {
-		let origin1 = Origin::signed(1);
+		#[test]
+		fn collection_transfer_flag_works_neg() {
+			new_test_ext().execute_with(|| {
+				let origin1 = Origin::signed(1);
 
-		let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-		assert_ok!(TemplateModule::set_transfers_enabled_flag(
-			origin1, 1, false
-		));
+				let collection_id = create_test_collection(&CollectionMode::NFT, 1);
+				assert_ok!(TemplateModule::set_transfers_enabled_flag(
+					origin1, 1, false
+				));
 
-		let data = default_nft_data();
-		create_test_item(collection_id, &data.into());
-		assert_eq!(TemplateModule::balance_count(1, 1), 1);
-		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+				let data = default_nft_data();
+				create_test_item(collection_id, &data.into());
+				assert_eq!(TemplateModule::balance_count(1, 1), 1);
+				assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
 
-		let origin1 = Origin::signed(1);
+				let origin1 = Origin::signed(1);
 
-		// default scenario
-		assert_noop!(
-			TemplateModule::transfer(origin1, account(2), 1, 1, 1000),
-			Error::<Test>::TransferNotAllowed
-		);
-		assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(1));
-		assert_eq!(TemplateModule::balance_count(1, 1), 1);
-		assert_eq!(TemplateModule::balance_count(1, 2), 0);
+				// default scenario
+				assert_noop!(
+					TemplateModule::transfer(origin1, account(2), 1, 1, 1000),
+					Error::<Test>::TransferNotAllowed
+				);
+				assert_eq!(TemplateModule::nft_item_id(1, 1).unwrap().owner, account(1));
+				assert_eq!(TemplateModule::balance_count(1, 1), 1);
+				assert_eq!(TemplateModule::balance_count(1, 2), 0);
 
-		assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+				assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
+			});
+		}
 	});
 }
modifiedtests/src/addCollectionAdmin.test.tsdiffbeforeafterboth
--- a/tests/src/addCollectionAdmin.test.ts
+++ b/tests/src/addCollectionAdmin.test.ts
@@ -4,7 +4,6 @@
 //
 
 import { ApiPromise } from '@polkadot/api';
-import BN from 'bn.js';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from './substrate/privateKey';
modifiedtests/src/collision-tests/adminLimitsOff.test.tsdiffbeforeafterboth
--- a/tests/src/collision-tests/adminLimitsOff.test.ts
+++ b/tests/src/collision-tests/adminLimitsOff.test.ts
@@ -1,5 +1,4 @@
 import { IKeyringPair } from '@polkadot/types/types';
-import BN from 'bn.js';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
 import privateKey from '../substrate/privateKey';
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -6,7 +6,6 @@
 import privateKey from '../substrate/privateKey';
 import { approveExpectSuccess, burnItemExpectSuccess, createCollectionExpectSuccess, createItemExpectSuccess, transferExpectSuccess, transferFromExpectSuccess, UNIQUE } from '../util/helpers';
 import { collectionIdToAddress, createEthAccount, createEthAccountWithBalance, GAS_ARGS, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, transferBalanceToEth } from './util/helpers';
-import { evmToAddress } from '@polkadot/util-crypto';
 import nonFungibleAbi from './nonFungibleAbi.json';
 import { expect } from 'chai';
 import waitNewBlocks from '../substrate/wait-new-blocks';
modifiedtests/src/util/helpers.tsdiffbeforeafterboth
--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -1084,15 +1084,6 @@
   await setMintPermissionExpectSuccess(sender, collectionId, true);
 }
 
-export async function addCollectionAdminExpectSuccess(sender: IKeyringPair, collectionId: number, address: IKeyringPair) {
-  await usingApi(async (api) => {
-    const changeAdminTx = api.tx.nft.addCollectionAdmin(collectionId, normalizeAccountId(address.address));
-    const events = await submitTransactionAsync(sender, changeAdminTx);
-    const result = getCreateCollectionResult(events);
-    expect(result.success).to.be.true;
-  });
-}
-
 export async function setMintPermissionExpectFailure(sender: IKeyringPair, collectionId: number, enabled: boolean) {
   await usingApi(async (api) => {
     // Run the transaction