git.delta.rocks / unique-network / refs/commits / 63b9443a2b7f

difftreelog

Merge pull request #383 from UniqueNetwork/test/nesting-admin

ut-akuznetsov2022-06-14parents: #47cbedf #686c4b3.patch.diff
in: master

11 files changed

modifiedpallets/common/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/common/src/benchmarking.rs
+++ b/pallets/common/src/benchmarking.rs
@@ -96,7 +96,7 @@
 			permissions: Some(CollectionPermissions {
 				nesting: Some(NestingPermissions {
 					token_owner: false,
-					admin: false,
+					collection_admin: false,
 					restricted: None,
 					permissive: true,
 				}),
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -1008,7 +1008,7 @@
 				nesting_budget,
 			)? {
 			// Pass
-		} else if nesting.admin && handle.is_owner_or_admin(&sender) {
+		} else if nesting.collection_admin && handle.is_owner_or_admin(&sender) {
 			// Pass
 		} else {
 			fail!(<CommonError<T>>::UserIsNotAllowedToNest);
modifiedpallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/src/lib.rs
+++ b/pallets/proxy-rmrk-core/src/lib.rs
@@ -199,7 +199,7 @@
 				permissions: Some(CollectionPermissions {
 					nesting: Some(NestingPermissions {
 						token_owner: true,
-						admin: false,
+						collection_admin: false,
 						restricted: None,
 
 						permissive: false,
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -447,7 +447,7 @@
 	pub fn nesting(&self) -> &NestingPermissions {
 		static DEFAULT: NestingPermissions = NestingPermissions {
 			token_owner: false,
-			admin: false,
+			collection_admin: false,
 			restricted: None,
 
 			permissive: false,
@@ -490,7 +490,7 @@
 	/// Owner of token can nest tokens under it
 	pub token_owner: bool,
 	/// Admin of token collection can nest tokens under token
-	pub admin: bool,
+	pub collection_admin: bool,
 	/// If set - only tokens from specified collections can be nested
 	pub restricted: Option<OwnerRestrictedSet>,
 
modifiedtests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -458,6 +458,7 @@
       ResourceNotPending: AugmentedError<ApiType>;
       RmrkPropertyKeyIsTooLong: AugmentedError<ApiType>;
       RmrkPropertyValueIsTooLong: AugmentedError<ApiType>;
+      UnableToDecodeRmrkData: AugmentedError<ApiType>;
       /**
        * Generic error
        **/
modifiedtests/src/interfaces/augment-api-query.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -417,7 +417,6 @@
     };
     rmrkCore: {
       collectionIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
-      rmrkInernalCollectionId: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
       uniqueCollectionId: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
       /**
        * Generic query
modifiedtests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth
--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -5,7 +5,7 @@
 import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
 import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
 import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
 
 declare module '@polkadot/api-base/types/submittable' {
   export interface AugmentedSubmittables<ApiType extends ApiTypes> {
@@ -373,7 +373,7 @@
       /**
        * Create composable resource
        **/
-      addComposableResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resourceId: Bytes | string | Uint8Array, resource: RmrkTraitsResourceComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, RmrkTraitsResourceComposableResource]>;
+      addComposableResource: AugmentedSubmittable<(rmrkCollectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, resource: RmrkTraitsResourceComposableResource | { parts?: any; base?: any; src?: any; metadata?: any; license?: any; thumb?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, RmrkTraitsResourceComposableResource]>;
       /**
        * Create slot resource
        **/
@@ -381,7 +381,7 @@
       /**
        * burn nft
        **/
-      burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
+      burnNft: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array, nftId: u32 | AnyNumber | Uint8Array, maxBurns: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, u32]>;
       /**
        * Change the issuer of a collection
        * 
@@ -415,7 +415,7 @@
        * - `metadata`: Arbitrary data about an nft, e.g. IPFS hash
        * - `transferable`: Ability to transfer this NFT
        **/
-      mintNft: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option<AccountId32> | null | object | string | Uint8Array, royaltyAmount: Option<Permill> | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32, Option<AccountId32>, Option<Permill>, Bytes, bool]>;
+      mintNft: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, collectionId: u32 | AnyNumber | Uint8Array, recipient: Option<AccountId32> | null | object | string | Uint8Array, royaltyAmount: Option<Permill> | null | object | string | Uint8Array, metadata: Bytes | string | Uint8Array, transferable: bool | boolean | Uint8Array, resources: Option<Vec<RmrkTraitsResourceResourceTypes>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32, Option<AccountId32>, Option<Permill>, Bytes, bool, Option<Vec<RmrkTraitsResourceResourceTypes>>]>;
       /**
        * Rejects an NFT sent from another account to self or owned NFT
        * 
modifiedtests/src/interfaces/default/types.tsdiffbeforeafterboth
--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -1214,11 +1214,13 @@
     readonly royaltyAmount: Option<Permill>;
     readonly metadata: Bytes;
     readonly transferable: bool;
+    readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;
   } & Struct;
   readonly isBurnNft: boolean;
   readonly asBurnNft: {
     readonly collectionId: u32;
     readonly nftId: u32;
+    readonly maxBurns: u32;
   } & Struct;
   readonly isSend: boolean;
   readonly asSend: {
@@ -1272,7 +1274,6 @@
   readonly asAddComposableResource: {
     readonly rmrkCollectionId: u32;
     readonly nftId: u32;
-    readonly resourceId: Bytes;
     readonly resource: RmrkTraitsResourceComposableResource;
   } & Struct;
   readonly isAddSlotResource: boolean;
@@ -1296,6 +1297,7 @@
   readonly isNftTypeEncodeError: boolean;
   readonly isRmrkPropertyKeyIsTooLong: boolean;
   readonly isRmrkPropertyValueIsTooLong: boolean;
+  readonly isUnableToDecodeRmrkData: boolean;
   readonly isCollectionNotEmpty: boolean;
   readonly isNoAvailableCollectionId: boolean;
   readonly isNoAvailableNftId: boolean;
@@ -1308,7 +1310,7 @@
   readonly isCannotAcceptNonOwnedNft: boolean;
   readonly isCannotRejectNonOwnedNft: boolean;
   readonly isResourceNotPending: boolean;
-  readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'ResourceNotPending';
+  readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'ResourceNotPending';
 }
 
 /** @name PalletRmrkCoreEvent */
@@ -2427,7 +2429,7 @@
 /** @name UpDataStructsNestingPermissions */
 export interface UpDataStructsNestingPermissions extends Struct {
   readonly tokenOwner: bool;
-  readonly admin: bool;
+  readonly collectionAdmin: bool;
   readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;
   readonly permissive: bool;
 }
modifiedtests/src/interfaces/lookup.tsdiffbeforeafterboth
--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -1432,7 +1432,7 @@
    **/
   UpDataStructsNestingPermissions: {
     tokenOwner: 'bool',
-    admin: 'bool',
+    collectionAdmin: 'bool',
     restricted: 'Option<UpDataStructsOwnerRestrictedSet>',
     permissive: 'bool'
   },
@@ -1593,10 +1593,12 @@
         royaltyAmount: 'Option<Permill>',
         metadata: 'Bytes',
         transferable: 'bool',
+        resources: 'Option<Vec<RmrkTraitsResourceResourceTypes>>',
       },
       burn_nft: {
         collectionId: 'u32',
         nftId: 'u32',
+        maxBurns: 'u32',
       },
       send: {
         rmrkCollectionId: 'u32',
@@ -1641,7 +1643,6 @@
       add_composable_resource: {
         rmrkCollectionId: 'u32',
         nftId: 'u32',
-        resourceId: 'Bytes',
         resource: 'RmrkTraitsResourceComposableResource',
       },
       add_slot_resource: {
@@ -1657,12 +1658,13 @@
     }
   },
   /**
-   * Lookup215: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
+   * Lookup217: rmrk_traits::resource::ResourceTypes<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
-  RmrkTraitsNftAccountIdOrCollectionNftTuple: {
+  RmrkTraitsResourceResourceTypes: {
     _enum: {
-      AccountId: 'AccountId32',
-      CollectionAndNftTuple: '(u32,u32)'
+      Basic: 'RmrkTraitsResourceBasicResource',
+      Composable: 'RmrkTraitsResourceComposableResource',
+      Slot: 'RmrkTraitsResourceSlotResource'
     }
   },
   /**
@@ -1675,7 +1677,7 @@
     thumb: 'Option<Bytes>'
   },
   /**
-   * Lookup222: rmrk_traits::resource::ComposableResource<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup221: rmrk_traits::resource::ComposableResource<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsResourceComposableResource: {
     parts: 'Vec<u32>',
@@ -1686,7 +1688,7 @@
     thumb: 'Option<Bytes>'
   },
   /**
-   * Lookup224: rmrk_traits::resource::SlotResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup222: rmrk_traits::resource::SlotResource<frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsResourceSlotResource: {
     base: 'u32',
@@ -1697,8 +1699,17 @@
     thumb: 'Option<Bytes>'
   },
   /**
-   * Lookup225: pallet_rmrk_equip::pallet::Call<T>
+   * Lookup224: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
    **/
+  RmrkTraitsNftAccountIdOrCollectionNftTuple: {
+    _enum: {
+      AccountId: 'AccountId32',
+      CollectionAndNftTuple: '(u32,u32)'
+    }
+  },
+  /**
+   * Lookup228: pallet_rmrk_equip::pallet::Call<T>
+   **/
   PalletRmrkEquipCall: {
     _enum: {
       create_base: {
@@ -1713,7 +1724,7 @@
     }
   },
   /**
-   * Lookup227: rmrk_traits::part::PartType<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup230: rmrk_traits::part::PartType<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsPartPartType: {
     _enum: {
@@ -1722,7 +1733,7 @@
     }
   },
   /**
-   * Lookup229: rmrk_traits::part::FixedPart<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup232: rmrk_traits::part::FixedPart<frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsPartFixedPart: {
     id: 'u32',
@@ -1730,7 +1741,7 @@
     src: 'Bytes'
   },
   /**
-   * Lookup230: rmrk_traits::part::SlotPart<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup233: rmrk_traits::part::SlotPart<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsPartSlotPart: {
     id: 'u32',
@@ -1739,7 +1750,7 @@
     z: 'u32'
   },
   /**
-   * Lookup231: rmrk_traits::part::EquippableList<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup234: rmrk_traits::part::EquippableList<frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsPartEquippableList: {
     _enum: {
@@ -1749,7 +1760,7 @@
     }
   },
   /**
-   * Lookup233: rmrk_traits::theme::Theme<frame_support::storage::bounded_vec::BoundedVec<T, S>, PropertyList>
+   * Lookup236: rmrk_traits::theme::Theme<frame_support::storage::bounded_vec::BoundedVec<T, S>, PropertyList>
    **/
   RmrkTraitsTheme: {
     name: 'Bytes',
@@ -1757,14 +1768,14 @@
     inherit: 'bool'
   },
   /**
-   * Lookup235: rmrk_traits::theme::ThemeProperty<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup238: rmrk_traits::theme::ThemeProperty<frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsThemeThemeProperty: {
     key: 'Bytes',
     value: 'Bytes'
   },
   /**
-   * Lookup236: pallet_evm::pallet::Call<T>
+   * Lookup239: pallet_evm::pallet::Call<T>
    **/
   PalletEvmCall: {
     _enum: {
@@ -1807,7 +1818,7 @@
     }
   },
   /**
-   * Lookup242: pallet_ethereum::pallet::Call<T>
+   * Lookup245: pallet_ethereum::pallet::Call<T>
    **/
   PalletEthereumCall: {
     _enum: {
@@ -1817,7 +1828,7 @@
     }
   },
   /**
-   * Lookup243: ethereum::transaction::TransactionV2
+   * Lookup246: ethereum::transaction::TransactionV2
    **/
   EthereumTransactionTransactionV2: {
     _enum: {
@@ -1827,7 +1838,7 @@
     }
   },
   /**
-   * Lookup244: ethereum::transaction::LegacyTransaction
+   * Lookup247: ethereum::transaction::LegacyTransaction
    **/
   EthereumTransactionLegacyTransaction: {
     nonce: 'U256',
@@ -1839,7 +1850,7 @@
     signature: 'EthereumTransactionTransactionSignature'
   },
   /**
-   * Lookup245: ethereum::transaction::TransactionAction
+   * Lookup248: ethereum::transaction::TransactionAction
    **/
   EthereumTransactionTransactionAction: {
     _enum: {
@@ -1848,7 +1859,7 @@
     }
   },
   /**
-   * Lookup246: ethereum::transaction::TransactionSignature
+   * Lookup249: ethereum::transaction::TransactionSignature
    **/
   EthereumTransactionTransactionSignature: {
     v: 'u64',
@@ -1856,7 +1867,7 @@
     s: 'H256'
   },
   /**
-   * Lookup248: ethereum::transaction::EIP2930Transaction
+   * Lookup251: ethereum::transaction::EIP2930Transaction
    **/
   EthereumTransactionEip2930Transaction: {
     chainId: 'u64',
@@ -1872,14 +1883,14 @@
     s: 'H256'
   },
   /**
-   * Lookup250: ethereum::transaction::AccessListItem
+   * Lookup253: ethereum::transaction::AccessListItem
    **/
   EthereumTransactionAccessListItem: {
     address: 'H160',
     storageKeys: 'Vec<H256>'
   },
   /**
-   * Lookup251: ethereum::transaction::EIP1559Transaction
+   * Lookup254: ethereum::transaction::EIP1559Transaction
    **/
   EthereumTransactionEip1559Transaction: {
     chainId: 'u64',
@@ -1896,7 +1907,7 @@
     s: 'H256'
   },
   /**
-   * Lookup252: pallet_evm_migration::pallet::Call<T>
+   * Lookup255: pallet_evm_migration::pallet::Call<T>
    **/
   PalletEvmMigrationCall: {
     _enum: {
@@ -1914,7 +1925,7 @@
     }
   },
   /**
-   * Lookup255: pallet_sudo::pallet::Event<T>
+   * Lookup258: pallet_sudo::pallet::Event<T>
    **/
   PalletSudoEvent: {
     _enum: {
@@ -1930,7 +1941,7 @@
     }
   },
   /**
-   * Lookup257: sp_runtime::DispatchError
+   * Lookup260: sp_runtime::DispatchError
    **/
   SpRuntimeDispatchError: {
     _enum: {
@@ -1947,38 +1958,38 @@
     }
   },
   /**
-   * Lookup258: sp_runtime::ModuleError
+   * Lookup261: sp_runtime::ModuleError
    **/
   SpRuntimeModuleError: {
     index: 'u8',
     error: '[u8;4]'
   },
   /**
-   * Lookup259: sp_runtime::TokenError
+   * Lookup262: sp_runtime::TokenError
    **/
   SpRuntimeTokenError: {
     _enum: ['NoFunds', 'WouldDie', 'BelowMinimum', 'CannotCreate', 'UnknownAsset', 'Frozen', 'Unsupported']
   },
   /**
-   * Lookup260: sp_runtime::ArithmeticError
+   * Lookup263: sp_runtime::ArithmeticError
    **/
   SpRuntimeArithmeticError: {
     _enum: ['Underflow', 'Overflow', 'DivisionByZero']
   },
   /**
-   * Lookup261: sp_runtime::TransactionalError
+   * Lookup264: sp_runtime::TransactionalError
    **/
   SpRuntimeTransactionalError: {
     _enum: ['LimitReached', 'NoLayer']
   },
   /**
-   * Lookup262: pallet_sudo::pallet::Error<T>
+   * Lookup265: pallet_sudo::pallet::Error<T>
    **/
   PalletSudoError: {
     _enum: ['RequireSudo']
   },
   /**
-   * Lookup263: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
+   * Lookup266: frame_system::AccountInfo<Index, pallet_balances::AccountData<Balance>>
    **/
   FrameSystemAccountInfo: {
     nonce: 'u32',
@@ -1988,7 +1999,7 @@
     data: 'PalletBalancesAccountData'
   },
   /**
-   * Lookup264: frame_support::weights::PerDispatchClass<T>
+   * Lookup267: frame_support::weights::PerDispatchClass<T>
    **/
   FrameSupportWeightsPerDispatchClassU64: {
     normal: 'u64',
@@ -1996,13 +2007,13 @@
     mandatory: 'u64'
   },
   /**
-   * Lookup265: sp_runtime::generic::digest::Digest
+   * Lookup268: sp_runtime::generic::digest::Digest
    **/
   SpRuntimeDigest: {
     logs: 'Vec<SpRuntimeDigestDigestItem>'
   },
   /**
-   * Lookup267: sp_runtime::generic::digest::DigestItem
+   * Lookup270: sp_runtime::generic::digest::DigestItem
    **/
   SpRuntimeDigestDigestItem: {
     _enum: {
@@ -2018,7 +2029,7 @@
     }
   },
   /**
-   * Lookup269: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
+   * Lookup272: frame_system::EventRecord<opal_runtime::Event, primitive_types::H256>
    **/
   FrameSystemEventRecord: {
     phase: 'FrameSystemPhase',
@@ -2026,7 +2037,7 @@
     topics: 'Vec<H256>'
   },
   /**
-   * Lookup271: frame_system::pallet::Event<T>
+   * Lookup274: frame_system::pallet::Event<T>
    **/
   FrameSystemEvent: {
     _enum: {
@@ -2054,7 +2065,7 @@
     }
   },
   /**
-   * Lookup272: frame_support::weights::DispatchInfo
+   * Lookup275: frame_support::weights::DispatchInfo
    **/
   FrameSupportWeightsDispatchInfo: {
     weight: 'u64',
@@ -2062,19 +2073,19 @@
     paysFee: 'FrameSupportWeightsPays'
   },
   /**
-   * Lookup273: frame_support::weights::DispatchClass
+   * Lookup276: frame_support::weights::DispatchClass
    **/
   FrameSupportWeightsDispatchClass: {
     _enum: ['Normal', 'Operational', 'Mandatory']
   },
   /**
-   * Lookup274: frame_support::weights::Pays
+   * Lookup277: frame_support::weights::Pays
    **/
   FrameSupportWeightsPays: {
     _enum: ['Yes', 'No']
   },
   /**
-   * Lookup275: orml_vesting::module::Event<T>
+   * Lookup278: orml_vesting::module::Event<T>
    **/
   OrmlVestingModuleEvent: {
     _enum: {
@@ -2093,7 +2104,7 @@
     }
   },
   /**
-   * Lookup276: cumulus_pallet_xcmp_queue::pallet::Event<T>
+   * Lookup279: cumulus_pallet_xcmp_queue::pallet::Event<T>
    **/
   CumulusPalletXcmpQueueEvent: {
     _enum: {
@@ -2108,7 +2119,7 @@
     }
   },
   /**
-   * Lookup277: pallet_xcm::pallet::Event<T>
+   * Lookup280: pallet_xcm::pallet::Event<T>
    **/
   PalletXcmEvent: {
     _enum: {
@@ -2131,7 +2142,7 @@
     }
   },
   /**
-   * Lookup278: xcm::v2::traits::Outcome
+   * Lookup281: xcm::v2::traits::Outcome
    **/
   XcmV2TraitsOutcome: {
     _enum: {
@@ -2141,7 +2152,7 @@
     }
   },
   /**
-   * Lookup280: cumulus_pallet_xcm::pallet::Event<T>
+   * Lookup283: cumulus_pallet_xcm::pallet::Event<T>
    **/
   CumulusPalletXcmEvent: {
     _enum: {
@@ -2151,7 +2162,7 @@
     }
   },
   /**
-   * Lookup281: cumulus_pallet_dmp_queue::pallet::Event<T>
+   * Lookup284: cumulus_pallet_dmp_queue::pallet::Event<T>
    **/
   CumulusPalletDmpQueueEvent: {
     _enum: {
@@ -2164,7 +2175,7 @@
     }
   },
   /**
-   * Lookup282: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+   * Lookup285: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
    **/
   PalletUniqueRawEvent: {
     _enum: {
@@ -2181,7 +2192,7 @@
     }
   },
   /**
-   * Lookup283: pallet_unique_scheduler::pallet::Event<T>
+   * Lookup286: pallet_unique_scheduler::pallet::Event<T>
    **/
   PalletUniqueSchedulerEvent: {
     _enum: {
@@ -2206,13 +2217,13 @@
     }
   },
   /**
-   * Lookup285: frame_support::traits::schedule::LookupError
+   * Lookup288: frame_support::traits::schedule::LookupError
    **/
   FrameSupportScheduleLookupError: {
     _enum: ['Unknown', 'BadFormat']
   },
   /**
-   * Lookup286: pallet_common::pallet::Event<T>
+   * Lookup289: pallet_common::pallet::Event<T>
    **/
   PalletCommonEvent: {
     _enum: {
@@ -2230,7 +2241,7 @@
     }
   },
   /**
-   * Lookup287: pallet_structure::pallet::Event<T>
+   * Lookup290: pallet_structure::pallet::Event<T>
    **/
   PalletStructureEvent: {
     _enum: {
@@ -2238,7 +2249,7 @@
     }
   },
   /**
-   * Lookup288: pallet_rmrk_core::pallet::Event<T>
+   * Lookup291: pallet_rmrk_core::pallet::Event<T>
    **/
   PalletRmrkCoreEvent: {
     _enum: {
@@ -2315,7 +2326,7 @@
     }
   },
   /**
-   * Lookup289: pallet_rmrk_equip::pallet::Event<T>
+   * Lookup292: pallet_rmrk_equip::pallet::Event<T>
    **/
   PalletRmrkEquipEvent: {
     _enum: {
@@ -2326,7 +2337,7 @@
     }
   },
   /**
-   * Lookup290: pallet_evm::pallet::Event<T>
+   * Lookup293: pallet_evm::pallet::Event<T>
    **/
   PalletEvmEvent: {
     _enum: {
@@ -2340,7 +2351,7 @@
     }
   },
   /**
-   * Lookup291: ethereum::log::Log
+   * Lookup294: ethereum::log::Log
    **/
   EthereumLog: {
     address: 'H160',
@@ -2348,7 +2359,7 @@
     data: 'Bytes'
   },
   /**
-   * Lookup292: pallet_ethereum::pallet::Event
+   * Lookup295: pallet_ethereum::pallet::Event
    **/
   PalletEthereumEvent: {
     _enum: {
@@ -2356,7 +2367,7 @@
     }
   },
   /**
-   * Lookup293: evm_core::error::ExitReason
+   * Lookup296: evm_core::error::ExitReason
    **/
   EvmCoreErrorExitReason: {
     _enum: {
@@ -2367,13 +2378,13 @@
     }
   },
   /**
-   * Lookup294: evm_core::error::ExitSucceed
+   * Lookup297: evm_core::error::ExitSucceed
    **/
   EvmCoreErrorExitSucceed: {
     _enum: ['Stopped', 'Returned', 'Suicided']
   },
   /**
-   * Lookup295: evm_core::error::ExitError
+   * Lookup298: evm_core::error::ExitError
    **/
   EvmCoreErrorExitError: {
     _enum: {
@@ -2395,13 +2406,13 @@
     }
   },
   /**
-   * Lookup298: evm_core::error::ExitRevert
+   * Lookup301: evm_core::error::ExitRevert
    **/
   EvmCoreErrorExitRevert: {
     _enum: ['Reverted']
   },
   /**
-   * Lookup299: evm_core::error::ExitFatal
+   * Lookup302: evm_core::error::ExitFatal
    **/
   EvmCoreErrorExitFatal: {
     _enum: {
@@ -2412,7 +2423,7 @@
     }
   },
   /**
-   * Lookup300: frame_system::Phase
+   * Lookup303: frame_system::Phase
    **/
   FrameSystemPhase: {
     _enum: {
@@ -2422,14 +2433,14 @@
     }
   },
   /**
-   * Lookup302: frame_system::LastRuntimeUpgradeInfo
+   * Lookup305: frame_system::LastRuntimeUpgradeInfo
    **/
   FrameSystemLastRuntimeUpgradeInfo: {
     specVersion: 'Compact<u32>',
     specName: 'Text'
   },
   /**
-   * Lookup303: frame_system::limits::BlockWeights
+   * Lookup306: frame_system::limits::BlockWeights
    **/
   FrameSystemLimitsBlockWeights: {
     baseBlock: 'u64',
@@ -2437,7 +2448,7 @@
     perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
   },
   /**
-   * Lookup304: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
+   * Lookup307: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
    **/
   FrameSupportWeightsPerDispatchClassWeightsPerClass: {
     normal: 'FrameSystemLimitsWeightsPerClass',
@@ -2445,7 +2456,7 @@
     mandatory: 'FrameSystemLimitsWeightsPerClass'
   },
   /**
-   * Lookup305: frame_system::limits::WeightsPerClass
+   * Lookup308: frame_system::limits::WeightsPerClass
    **/
   FrameSystemLimitsWeightsPerClass: {
     baseExtrinsic: 'u64',
@@ -2454,13 +2465,13 @@
     reserved: 'Option<u64>'
   },
   /**
-   * Lookup307: frame_system::limits::BlockLength
+   * Lookup310: frame_system::limits::BlockLength
    **/
   FrameSystemLimitsBlockLength: {
     max: 'FrameSupportWeightsPerDispatchClassU32'
   },
   /**
-   * Lookup308: frame_support::weights::PerDispatchClass<T>
+   * Lookup311: frame_support::weights::PerDispatchClass<T>
    **/
   FrameSupportWeightsPerDispatchClassU32: {
     normal: 'u32',
@@ -2468,14 +2479,14 @@
     mandatory: 'u32'
   },
   /**
-   * Lookup309: frame_support::weights::RuntimeDbWeight
+   * Lookup312: frame_support::weights::RuntimeDbWeight
    **/
   FrameSupportWeightsRuntimeDbWeight: {
     read: 'u64',
     write: 'u64'
   },
   /**
-   * Lookup310: sp_version::RuntimeVersion
+   * Lookup313: sp_version::RuntimeVersion
    **/
   SpVersionRuntimeVersion: {
     specName: 'Text',
@@ -2488,19 +2499,19 @@
     stateVersion: 'u8'
   },
   /**
-   * Lookup314: frame_system::pallet::Error<T>
+   * Lookup317: frame_system::pallet::Error<T>
    **/
   FrameSystemError: {
     _enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
   },
   /**
-   * Lookup316: orml_vesting::module::Error<T>
+   * Lookup319: orml_vesting::module::Error<T>
    **/
   OrmlVestingModuleError: {
     _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
   },
   /**
-   * Lookup318: cumulus_pallet_xcmp_queue::InboundChannelDetails
+   * Lookup321: cumulus_pallet_xcmp_queue::InboundChannelDetails
    **/
   CumulusPalletXcmpQueueInboundChannelDetails: {
     sender: 'u32',
@@ -2508,19 +2519,19 @@
     messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
   },
   /**
-   * Lookup319: cumulus_pallet_xcmp_queue::InboundState
+   * Lookup322: cumulus_pallet_xcmp_queue::InboundState
    **/
   CumulusPalletXcmpQueueInboundState: {
     _enum: ['Ok', 'Suspended']
   },
   /**
-   * Lookup322: polkadot_parachain::primitives::XcmpMessageFormat
+   * Lookup325: polkadot_parachain::primitives::XcmpMessageFormat
    **/
   PolkadotParachainPrimitivesXcmpMessageFormat: {
     _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
   },
   /**
-   * Lookup325: cumulus_pallet_xcmp_queue::OutboundChannelDetails
+   * Lookup328: cumulus_pallet_xcmp_queue::OutboundChannelDetails
    **/
   CumulusPalletXcmpQueueOutboundChannelDetails: {
     recipient: 'u32',
@@ -2530,13 +2541,13 @@
     lastIndex: 'u16'
   },
   /**
-   * Lookup326: cumulus_pallet_xcmp_queue::OutboundState
+   * Lookup329: cumulus_pallet_xcmp_queue::OutboundState
    **/
   CumulusPalletXcmpQueueOutboundState: {
     _enum: ['Ok', 'Suspended']
   },
   /**
-   * Lookup328: cumulus_pallet_xcmp_queue::QueueConfigData
+   * Lookup331: cumulus_pallet_xcmp_queue::QueueConfigData
    **/
   CumulusPalletXcmpQueueQueueConfigData: {
     suspendThreshold: 'u32',
@@ -2547,29 +2558,29 @@
     xcmpMaxIndividualWeight: 'u64'
   },
   /**
-   * Lookup330: cumulus_pallet_xcmp_queue::pallet::Error<T>
+   * Lookup333: cumulus_pallet_xcmp_queue::pallet::Error<T>
    **/
   CumulusPalletXcmpQueueError: {
     _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
   },
   /**
-   * Lookup331: pallet_xcm::pallet::Error<T>
+   * Lookup334: pallet_xcm::pallet::Error<T>
    **/
   PalletXcmError: {
     _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
   },
   /**
-   * Lookup332: cumulus_pallet_xcm::pallet::Error<T>
+   * Lookup335: cumulus_pallet_xcm::pallet::Error<T>
    **/
   CumulusPalletXcmError: 'Null',
   /**
-   * Lookup333: cumulus_pallet_dmp_queue::ConfigData
+   * Lookup336: cumulus_pallet_dmp_queue::ConfigData
    **/
   CumulusPalletDmpQueueConfigData: {
     maxIndividual: 'u64'
   },
   /**
-   * Lookup334: cumulus_pallet_dmp_queue::PageIndexData
+   * Lookup337: cumulus_pallet_dmp_queue::PageIndexData
    **/
   CumulusPalletDmpQueuePageIndexData: {
     beginUsed: 'u32',
@@ -2577,19 +2588,19 @@
     overweightCount: 'u64'
   },
   /**
-   * Lookup337: cumulus_pallet_dmp_queue::pallet::Error<T>
+   * Lookup340: cumulus_pallet_dmp_queue::pallet::Error<T>
    **/
   CumulusPalletDmpQueueError: {
     _enum: ['Unknown', 'OverLimit']
   },
   /**
-   * Lookup341: pallet_unique::Error<T>
+   * Lookup344: pallet_unique::Error<T>
    **/
   PalletUniqueError: {
     _enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument']
   },
   /**
-   * Lookup344: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
+   * Lookup347: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
    **/
   PalletUniqueSchedulerScheduledV3: {
     maybeId: 'Option<[u8;16]>',
@@ -2599,7 +2610,7 @@
     origin: 'OpalRuntimeOriginCaller'
   },
   /**
-   * Lookup345: opal_runtime::OriginCaller
+   * Lookup348: opal_runtime::OriginCaller
    **/
   OpalRuntimeOriginCaller: {
     _enum: {
@@ -2708,7 +2719,7 @@
     }
   },
   /**
-   * Lookup346: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
+   * Lookup349: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
    **/
   FrameSupportDispatchRawOrigin: {
     _enum: {
@@ -2718,7 +2729,7 @@
     }
   },
   /**
-   * Lookup347: pallet_xcm::pallet::Origin
+   * Lookup350: pallet_xcm::pallet::Origin
    **/
   PalletXcmOrigin: {
     _enum: {
@@ -2727,7 +2738,7 @@
     }
   },
   /**
-   * Lookup348: cumulus_pallet_xcm::pallet::Origin
+   * Lookup351: cumulus_pallet_xcm::pallet::Origin
    **/
   CumulusPalletXcmOrigin: {
     _enum: {
@@ -2736,7 +2747,7 @@
     }
   },
   /**
-   * Lookup349: pallet_ethereum::RawOrigin
+   * Lookup352: pallet_ethereum::RawOrigin
    **/
   PalletEthereumRawOrigin: {
     _enum: {
@@ -2744,17 +2755,17 @@
     }
   },
   /**
-   * Lookup350: sp_core::Void
+   * Lookup353: sp_core::Void
    **/
   SpCoreVoid: 'Null',
   /**
-   * Lookup351: pallet_unique_scheduler::pallet::Error<T>
+   * Lookup354: pallet_unique_scheduler::pallet::Error<T>
    **/
   PalletUniqueSchedulerError: {
     _enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange']
   },
   /**
-   * Lookup352: up_data_structs::Collection<sp_core::crypto::AccountId32>
+   * Lookup355: up_data_structs::Collection<sp_core::crypto::AccountId32>
    **/
   UpDataStructsCollection: {
     owner: 'AccountId32',
@@ -2768,7 +2779,7 @@
     externalCollection: 'bool'
   },
   /**
-   * Lookup353: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+   * Lookup356: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
    **/
   UpDataStructsSponsorshipState: {
     _enum: {
@@ -2778,7 +2789,7 @@
     }
   },
   /**
-   * Lookup354: up_data_structs::Properties
+   * Lookup357: up_data_structs::Properties
    **/
   UpDataStructsProperties: {
     map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2786,15 +2797,15 @@
     spaceLimit: 'u32'
   },
   /**
-   * Lookup355: up_data_structs::PropertiesMap<frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup358: up_data_structs::PropertiesMap<frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
   /**
-   * Lookup360: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
+   * Lookup363: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
    **/
   UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
   /**
-   * Lookup367: up_data_structs::CollectionStats
+   * Lookup370: up_data_structs::CollectionStats
    **/
   UpDataStructsCollectionStats: {
     created: 'u32',
@@ -2802,25 +2813,25 @@
     alive: 'u32'
   },
   /**
-   * Lookup368: up_data_structs::TokenChild
+   * Lookup371: up_data_structs::TokenChild
    **/
   UpDataStructsTokenChild: {
     token: 'u32',
     collection: 'u32'
   },
   /**
-   * Lookup369: PhantomType::up_data_structs<T>
+   * Lookup372: PhantomType::up_data_structs<T>
    **/
   PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]',
   /**
-   * Lookup371: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+   * Lookup374: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
    **/
   UpDataStructsTokenData: {
     properties: 'Vec<UpDataStructsProperty>',
     owner: 'Option<PalletEvmAccountBasicCrossAccountIdRepr>'
   },
   /**
-   * Lookup373: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+   * Lookup376: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
    **/
   UpDataStructsRpcCollection: {
     owner: 'AccountId32',
@@ -2836,7 +2847,7 @@
     readOnly: 'bool'
   },
   /**
-   * Lookup374: rmrk_traits::collection::CollectionInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
+   * Lookup377: rmrk_traits::collection::CollectionInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
    **/
   RmrkTraitsCollectionCollectionInfo: {
     issuer: 'AccountId32',
@@ -2846,7 +2857,7 @@
     nftsCount: 'u32'
   },
   /**
-   * Lookup375: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup378: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsNftNftInfo: {
     owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
@@ -2856,14 +2867,14 @@
     pending: 'bool'
   },
   /**
-   * Lookup377: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+   * Lookup380: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
    **/
   RmrkTraitsNftRoyaltyInfo: {
     recipient: 'AccountId32',
     amount: 'Permill'
   },
   /**
-   * Lookup378: rmrk_traits::resource::ResourceInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup381: rmrk_traits::resource::ResourceInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsResourceResourceInfo: {
     id: 'u32',
@@ -2872,24 +2883,14 @@
     pendingRemoval: 'bool'
   },
   /**
-   * Lookup379: rmrk_traits::resource::ResourceTypes<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
-   **/
-  RmrkTraitsResourceResourceTypes: {
-    _enum: {
-      Basic: 'RmrkTraitsResourceBasicResource',
-      Composable: 'RmrkTraitsResourceComposableResource',
-      Slot: 'RmrkTraitsResourceSlotResource'
-    }
-  },
-  /**
-   * Lookup380: rmrk_traits::property::PropertyInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup382: rmrk_traits::property::PropertyInfo<frame_support::storage::bounded_vec::BoundedVec<T, S>, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsPropertyPropertyInfo: {
     key: 'Bytes',
     value: 'Bytes'
   },
   /**
-   * Lookup381: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, frame_support::storage::bounded_vec::BoundedVec<T, S>>
+   * Lookup383: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, frame_support::storage::bounded_vec::BoundedVec<T, S>>
    **/
   RmrkTraitsBaseBaseInfo: {
     issuer: 'AccountId32',
@@ -2897,74 +2898,74 @@
     symbol: 'Bytes'
   },
   /**
-   * Lookup382: rmrk_traits::nft::NftChild
+   * Lookup384: rmrk_traits::nft::NftChild
    **/
   RmrkTraitsNftNftChild: {
     collectionId: 'u32',
     nftId: 'u32'
   },
   /**
-   * Lookup384: pallet_common::pallet::Error<T>
+   * Lookup386: pallet_common::pallet::Error<T>
    **/
   PalletCommonError: {
     _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal']
   },
   /**
-   * Lookup386: pallet_fungible::pallet::Error<T>
+   * Lookup388: pallet_fungible::pallet::Error<T>
    **/
   PalletFungibleError: {
     _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
   },
   /**
-   * Lookup387: pallet_refungible::ItemData
+   * Lookup389: pallet_refungible::ItemData
    **/
   PalletRefungibleItemData: {
     constData: 'Bytes'
   },
   /**
-   * Lookup391: pallet_refungible::pallet::Error<T>
+   * Lookup393: pallet_refungible::pallet::Error<T>
    **/
   PalletRefungibleError: {
     _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
   },
   /**
-   * Lookup392: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+   * Lookup394: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
    **/
   PalletNonfungibleItemData: {
     owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
   },
   /**
-   * Lookup394: pallet_nonfungible::pallet::Error<T>
+   * Lookup396: pallet_nonfungible::pallet::Error<T>
    **/
   PalletNonfungibleError: {
     _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
   },
   /**
-   * Lookup395: pallet_structure::pallet::Error<T>
+   * Lookup397: pallet_structure::pallet::Error<T>
    **/
   PalletStructureError: {
     _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound']
   },
   /**
-   * Lookup396: pallet_rmrk_core::pallet::Error<T>
+   * Lookup398: pallet_rmrk_core::pallet::Error<T>
    **/
   PalletRmrkCoreError: {
-    _enum: ['CorruptedCollectionType', 'NftTypeEncodeError', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'ResourceNotPending']
+    _enum: ['CorruptedCollectionType', 'NftTypeEncodeError', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'ResourceNotPending']
   },
   /**
-   * Lookup398: pallet_rmrk_equip::pallet::Error<T>
+   * Lookup400: pallet_rmrk_equip::pallet::Error<T>
    **/
   PalletRmrkEquipError: {
     _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst']
   },
   /**
-   * Lookup401: pallet_evm::pallet::Error<T>
+   * Lookup403: pallet_evm::pallet::Error<T>
    **/
   PalletEvmError: {
     _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
   },
   /**
-   * Lookup404: fp_rpc::TransactionStatus
+   * Lookup406: fp_rpc::TransactionStatus
    **/
   FpRpcTransactionStatus: {
     transactionHash: 'H256',
@@ -2976,11 +2977,11 @@
     logsBloom: 'EthbloomBloom'
   },
   /**
-   * Lookup406: ethbloom::Bloom
+   * Lookup408: ethbloom::Bloom
    **/
   EthbloomBloom: '[u8;256]',
   /**
-   * Lookup408: ethereum::receipt::ReceiptV3
+   * Lookup410: ethereum::receipt::ReceiptV3
    **/
   EthereumReceiptReceiptV3: {
     _enum: {
@@ -2990,7 +2991,7 @@
     }
   },
   /**
-   * Lookup409: ethereum::receipt::EIP658ReceiptData
+   * Lookup411: ethereum::receipt::EIP658ReceiptData
    **/
   EthereumReceiptEip658ReceiptData: {
     statusCode: 'u8',
@@ -2999,7 +3000,7 @@
     logs: 'Vec<EthereumLog>'
   },
   /**
-   * Lookup410: ethereum::block::Block<ethereum::transaction::TransactionV2>
+   * Lookup412: ethereum::block::Block<ethereum::transaction::TransactionV2>
    **/
   EthereumBlock: {
     header: 'EthereumHeader',
@@ -3007,7 +3008,7 @@
     ommers: 'Vec<EthereumHeader>'
   },
   /**
-   * Lookup411: ethereum::header::Header
+   * Lookup413: ethereum::header::Header
    **/
   EthereumHeader: {
     parentHash: 'H256',
@@ -3027,41 +3028,41 @@
     nonce: 'EthereumTypesHashH64'
   },
   /**
-   * Lookup412: ethereum_types::hash::H64
+   * Lookup414: ethereum_types::hash::H64
    **/
   EthereumTypesHashH64: '[u8;8]',
   /**
-   * Lookup417: pallet_ethereum::pallet::Error<T>
+   * Lookup419: pallet_ethereum::pallet::Error<T>
    **/
   PalletEthereumError: {
     _enum: ['InvalidSignature', 'PreLogExists']
   },
   /**
-   * Lookup418: pallet_evm_coder_substrate::pallet::Error<T>
+   * Lookup420: pallet_evm_coder_substrate::pallet::Error<T>
    **/
   PalletEvmCoderSubstrateError: {
     _enum: ['OutOfGas', 'OutOfFund']
   },
   /**
-   * Lookup419: pallet_evm_contract_helpers::SponsoringModeT
+   * Lookup421: pallet_evm_contract_helpers::SponsoringModeT
    **/
   PalletEvmContractHelpersSponsoringModeT: {
     _enum: ['Disabled', 'Allowlisted', 'Generous']
   },
   /**
-   * Lookup421: pallet_evm_contract_helpers::pallet::Error<T>
+   * Lookup423: pallet_evm_contract_helpers::pallet::Error<T>
    **/
   PalletEvmContractHelpersError: {
     _enum: ['NoPermission']
   },
   /**
-   * Lookup422: pallet_evm_migration::pallet::Error<T>
+   * Lookup424: pallet_evm_migration::pallet::Error<T>
    **/
   PalletEvmMigrationError: {
     _enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
   },
   /**
-   * Lookup424: sp_runtime::MultiSignature
+   * Lookup426: sp_runtime::MultiSignature
    **/
   SpRuntimeMultiSignature: {
     _enum: {
@@ -3071,43 +3072,43 @@
     }
   },
   /**
-   * Lookup425: sp_core::ed25519::Signature
+   * Lookup427: sp_core::ed25519::Signature
    **/
   SpCoreEd25519Signature: '[u8;64]',
   /**
-   * Lookup427: sp_core::sr25519::Signature
+   * Lookup429: sp_core::sr25519::Signature
    **/
   SpCoreSr25519Signature: '[u8;64]',
   /**
-   * Lookup428: sp_core::ecdsa::Signature
+   * Lookup430: sp_core::ecdsa::Signature
    **/
   SpCoreEcdsaSignature: '[u8;65]',
   /**
-   * Lookup431: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+   * Lookup433: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
    **/
   FrameSystemExtensionsCheckSpecVersion: 'Null',
   /**
-   * Lookup432: frame_system::extensions::check_genesis::CheckGenesis<T>
+   * Lookup434: frame_system::extensions::check_genesis::CheckGenesis<T>
    **/
   FrameSystemExtensionsCheckGenesis: 'Null',
   /**
-   * Lookup435: frame_system::extensions::check_nonce::CheckNonce<T>
+   * Lookup437: frame_system::extensions::check_nonce::CheckNonce<T>
    **/
   FrameSystemExtensionsCheckNonce: 'Compact<u32>',
   /**
-   * Lookup436: frame_system::extensions::check_weight::CheckWeight<T>
+   * Lookup438: frame_system::extensions::check_weight::CheckWeight<T>
    **/
   FrameSystemExtensionsCheckWeight: 'Null',
   /**
-   * Lookup437: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+   * Lookup439: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
    **/
   PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
   /**
-   * Lookup438: opal_runtime::Runtime
+   * Lookup440: opal_runtime::Runtime
    **/
   OpalRuntimeRuntime: 'Null',
   /**
-   * Lookup439: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+   * Lookup441: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
    **/
   PalletEthereumFakeTransactionFinalizer: 'Null'
 };
modifiedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth
--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -1562,7 +1562,7 @@
   /** @name UpDataStructsNestingPermissions (169) */
   export interface UpDataStructsNestingPermissions extends Struct {
     readonly tokenOwner: bool;
-    readonly admin: bool;
+    readonly collectionAdmin: bool;
     readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;
     readonly permissive: bool;
   }
@@ -1719,11 +1719,13 @@
       readonly royaltyAmount: Option<Permill>;
       readonly metadata: Bytes;
       readonly transferable: bool;
+      readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;
     } & Struct;
     readonly isBurnNft: boolean;
     readonly asBurnNft: {
       readonly collectionId: u32;
       readonly nftId: u32;
+      readonly maxBurns: u32;
     } & Struct;
     readonly isSend: boolean;
     readonly asSend: {
@@ -1777,7 +1779,6 @@
     readonly asAddComposableResource: {
       readonly rmrkCollectionId: u32;
       readonly nftId: u32;
-      readonly resourceId: Bytes;
       readonly resource: RmrkTraitsResourceComposableResource;
     } & Struct;
     readonly isAddSlotResource: boolean;
@@ -1795,13 +1796,15 @@
     readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';
   }
 
-  /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (215) */
-  export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
-    readonly isAccountId: boolean;
-    readonly asAccountId: AccountId32;
-    readonly isCollectionAndNftTuple: boolean;
-    readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;
-    readonly type: 'AccountId' | 'CollectionAndNftTuple';
+  /** @name RmrkTraitsResourceResourceTypes (217) */
+  export interface RmrkTraitsResourceResourceTypes extends Enum {
+    readonly isBasic: boolean;
+    readonly asBasic: RmrkTraitsResourceBasicResource;
+    readonly isComposable: boolean;
+    readonly asComposable: RmrkTraitsResourceComposableResource;
+    readonly isSlot: boolean;
+    readonly asSlot: RmrkTraitsResourceSlotResource;
+    readonly type: 'Basic' | 'Composable' | 'Slot';
   }
 
   /** @name RmrkTraitsResourceBasicResource (219) */
@@ -1812,7 +1815,7 @@
     readonly thumb: Option<Bytes>;
   }
 
-  /** @name RmrkTraitsResourceComposableResource (222) */
+  /** @name RmrkTraitsResourceComposableResource (221) */
   export interface RmrkTraitsResourceComposableResource extends Struct {
     readonly parts: Vec<u32>;
     readonly base: u32;
@@ -1822,7 +1825,7 @@
     readonly thumb: Option<Bytes>;
   }
 
-  /** @name RmrkTraitsResourceSlotResource (224) */
+  /** @name RmrkTraitsResourceSlotResource (222) */
   export interface RmrkTraitsResourceSlotResource extends Struct {
     readonly base: u32;
     readonly src: Option<Bytes>;
@@ -1832,7 +1835,16 @@
     readonly thumb: Option<Bytes>;
   }
 
-  /** @name PalletRmrkEquipCall (225) */
+  /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (224) */
+  export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
+    readonly isAccountId: boolean;
+    readonly asAccountId: AccountId32;
+    readonly isCollectionAndNftTuple: boolean;
+    readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;
+    readonly type: 'AccountId' | 'CollectionAndNftTuple';
+  }
+
+  /** @name PalletRmrkEquipCall (228) */
   export interface PalletRmrkEquipCall extends Enum {
     readonly isCreateBase: boolean;
     readonly asCreateBase: {
@@ -1848,7 +1860,7 @@
     readonly type: 'CreateBase' | 'ThemeAdd';
   }
 
-  /** @name RmrkTraitsPartPartType (227) */
+  /** @name RmrkTraitsPartPartType (230) */
   export interface RmrkTraitsPartPartType extends Enum {
     readonly isFixedPart: boolean;
     readonly asFixedPart: RmrkTraitsPartFixedPart;
@@ -1857,14 +1869,14 @@
     readonly type: 'FixedPart' | 'SlotPart';
   }
 
-  /** @name RmrkTraitsPartFixedPart (229) */
+  /** @name RmrkTraitsPartFixedPart (232) */
   export interface RmrkTraitsPartFixedPart extends Struct {
     readonly id: u32;
     readonly z: u32;
     readonly src: Bytes;
   }
 
-  /** @name RmrkTraitsPartSlotPart (230) */
+  /** @name RmrkTraitsPartSlotPart (233) */
   export interface RmrkTraitsPartSlotPart extends Struct {
     readonly id: u32;
     readonly equippable: RmrkTraitsPartEquippableList;
@@ -1872,7 +1884,7 @@
     readonly z: u32;
   }
 
-  /** @name RmrkTraitsPartEquippableList (231) */
+  /** @name RmrkTraitsPartEquippableList (234) */
   export interface RmrkTraitsPartEquippableList extends Enum {
     readonly isAll: boolean;
     readonly isEmpty: boolean;
@@ -1881,20 +1893,20 @@
     readonly type: 'All' | 'Empty' | 'Custom';
   }
 
-  /** @name RmrkTraitsTheme (233) */
+  /** @name RmrkTraitsTheme (236) */
   export interface RmrkTraitsTheme extends Struct {
     readonly name: Bytes;
     readonly properties: Vec<RmrkTraitsThemeThemeProperty>;
     readonly inherit: bool;
   }
 
-  /** @name RmrkTraitsThemeThemeProperty (235) */
+  /** @name RmrkTraitsThemeThemeProperty (238) */
   export interface RmrkTraitsThemeThemeProperty extends Struct {
     readonly key: Bytes;
     readonly value: Bytes;
   }
 
-  /** @name PalletEvmCall (236) */
+  /** @name PalletEvmCall (239) */
   export interface PalletEvmCall extends Enum {
     readonly isWithdraw: boolean;
     readonly asWithdraw: {
@@ -1939,7 +1951,7 @@
     readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';
   }
 
-  /** @name PalletEthereumCall (242) */
+  /** @name PalletEthereumCall (245) */
   export interface PalletEthereumCall extends Enum {
     readonly isTransact: boolean;
     readonly asTransact: {
@@ -1948,7 +1960,7 @@
     readonly type: 'Transact';
   }
 
-  /** @name EthereumTransactionTransactionV2 (243) */
+  /** @name EthereumTransactionTransactionV2 (246) */
   export interface EthereumTransactionTransactionV2 extends Enum {
     readonly isLegacy: boolean;
     readonly asLegacy: EthereumTransactionLegacyTransaction;
@@ -1959,7 +1971,7 @@
     readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
   }
 
-  /** @name EthereumTransactionLegacyTransaction (244) */
+  /** @name EthereumTransactionLegacyTransaction (247) */
   export interface EthereumTransactionLegacyTransaction extends Struct {
     readonly nonce: U256;
     readonly gasPrice: U256;
@@ -1970,7 +1982,7 @@
     readonly signature: EthereumTransactionTransactionSignature;
   }
 
-  /** @name EthereumTransactionTransactionAction (245) */
+  /** @name EthereumTransactionTransactionAction (248) */
   export interface EthereumTransactionTransactionAction extends Enum {
     readonly isCall: boolean;
     readonly asCall: H160;
@@ -1978,14 +1990,14 @@
     readonly type: 'Call' | 'Create';
   }
 
-  /** @name EthereumTransactionTransactionSignature (246) */
+  /** @name EthereumTransactionTransactionSignature (249) */
   export interface EthereumTransactionTransactionSignature extends Struct {
     readonly v: u64;
     readonly r: H256;
     readonly s: H256;
   }
 
-  /** @name EthereumTransactionEip2930Transaction (248) */
+  /** @name EthereumTransactionEip2930Transaction (251) */
   export interface EthereumTransactionEip2930Transaction extends Struct {
     readonly chainId: u64;
     readonly nonce: U256;
@@ -2000,13 +2012,13 @@
     readonly s: H256;
   }
 
-  /** @name EthereumTransactionAccessListItem (250) */
+  /** @name EthereumTransactionAccessListItem (253) */
   export interface EthereumTransactionAccessListItem extends Struct {
     readonly address: H160;
     readonly storageKeys: Vec<H256>;
   }
 
-  /** @name EthereumTransactionEip1559Transaction (251) */
+  /** @name EthereumTransactionEip1559Transaction (254) */
   export interface EthereumTransactionEip1559Transaction extends Struct {
     readonly chainId: u64;
     readonly nonce: U256;
@@ -2022,7 +2034,7 @@
     readonly s: H256;
   }
 
-  /** @name PalletEvmMigrationCall (252) */
+  /** @name PalletEvmMigrationCall (255) */
   export interface PalletEvmMigrationCall extends Enum {
     readonly isBegin: boolean;
     readonly asBegin: {
@@ -2041,7 +2053,7 @@
     readonly type: 'Begin' | 'SetData' | 'Finish';
   }
 
-  /** @name PalletSudoEvent (255) */
+  /** @name PalletSudoEvent (258) */
   export interface PalletSudoEvent extends Enum {
     readonly isSudid: boolean;
     readonly asSudid: {
@@ -2058,7 +2070,7 @@
     readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';
   }
 
-  /** @name SpRuntimeDispatchError (257) */
+  /** @name SpRuntimeDispatchError (260) */
   export interface SpRuntimeDispatchError extends Enum {
     readonly isOther: boolean;
     readonly isCannotLookup: boolean;
@@ -2077,13 +2089,13 @@
     readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';
   }
 
-  /** @name SpRuntimeModuleError (258) */
+  /** @name SpRuntimeModuleError (261) */
   export interface SpRuntimeModuleError extends Struct {
     readonly index: u8;
     readonly error: U8aFixed;
   }
 
-  /** @name SpRuntimeTokenError (259) */
+  /** @name SpRuntimeTokenError (262) */
   export interface SpRuntimeTokenError extends Enum {
     readonly isNoFunds: boolean;
     readonly isWouldDie: boolean;
@@ -2095,7 +2107,7 @@
     readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';
   }
 
-  /** @name SpRuntimeArithmeticError (260) */
+  /** @name SpRuntimeArithmeticError (263) */
   export interface SpRuntimeArithmeticError extends Enum {
     readonly isUnderflow: boolean;
     readonly isOverflow: boolean;
@@ -2103,20 +2115,20 @@
     readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';
   }
 
-  /** @name SpRuntimeTransactionalError (261) */
+  /** @name SpRuntimeTransactionalError (264) */
   export interface SpRuntimeTransactionalError extends Enum {
     readonly isLimitReached: boolean;
     readonly isNoLayer: boolean;
     readonly type: 'LimitReached' | 'NoLayer';
   }
 
-  /** @name PalletSudoError (262) */
+  /** @name PalletSudoError (265) */
   export interface PalletSudoError extends Enum {
     readonly isRequireSudo: boolean;
     readonly type: 'RequireSudo';
   }
 
-  /** @name FrameSystemAccountInfo (263) */
+  /** @name FrameSystemAccountInfo (266) */
   export interface FrameSystemAccountInfo extends Struct {
     readonly nonce: u32;
     readonly consumers: u32;
@@ -2125,19 +2137,19 @@
     readonly data: PalletBalancesAccountData;
   }
 
-  /** @name FrameSupportWeightsPerDispatchClassU64 (264) */
+  /** @name FrameSupportWeightsPerDispatchClassU64 (267) */
   export interface FrameSupportWeightsPerDispatchClassU64 extends Struct {
     readonly normal: u64;
     readonly operational: u64;
     readonly mandatory: u64;
   }
 
-  /** @name SpRuntimeDigest (265) */
+  /** @name SpRuntimeDigest (268) */
   export interface SpRuntimeDigest extends Struct {
     readonly logs: Vec<SpRuntimeDigestDigestItem>;
   }
 
-  /** @name SpRuntimeDigestDigestItem (267) */
+  /** @name SpRuntimeDigestDigestItem (270) */
   export interface SpRuntimeDigestDigestItem extends Enum {
     readonly isOther: boolean;
     readonly asOther: Bytes;
@@ -2151,14 +2163,14 @@
     readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';
   }
 
-  /** @name FrameSystemEventRecord (269) */
+  /** @name FrameSystemEventRecord (272) */
   export interface FrameSystemEventRecord extends Struct {
     readonly phase: FrameSystemPhase;
     readonly event: Event;
     readonly topics: Vec<H256>;
   }
 
-  /** @name FrameSystemEvent (271) */
+  /** @name FrameSystemEvent (274) */
   export interface FrameSystemEvent extends Enum {
     readonly isExtrinsicSuccess: boolean;
     readonly asExtrinsicSuccess: {
@@ -2186,14 +2198,14 @@
     readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';
   }
 
-  /** @name FrameSupportWeightsDispatchInfo (272) */
+  /** @name FrameSupportWeightsDispatchInfo (275) */
   export interface FrameSupportWeightsDispatchInfo extends Struct {
     readonly weight: u64;
     readonly class: FrameSupportWeightsDispatchClass;
     readonly paysFee: FrameSupportWeightsPays;
   }
 
-  /** @name FrameSupportWeightsDispatchClass (273) */
+  /** @name FrameSupportWeightsDispatchClass (276) */
   export interface FrameSupportWeightsDispatchClass extends Enum {
     readonly isNormal: boolean;
     readonly isOperational: boolean;
@@ -2201,14 +2213,14 @@
     readonly type: 'Normal' | 'Operational' | 'Mandatory';
   }
 
-  /** @name FrameSupportWeightsPays (274) */
+  /** @name FrameSupportWeightsPays (277) */
   export interface FrameSupportWeightsPays extends Enum {
     readonly isYes: boolean;
     readonly isNo: boolean;
     readonly type: 'Yes' | 'No';
   }
 
-  /** @name OrmlVestingModuleEvent (275) */
+  /** @name OrmlVestingModuleEvent (278) */
   export interface OrmlVestingModuleEvent extends Enum {
     readonly isVestingScheduleAdded: boolean;
     readonly asVestingScheduleAdded: {
@@ -2228,7 +2240,7 @@
     readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';
   }
 
-  /** @name CumulusPalletXcmpQueueEvent (276) */
+  /** @name CumulusPalletXcmpQueueEvent (279) */
   export interface CumulusPalletXcmpQueueEvent extends Enum {
     readonly isSuccess: boolean;
     readonly asSuccess: Option<H256>;
@@ -2249,7 +2261,7 @@
     readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';
   }
 
-  /** @name PalletXcmEvent (277) */
+  /** @name PalletXcmEvent (280) */
   export interface PalletXcmEvent extends Enum {
     readonly isAttempted: boolean;
     readonly asAttempted: XcmV2TraitsOutcome;
@@ -2286,7 +2298,7 @@
     readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';
   }
 
-  /** @name XcmV2TraitsOutcome (278) */
+  /** @name XcmV2TraitsOutcome (281) */
   export interface XcmV2TraitsOutcome extends Enum {
     readonly isComplete: boolean;
     readonly asComplete: u64;
@@ -2297,7 +2309,7 @@
     readonly type: 'Complete' | 'Incomplete' | 'Error';
   }
 
-  /** @name CumulusPalletXcmEvent (280) */
+  /** @name CumulusPalletXcmEvent (283) */
   export interface CumulusPalletXcmEvent extends Enum {
     readonly isInvalidFormat: boolean;
     readonly asInvalidFormat: U8aFixed;
@@ -2308,7 +2320,7 @@
     readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';
   }
 
-  /** @name CumulusPalletDmpQueueEvent (281) */
+  /** @name CumulusPalletDmpQueueEvent (284) */
   export interface CumulusPalletDmpQueueEvent extends Enum {
     readonly isInvalidFormat: boolean;
     readonly asInvalidFormat: U8aFixed;
@@ -2325,7 +2337,7 @@
     readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';
   }
 
-  /** @name PalletUniqueRawEvent (282) */
+  /** @name PalletUniqueRawEvent (285) */
   export interface PalletUniqueRawEvent extends Enum {
     readonly isCollectionSponsorRemoved: boolean;
     readonly asCollectionSponsorRemoved: u32;
@@ -2350,7 +2362,7 @@
     readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';
   }
 
-  /** @name PalletUniqueSchedulerEvent (283) */
+  /** @name PalletUniqueSchedulerEvent (286) */
   export interface PalletUniqueSchedulerEvent extends Enum {
     readonly isScheduled: boolean;
     readonly asScheduled: {
@@ -2377,14 +2389,14 @@
     readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';
   }
 
-  /** @name FrameSupportScheduleLookupError (285) */
+  /** @name FrameSupportScheduleLookupError (288) */
   export interface FrameSupportScheduleLookupError extends Enum {
     readonly isUnknown: boolean;
     readonly isBadFormat: boolean;
     readonly type: 'Unknown' | 'BadFormat';
   }
 
-  /** @name PalletCommonEvent (286) */
+  /** @name PalletCommonEvent (289) */
   export interface PalletCommonEvent extends Enum {
     readonly isCollectionCreated: boolean;
     readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;
@@ -2411,14 +2423,14 @@
     readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';
   }
 
-  /** @name PalletStructureEvent (287) */
+  /** @name PalletStructureEvent (290) */
   export interface PalletStructureEvent extends Enum {
     readonly isExecuted: boolean;
     readonly asExecuted: Result<Null, SpRuntimeDispatchError>;
     readonly type: 'Executed';
   }
 
-  /** @name PalletRmrkCoreEvent (288) */
+  /** @name PalletRmrkCoreEvent (291) */
   export interface PalletRmrkCoreEvent extends Enum {
     readonly isCollectionCreated: boolean;
     readonly asCollectionCreated: {
@@ -2508,7 +2520,7 @@
     readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';
   }
 
-  /** @name PalletRmrkEquipEvent (289) */
+  /** @name PalletRmrkEquipEvent (292) */
   export interface PalletRmrkEquipEvent extends Enum {
     readonly isBaseCreated: boolean;
     readonly asBaseCreated: {
@@ -2518,7 +2530,7 @@
     readonly type: 'BaseCreated';
   }
 
-  /** @name PalletEvmEvent (290) */
+  /** @name PalletEvmEvent (293) */
   export interface PalletEvmEvent extends Enum {
     readonly isLog: boolean;
     readonly asLog: EthereumLog;
@@ -2537,21 +2549,21 @@
     readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';
   }
 
-  /** @name EthereumLog (291) */
+  /** @name EthereumLog (294) */
   export interface EthereumLog extends Struct {
     readonly address: H160;
     readonly topics: Vec<H256>;
     readonly data: Bytes;
   }
 
-  /** @name PalletEthereumEvent (292) */
+  /** @name PalletEthereumEvent (295) */
   export interface PalletEthereumEvent extends Enum {
     readonly isExecuted: boolean;
     readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;
     readonly type: 'Executed';
   }
 
-  /** @name EvmCoreErrorExitReason (293) */
+  /** @name EvmCoreErrorExitReason (296) */
   export interface EvmCoreErrorExitReason extends Enum {
     readonly isSucceed: boolean;
     readonly asSucceed: EvmCoreErrorExitSucceed;
@@ -2564,7 +2576,7 @@
     readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';
   }
 
-  /** @name EvmCoreErrorExitSucceed (294) */
+  /** @name EvmCoreErrorExitSucceed (297) */
   export interface EvmCoreErrorExitSucceed extends Enum {
     readonly isStopped: boolean;
     readonly isReturned: boolean;
@@ -2572,7 +2584,7 @@
     readonly type: 'Stopped' | 'Returned' | 'Suicided';
   }
 
-  /** @name EvmCoreErrorExitError (295) */
+  /** @name EvmCoreErrorExitError (298) */
   export interface EvmCoreErrorExitError extends Enum {
     readonly isStackUnderflow: boolean;
     readonly isStackOverflow: boolean;
@@ -2593,13 +2605,13 @@
     readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';
   }
 
-  /** @name EvmCoreErrorExitRevert (298) */
+  /** @name EvmCoreErrorExitRevert (301) */
   export interface EvmCoreErrorExitRevert extends Enum {
     readonly isReverted: boolean;
     readonly type: 'Reverted';
   }
 
-  /** @name EvmCoreErrorExitFatal (299) */
+  /** @name EvmCoreErrorExitFatal (302) */
   export interface EvmCoreErrorExitFatal extends Enum {
     readonly isNotSupported: boolean;
     readonly isUnhandledInterrupt: boolean;
@@ -2610,7 +2622,7 @@
     readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';
   }
 
-  /** @name FrameSystemPhase (300) */
+  /** @name FrameSystemPhase (303) */
   export interface FrameSystemPhase extends Enum {
     readonly isApplyExtrinsic: boolean;
     readonly asApplyExtrinsic: u32;
@@ -2619,27 +2631,27 @@
     readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';
   }
 
-  /** @name FrameSystemLastRuntimeUpgradeInfo (302) */
+  /** @name FrameSystemLastRuntimeUpgradeInfo (305) */
   export interface FrameSystemLastRuntimeUpgradeInfo extends Struct {
     readonly specVersion: Compact<u32>;
     readonly specName: Text;
   }
 
-  /** @name FrameSystemLimitsBlockWeights (303) */
+  /** @name FrameSystemLimitsBlockWeights (306) */
   export interface FrameSystemLimitsBlockWeights extends Struct {
     readonly baseBlock: u64;
     readonly maxBlock: u64;
     readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;
   }
 
-  /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (304) */
+  /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (307) */
   export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {
     readonly normal: FrameSystemLimitsWeightsPerClass;
     readonly operational: FrameSystemLimitsWeightsPerClass;
     readonly mandatory: FrameSystemLimitsWeightsPerClass;
   }
 
-  /** @name FrameSystemLimitsWeightsPerClass (305) */
+  /** @name FrameSystemLimitsWeightsPerClass (308) */
   export interface FrameSystemLimitsWeightsPerClass extends Struct {
     readonly baseExtrinsic: u64;
     readonly maxExtrinsic: Option<u64>;
@@ -2647,25 +2659,25 @@
     readonly reserved: Option<u64>;
   }
 
-  /** @name FrameSystemLimitsBlockLength (307) */
+  /** @name FrameSystemLimitsBlockLength (310) */
   export interface FrameSystemLimitsBlockLength extends Struct {
     readonly max: FrameSupportWeightsPerDispatchClassU32;
   }
 
-  /** @name FrameSupportWeightsPerDispatchClassU32 (308) */
+  /** @name FrameSupportWeightsPerDispatchClassU32 (311) */
   export interface FrameSupportWeightsPerDispatchClassU32 extends Struct {
     readonly normal: u32;
     readonly operational: u32;
     readonly mandatory: u32;
   }
 
-  /** @name FrameSupportWeightsRuntimeDbWeight (309) */
+  /** @name FrameSupportWeightsRuntimeDbWeight (312) */
   export interface FrameSupportWeightsRuntimeDbWeight extends Struct {
     readonly read: u64;
     readonly write: u64;
   }
 
-  /** @name SpVersionRuntimeVersion (310) */
+  /** @name SpVersionRuntimeVersion (313) */
   export interface SpVersionRuntimeVersion extends Struct {
     readonly specName: Text;
     readonly implName: Text;
@@ -2677,7 +2689,7 @@
     readonly stateVersion: u8;
   }
 
-  /** @name FrameSystemError (314) */
+  /** @name FrameSystemError (317) */
   export interface FrameSystemError extends Enum {
     readonly isInvalidSpecName: boolean;
     readonly isSpecVersionNeedsToIncrease: boolean;
@@ -2688,7 +2700,7 @@
     readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';
   }
 
-  /** @name OrmlVestingModuleError (316) */
+  /** @name OrmlVestingModuleError (319) */
   export interface OrmlVestingModuleError extends Enum {
     readonly isZeroVestingPeriod: boolean;
     readonly isZeroVestingPeriodCount: boolean;
@@ -2699,21 +2711,21 @@
     readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';
   }
 
-  /** @name CumulusPalletXcmpQueueInboundChannelDetails (318) */
+  /** @name CumulusPalletXcmpQueueInboundChannelDetails (321) */
   export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {
     readonly sender: u32;
     readonly state: CumulusPalletXcmpQueueInboundState;
     readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;
   }
 
-  /** @name CumulusPalletXcmpQueueInboundState (319) */
+  /** @name CumulusPalletXcmpQueueInboundState (322) */
   export interface CumulusPalletXcmpQueueInboundState extends Enum {
     readonly isOk: boolean;
     readonly isSuspended: boolean;
     readonly type: 'Ok' | 'Suspended';
   }
 
-  /** @name PolkadotParachainPrimitivesXcmpMessageFormat (322) */
+  /** @name PolkadotParachainPrimitivesXcmpMessageFormat (325) */
   export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {
     readonly isConcatenatedVersionedXcm: boolean;
     readonly isConcatenatedEncodedBlob: boolean;
@@ -2721,7 +2733,7 @@
     readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';
   }
 
-  /** @name CumulusPalletXcmpQueueOutboundChannelDetails (325) */
+  /** @name CumulusPalletXcmpQueueOutboundChannelDetails (328) */
   export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {
     readonly recipient: u32;
     readonly state: CumulusPalletXcmpQueueOutboundState;
@@ -2730,14 +2742,14 @@
     readonly lastIndex: u16;
   }
 
-  /** @name CumulusPalletXcmpQueueOutboundState (326) */
+  /** @name CumulusPalletXcmpQueueOutboundState (329) */
   export interface CumulusPalletXcmpQueueOutboundState extends Enum {
     readonly isOk: boolean;
     readonly isSuspended: boolean;
     readonly type: 'Ok' | 'Suspended';
   }
 
-  /** @name CumulusPalletXcmpQueueQueueConfigData (328) */
+  /** @name CumulusPalletXcmpQueueQueueConfigData (331) */
   export interface CumulusPalletXcmpQueueQueueConfigData extends Struct {
     readonly suspendThreshold: u32;
     readonly dropThreshold: u32;
@@ -2747,7 +2759,7 @@
     readonly xcmpMaxIndividualWeight: u64;
   }
 
-  /** @name CumulusPalletXcmpQueueError (330) */
+  /** @name CumulusPalletXcmpQueueError (333) */
   export interface CumulusPalletXcmpQueueError extends Enum {
     readonly isFailedToSend: boolean;
     readonly isBadXcmOrigin: boolean;
@@ -2757,7 +2769,7 @@
     readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';
   }
 
-  /** @name PalletXcmError (331) */
+  /** @name PalletXcmError (334) */
   export interface PalletXcmError extends Enum {
     readonly isUnreachable: boolean;
     readonly isSendFailure: boolean;
@@ -2775,29 +2787,29 @@
     readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';
   }
 
-  /** @name CumulusPalletXcmError (332) */
+  /** @name CumulusPalletXcmError (335) */
   export type CumulusPalletXcmError = Null;
 
-  /** @name CumulusPalletDmpQueueConfigData (333) */
+  /** @name CumulusPalletDmpQueueConfigData (336) */
   export interface CumulusPalletDmpQueueConfigData extends Struct {
     readonly maxIndividual: u64;
   }
 
-  /** @name CumulusPalletDmpQueuePageIndexData (334) */
+  /** @name CumulusPalletDmpQueuePageIndexData (337) */
   export interface CumulusPalletDmpQueuePageIndexData extends Struct {
     readonly beginUsed: u32;
     readonly endUsed: u32;
     readonly overweightCount: u64;
   }
 
-  /** @name CumulusPalletDmpQueueError (337) */
+  /** @name CumulusPalletDmpQueueError (340) */
   export interface CumulusPalletDmpQueueError extends Enum {
     readonly isUnknown: boolean;
     readonly isOverLimit: boolean;
     readonly type: 'Unknown' | 'OverLimit';
   }
 
-  /** @name PalletUniqueError (341) */
+  /** @name PalletUniqueError (344) */
   export interface PalletUniqueError extends Enum {
     readonly isCollectionDecimalPointLimitExceeded: boolean;
     readonly isConfirmUnsetSponsorFail: boolean;
@@ -2805,7 +2817,7 @@
     readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument';
   }
 
-  /** @name PalletUniqueSchedulerScheduledV3 (344) */
+  /** @name PalletUniqueSchedulerScheduledV3 (347) */
   export interface PalletUniqueSchedulerScheduledV3 extends Struct {
     readonly maybeId: Option<U8aFixed>;
     readonly priority: u8;
@@ -2814,7 +2826,7 @@
     readonly origin: OpalRuntimeOriginCaller;
   }
 
-  /** @name OpalRuntimeOriginCaller (345) */
+  /** @name OpalRuntimeOriginCaller (348) */
   export interface OpalRuntimeOriginCaller extends Enum {
     readonly isVoid: boolean;
     readonly isSystem: boolean;
@@ -2828,7 +2840,7 @@
     readonly type: 'Void' | 'System' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';
   }
 
-  /** @name FrameSupportDispatchRawOrigin (346) */
+  /** @name FrameSupportDispatchRawOrigin (349) */
   export interface FrameSupportDispatchRawOrigin extends Enum {
     readonly isRoot: boolean;
     readonly isSigned: boolean;
@@ -2837,7 +2849,7 @@
     readonly type: 'Root' | 'Signed' | 'None';
   }
 
-  /** @name PalletXcmOrigin (347) */
+  /** @name PalletXcmOrigin (350) */
   export interface PalletXcmOrigin extends Enum {
     readonly isXcm: boolean;
     readonly asXcm: XcmV1MultiLocation;
@@ -2846,7 +2858,7 @@
     readonly type: 'Xcm' | 'Response';
   }
 
-  /** @name CumulusPalletXcmOrigin (348) */
+  /** @name CumulusPalletXcmOrigin (351) */
   export interface CumulusPalletXcmOrigin extends Enum {
     readonly isRelay: boolean;
     readonly isSiblingParachain: boolean;
@@ -2854,17 +2866,17 @@
     readonly type: 'Relay' | 'SiblingParachain';
   }
 
-  /** @name PalletEthereumRawOrigin (349) */
+  /** @name PalletEthereumRawOrigin (352) */
   export interface PalletEthereumRawOrigin extends Enum {
     readonly isEthereumTransaction: boolean;
     readonly asEthereumTransaction: H160;
     readonly type: 'EthereumTransaction';
   }
 
-  /** @name SpCoreVoid (350) */
+  /** @name SpCoreVoid (353) */
   export type SpCoreVoid = Null;
 
-  /** @name PalletUniqueSchedulerError (351) */
+  /** @name PalletUniqueSchedulerError (354) */
   export interface PalletUniqueSchedulerError extends Enum {
     readonly isFailedToSchedule: boolean;
     readonly isNotFound: boolean;
@@ -2873,7 +2885,7 @@
     readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';
   }
 
-  /** @name UpDataStructsCollection (352) */
+  /** @name UpDataStructsCollection (355) */
   export interface UpDataStructsCollection extends Struct {
     readonly owner: AccountId32;
     readonly mode: UpDataStructsCollectionMode;
@@ -2886,7 +2898,7 @@
     readonly externalCollection: bool;
   }
 
-  /** @name UpDataStructsSponsorshipState (353) */
+  /** @name UpDataStructsSponsorshipState (356) */
   export interface UpDataStructsSponsorshipState extends Enum {
     readonly isDisabled: boolean;
     readonly isUnconfirmed: boolean;
@@ -2896,42 +2908,42 @@
     readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
   }
 
-  /** @name UpDataStructsProperties (354) */
+  /** @name UpDataStructsProperties (357) */
   export interface UpDataStructsProperties extends Struct {
     readonly map: UpDataStructsPropertiesMapBoundedVec;
     readonly consumedSpace: u32;
     readonly spaceLimit: u32;
   }
 
-  /** @name UpDataStructsPropertiesMapBoundedVec (355) */
+  /** @name UpDataStructsPropertiesMapBoundedVec (358) */
   export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
 
-  /** @name UpDataStructsPropertiesMapPropertyPermission (360) */
+  /** @name UpDataStructsPropertiesMapPropertyPermission (363) */
   export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
 
-  /** @name UpDataStructsCollectionStats (367) */
+  /** @name UpDataStructsCollectionStats (370) */
   export interface UpDataStructsCollectionStats extends Struct {
     readonly created: u32;
     readonly destroyed: u32;
     readonly alive: u32;
   }
 
-  /** @name UpDataStructsTokenChild (368) */
+  /** @name UpDataStructsTokenChild (371) */
   export interface UpDataStructsTokenChild extends Struct {
     readonly token: u32;
     readonly collection: u32;
   }
 
-  /** @name PhantomTypeUpDataStructs (369) */
+  /** @name PhantomTypeUpDataStructs (372) */
   export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}
 
-  /** @name UpDataStructsTokenData (371) */
+  /** @name UpDataStructsTokenData (374) */
   export interface UpDataStructsTokenData extends Struct {
     readonly properties: Vec<UpDataStructsProperty>;
     readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
   }
 
-  /** @name UpDataStructsRpcCollection (373) */
+  /** @name UpDataStructsRpcCollection (376) */
   export interface UpDataStructsRpcCollection extends Struct {
     readonly owner: AccountId32;
     readonly mode: UpDataStructsCollectionMode;
@@ -2946,7 +2958,7 @@
     readonly readOnly: bool;
   }
 
-  /** @name RmrkTraitsCollectionCollectionInfo (374) */
+  /** @name RmrkTraitsCollectionCollectionInfo (377) */
   export interface RmrkTraitsCollectionCollectionInfo extends Struct {
     readonly issuer: AccountId32;
     readonly metadata: Bytes;
@@ -2955,7 +2967,7 @@
     readonly nftsCount: u32;
   }
 
-  /** @name RmrkTraitsNftNftInfo (375) */
+  /** @name RmrkTraitsNftNftInfo (378) */
   export interface RmrkTraitsNftNftInfo extends Struct {
     readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;
     readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;
@@ -2964,13 +2976,13 @@
     readonly pending: bool;
   }
 
-  /** @name RmrkTraitsNftRoyaltyInfo (377) */
+  /** @name RmrkTraitsNftRoyaltyInfo (380) */
   export interface RmrkTraitsNftRoyaltyInfo extends Struct {
     readonly recipient: AccountId32;
     readonly amount: Permill;
   }
 
-  /** @name RmrkTraitsResourceResourceInfo (378) */
+  /** @name RmrkTraitsResourceResourceInfo (381) */
   export interface RmrkTraitsResourceResourceInfo extends Struct {
     readonly id: u32;
     readonly resource: RmrkTraitsResourceResourceTypes;
@@ -2978,37 +2990,26 @@
     readonly pendingRemoval: bool;
   }
 
-  /** @name RmrkTraitsResourceResourceTypes (379) */
-  export interface RmrkTraitsResourceResourceTypes extends Enum {
-    readonly isBasic: boolean;
-    readonly asBasic: RmrkTraitsResourceBasicResource;
-    readonly isComposable: boolean;
-    readonly asComposable: RmrkTraitsResourceComposableResource;
-    readonly isSlot: boolean;
-    readonly asSlot: RmrkTraitsResourceSlotResource;
-    readonly type: 'Basic' | 'Composable' | 'Slot';
-  }
-
-  /** @name RmrkTraitsPropertyPropertyInfo (380) */
+  /** @name RmrkTraitsPropertyPropertyInfo (382) */
   export interface RmrkTraitsPropertyPropertyInfo extends Struct {
     readonly key: Bytes;
     readonly value: Bytes;
   }
 
-  /** @name RmrkTraitsBaseBaseInfo (381) */
+  /** @name RmrkTraitsBaseBaseInfo (383) */
   export interface RmrkTraitsBaseBaseInfo extends Struct {
     readonly issuer: AccountId32;
     readonly baseType: Bytes;
     readonly symbol: Bytes;
   }
 
-  /** @name RmrkTraitsNftNftChild (382) */
+  /** @name RmrkTraitsNftNftChild (384) */
   export interface RmrkTraitsNftNftChild extends Struct {
     readonly collectionId: u32;
     readonly nftId: u32;
   }
 
-  /** @name PalletCommonError (384) */
+  /** @name PalletCommonError (386) */
   export interface PalletCommonError extends Enum {
     readonly isCollectionNotFound: boolean;
     readonly isMustBeTokenOwner: boolean;
@@ -3047,7 +3048,7 @@
     readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';
   }
 
-  /** @name PalletFungibleError (386) */
+  /** @name PalletFungibleError (388) */
   export interface PalletFungibleError extends Enum {
     readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
     readonly isFungibleItemsHaveNoId: boolean;
@@ -3057,12 +3058,12 @@
     readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
   }
 
-  /** @name PalletRefungibleItemData (387) */
+  /** @name PalletRefungibleItemData (389) */
   export interface PalletRefungibleItemData extends Struct {
     readonly constData: Bytes;
   }
 
-  /** @name PalletRefungibleError (391) */
+  /** @name PalletRefungibleError (393) */
   export interface PalletRefungibleError extends Enum {
     readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
     readonly isWrongRefungiblePieces: boolean;
@@ -3071,12 +3072,12 @@
     readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
   }
 
-  /** @name PalletNonfungibleItemData (392) */
+  /** @name PalletNonfungibleItemData (394) */
   export interface PalletNonfungibleItemData extends Struct {
     readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
   }
 
-  /** @name PalletNonfungibleError (394) */
+  /** @name PalletNonfungibleError (396) */
   export interface PalletNonfungibleError extends Enum {
     readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
     readonly isNonfungibleItemsHaveNoAmount: boolean;
@@ -3084,7 +3085,7 @@
     readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
   }
 
-  /** @name PalletStructureError (395) */
+  /** @name PalletStructureError (397) */
   export interface PalletStructureError extends Enum {
     readonly isOuroborosDetected: boolean;
     readonly isDepthLimit: boolean;
@@ -3093,12 +3094,13 @@
     readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';
   }
 
-  /** @name PalletRmrkCoreError (396) */
+  /** @name PalletRmrkCoreError (398) */
   export interface PalletRmrkCoreError extends Enum {
     readonly isCorruptedCollectionType: boolean;
     readonly isNftTypeEncodeError: boolean;
     readonly isRmrkPropertyKeyIsTooLong: boolean;
     readonly isRmrkPropertyValueIsTooLong: boolean;
+    readonly isUnableToDecodeRmrkData: boolean;
     readonly isCollectionNotEmpty: boolean;
     readonly isNoAvailableCollectionId: boolean;
     readonly isNoAvailableNftId: boolean;
@@ -3111,10 +3113,10 @@
     readonly isCannotAcceptNonOwnedNft: boolean;
     readonly isCannotRejectNonOwnedNft: boolean;
     readonly isResourceNotPending: boolean;
-    readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'ResourceNotPending';
+    readonly type: 'CorruptedCollectionType' | 'NftTypeEncodeError' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'ResourceNotPending';
   }
 
-  /** @name PalletRmrkEquipError (398) */
+  /** @name PalletRmrkEquipError (400) */
   export interface PalletRmrkEquipError extends Enum {
     readonly isPermissionError: boolean;
     readonly isNoAvailableBaseId: boolean;
@@ -3124,7 +3126,7 @@
     readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst';
   }
 
-  /** @name PalletEvmError (401) */
+  /** @name PalletEvmError (403) */
   export interface PalletEvmError extends Enum {
     readonly isBalanceLow: boolean;
     readonly isFeeOverflow: boolean;
@@ -3135,7 +3137,7 @@
     readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';
   }
 
-  /** @name FpRpcTransactionStatus (404) */
+  /** @name FpRpcTransactionStatus (406) */
   export interface FpRpcTransactionStatus extends Struct {
     readonly transactionHash: H256;
     readonly transactionIndex: u32;
@@ -3146,10 +3148,10 @@
     readonly logsBloom: EthbloomBloom;
   }
 
-  /** @name EthbloomBloom (406) */
+  /** @name EthbloomBloom (408) */
   export interface EthbloomBloom extends U8aFixed {}
 
-  /** @name EthereumReceiptReceiptV3 (408) */
+  /** @name EthereumReceiptReceiptV3 (410) */
   export interface EthereumReceiptReceiptV3 extends Enum {
     readonly isLegacy: boolean;
     readonly asLegacy: EthereumReceiptEip658ReceiptData;
@@ -3160,7 +3162,7 @@
     readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
   }
 
-  /** @name EthereumReceiptEip658ReceiptData (409) */
+  /** @name EthereumReceiptEip658ReceiptData (411) */
   export interface EthereumReceiptEip658ReceiptData extends Struct {
     readonly statusCode: u8;
     readonly usedGas: U256;
@@ -3168,14 +3170,14 @@
     readonly logs: Vec<EthereumLog>;
   }
 
-  /** @name EthereumBlock (410) */
+  /** @name EthereumBlock (412) */
   export interface EthereumBlock extends Struct {
     readonly header: EthereumHeader;
     readonly transactions: Vec<EthereumTransactionTransactionV2>;
     readonly ommers: Vec<EthereumHeader>;
   }
 
-  /** @name EthereumHeader (411) */
+  /** @name EthereumHeader (413) */
   export interface EthereumHeader extends Struct {
     readonly parentHash: H256;
     readonly ommersHash: H256;
@@ -3194,24 +3196,24 @@
     readonly nonce: EthereumTypesHashH64;
   }
 
-  /** @name EthereumTypesHashH64 (412) */
+  /** @name EthereumTypesHashH64 (414) */
   export interface EthereumTypesHashH64 extends U8aFixed {}
 
-  /** @name PalletEthereumError (417) */
+  /** @name PalletEthereumError (419) */
   export interface PalletEthereumError extends Enum {
     readonly isInvalidSignature: boolean;
     readonly isPreLogExists: boolean;
     readonly type: 'InvalidSignature' | 'PreLogExists';
   }
 
-  /** @name PalletEvmCoderSubstrateError (418) */
+  /** @name PalletEvmCoderSubstrateError (420) */
   export interface PalletEvmCoderSubstrateError extends Enum {
     readonly isOutOfGas: boolean;
     readonly isOutOfFund: boolean;
     readonly type: 'OutOfGas' | 'OutOfFund';
   }
 
-  /** @name PalletEvmContractHelpersSponsoringModeT (419) */
+  /** @name PalletEvmContractHelpersSponsoringModeT (421) */
   export interface PalletEvmContractHelpersSponsoringModeT extends Enum {
     readonly isDisabled: boolean;
     readonly isAllowlisted: boolean;
@@ -3219,20 +3221,20 @@
     readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
   }
 
-  /** @name PalletEvmContractHelpersError (421) */
+  /** @name PalletEvmContractHelpersError (423) */
   export interface PalletEvmContractHelpersError extends Enum {
     readonly isNoPermission: boolean;
     readonly type: 'NoPermission';
   }
 
-  /** @name PalletEvmMigrationError (422) */
+  /** @name PalletEvmMigrationError (424) */
   export interface PalletEvmMigrationError extends Enum {
     readonly isAccountNotEmpty: boolean;
     readonly isAccountIsNotMigrating: boolean;
     readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
   }
 
-  /** @name SpRuntimeMultiSignature (424) */
+  /** @name SpRuntimeMultiSignature (426) */
   export interface SpRuntimeMultiSignature extends Enum {
     readonly isEd25519: boolean;
     readonly asEd25519: SpCoreEd25519Signature;
@@ -3243,34 +3245,34 @@
     readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
   }
 
-  /** @name SpCoreEd25519Signature (425) */
+  /** @name SpCoreEd25519Signature (427) */
   export interface SpCoreEd25519Signature extends U8aFixed {}
 
-  /** @name SpCoreSr25519Signature (427) */
+  /** @name SpCoreSr25519Signature (429) */
   export interface SpCoreSr25519Signature extends U8aFixed {}
 
-  /** @name SpCoreEcdsaSignature (428) */
+  /** @name SpCoreEcdsaSignature (430) */
   export interface SpCoreEcdsaSignature extends U8aFixed {}
 
-  /** @name FrameSystemExtensionsCheckSpecVersion (431) */
+  /** @name FrameSystemExtensionsCheckSpecVersion (433) */
   export type FrameSystemExtensionsCheckSpecVersion = Null;
 
-  /** @name FrameSystemExtensionsCheckGenesis (432) */
+  /** @name FrameSystemExtensionsCheckGenesis (434) */
   export type FrameSystemExtensionsCheckGenesis = Null;
 
-  /** @name FrameSystemExtensionsCheckNonce (435) */
+  /** @name FrameSystemExtensionsCheckNonce (437) */
   export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
 
-  /** @name FrameSystemExtensionsCheckWeight (436) */
+  /** @name FrameSystemExtensionsCheckWeight (438) */
   export type FrameSystemExtensionsCheckWeight = Null;
 
-  /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (437) */
+  /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (439) */
   export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
 
-  /** @name OpalRuntimeRuntime (438) */
+  /** @name OpalRuntimeRuntime (440) */
   export type OpalRuntimeRuntime = Null;
 
-  /** @name PalletEthereumFakeTransactionFinalizer (439) */
+  /** @name PalletEthereumFakeTransactionFinalizer (441) */
   export type PalletEthereumFakeTransactionFinalizer = Null;
 
 } // declare module
modifiedtests/src/nesting/nest.test.tsdiffbeforeafterboth
before · tests/src/nesting/nest.test.ts
1import {expect} from 'chai';2import {tokenIdToAddress} from '../eth/util/helpers';3import usingApi, {executeTransaction} from '../substrate/substrate-api';4import {5  addToAllowListExpectSuccess,6  createCollectionExpectSuccess,7  createItemExpectSuccess,8  enableAllowListExpectSuccess,9  enablePublicMintingExpectSuccess,10  getTokenChildren,11  getTokenOwner,12  getTopmostTokenOwner,13  normalizeAccountId,14  setCollectionPermissionsExpectSuccess,15  transferExpectFailure,16  transferExpectSuccess,17  transferFromExpectSuccess,18} from '../util/helpers';19import {IKeyringPair} from '@polkadot/types/types';2021let alice: IKeyringPair;22let bob: IKeyringPair;2324describe('Integration Test: Nesting', () => {25  before(async () => {26    await usingApi(async (api, privateKeyWrapper) => {27      alice = privateKeyWrapper('//Alice');28      bob = privateKeyWrapper('//Bob');29    });30  });3132  it('Performs the full suite: bundles a token, transfers, and unnests', async () => {33    await usingApi(async api => {34      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});35      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});36      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');3738      // Create a nested token39      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});40      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});41      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});4243      // Create a token to be nested44      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');4546      // Nest47      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});48      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});49      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});5051      // Move bundle to different user52      await transferExpectSuccess(collection, targetToken, alice, {Substrate: bob.address});53      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address});54      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});5556      // Unnest57      await transferFromExpectSuccess(collection, newToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}, {Substrate: bob.address});58      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});59    });60  });6162  it('Transfers an already bundled token', async () => {63    await usingApi(async api => {64      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});65      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});6667      const tokenA = await createItemExpectSuccess(alice, collection, 'NFT');68      const tokenB = await createItemExpectSuccess(alice, collection, 'NFT');6970      // Create a nested token71      const tokenC = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, tokenA)});72      expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});73      expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenA).toLowerCase()});7475      // Transfer the nested token to another token76      await expect(executeTransaction(77        api,78        alice,79        api.tx.unique.transferFrom(80          normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenA)}),81          normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenB)}),82          collection,83          tokenC,84          1,85        ),86      )).to.not.be.rejected;87      expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});88      expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenB).toLowerCase()});89    });90  });9192  it('Checks token children', async () => {93    await usingApi(async api => {94      const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}});95      await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {tokenOwner: true}});96      const collectionB = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});9798      const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT');99      const targetAddress = {Ethereum: tokenIdToAddress(collectionA, targetToken)};100      let children = await getTokenChildren(api, collectionA, targetToken);101      expect(children.length).to.be.equal(0, 'Children length check at creation');102103      // Create a nested NFT token104      const tokenA = await createItemExpectSuccess(alice, collectionA, 'NFT', targetAddress);105      children = await getTokenChildren(api, collectionA, targetToken);106      expect(children.length).to.be.equal(1, 'Children length check at nesting #1');107      expect(children).to.have.deep.members([108        {token: tokenA, collection: collectionA},109      ], 'Children contents check at nesting #1');110111      // Create then nest112      const tokenB = await createItemExpectSuccess(alice, collectionA, 'NFT');113      await transferExpectSuccess(collectionA, tokenB, alice, targetAddress);114      children = await getTokenChildren(api, collectionA, targetToken);115      expect(children.length).to.be.equal(2, 'Children length check at nesting #2');116      expect(children).to.have.deep.members([117        {token: tokenA, collection: collectionA},118        {token: tokenB, collection: collectionA},119      ], 'Children contents check at nesting #2');120121      // Move token B to a different user outside the nesting tree122      await transferExpectSuccess(collectionA, tokenB, alice, bob);123      children = await getTokenChildren(api, collectionA, targetToken);124      expect(children.length).to.be.equal(1, 'Children length check at unnesting');125      expect(children).to.be.have.deep.members([126        {token: tokenA, collection: collectionA},127      ], 'Children contents check at unnesting');128129      // Create a fungible token in another collection and then nest130      const tokenC = await createItemExpectSuccess(alice, collectionB, 'Fungible');131      await transferExpectSuccess(collectionB, tokenC, alice, targetAddress, 1, 'Fungible');132      children = await getTokenChildren(api, collectionA, targetToken);133      expect(children.length).to.be.equal(2, 'Children length check at nesting #3 (from another collection)');134      expect(children).to.be.have.deep.members([135        {token: tokenA, collection: collectionA},136        {token: tokenC, collection: collectionB},137      ], 'Children contents check at nesting #3 (from another collection)');138139      // Move the fungible token inside token A deeper in the nesting tree140      await transferFromExpectSuccess(collectionB, tokenC, alice, targetAddress, {Ethereum: tokenIdToAddress(collectionA, tokenA)}, 1, 'Fungible');141      children = await getTokenChildren(api, collectionA, targetToken);142      expect(children.length).to.be.equal(1, 'Children length check at deeper nesting');143      expect(children).to.be.have.deep.members([144        {token: tokenA, collection: collectionA},145      ], 'Children contents check at deeper nesting');146    });147  });148149  // ---------- Non-Fungible ----------150151  it('NFT: allows an Owner to nest/unnest their token', async () => {152    await usingApi(async api => {153      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});154      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});155      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');156157      // Create a nested token158      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});159      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});160      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});161162      // Create a token to be nested and nest163      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');164      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});165      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});166      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});167    });168  });169170  it('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {171    await usingApi(async api => {172      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});173      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[collection]}});174      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');175176      // Create a nested token177      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});178      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});179      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});180181      // Create a token to be nested and nest182      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');183      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});184      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});185      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});186    });187  });188189  // ---------- Fungible ----------190191  it('Fungible: allows an Owner to nest/unnest their token', async () => {192    await usingApi(async api => {193      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});194      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});195      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});196      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};197198      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});199200      // Create a nested token201      await expect(executeTransaction(api, alice, api.tx.unique.createItem(202        collectionFT,203        targetAddress,204        {Fungible: {Value: 10}},205      ))).to.not.be.rejected;206207      // Nest a new token208      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');209      await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible');210    });211  });212213  it('Fungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {214    await usingApi(async api => {215      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});216      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});217      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};218219      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});220221      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted: [collectionFT]}});222223      // Create a nested token224      await expect(executeTransaction(api, alice, api.tx.unique.createItem(225        collectionFT,226        targetAddress,227        {Fungible: {Value: 10}},228      ))).to.not.be.rejected;229230      // Nest a new token231      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');232      await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible');233    });234  });235236  // ---------- Re-Fungible ----------237238  it('ReFungible: allows an Owner to nest/unnest their token', async () => {239    await usingApi(async api => {240      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});241      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});242      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});243      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};244245      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});246247      // Create a nested token248      await expect(executeTransaction(api, alice, api.tx.unique.createItem(249        collectionRFT,250        targetAddress,251        {ReFungible: {const_data: [], pieces: 100}},252      ))).to.not.be.rejected;253254      // Nest a new token255      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');256      await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible');257    });258  });259260  it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {261    await usingApi(async api => {262      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});263      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});264      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};265266      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});267268      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionRFT]}});269270      // Create a nested token271      await expect(executeTransaction(api, alice, api.tx.unique.createItem(272        collectionRFT,273        targetAddress,274        {ReFungible: {const_data: [], pieces: 100}},275      ))).to.not.be.rejected;276277      // Nest a new token278      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');279      await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible');280    });281  });282});283284describe('Negative Test: Nesting', async() => {285  before(async () => {286    await usingApi(async (api, privateKeyWrapper) => {287      alice = privateKeyWrapper('//Alice');288      bob = privateKeyWrapper('//Bob');289    });290  });291292  it('Disallows excessive token nesting', async () => {293    await usingApi(async api => {294      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});295      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});296      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');297298      const maxNestingLevel = 5;299      let prevToken = targetToken;300301      // Create a nested-token matryoshka302      for (let i = 0; i < maxNestingLevel; i++) {303        const nestedToken = await createItemExpectSuccess(304          alice,305          collection,306          'NFT',307          {Ethereum: tokenIdToAddress(collection, prevToken)},308        );309310        prevToken = nestedToken;311      }312313      // The nesting depth is limited by `maxNestingLevel`314      await expect(executeTransaction(api, alice, api.tx.unique.createItem(315        collection,316        {Ethereum: tokenIdToAddress(collection, prevToken)},317          {nft: {const_data: [], variable_data: []}} as any,318      )), 'while creating nested token').to.be.rejectedWith(/^structure\.DepthLimit$/);319320      expect(await getTopmostTokenOwner(api, collection, prevToken)).to.be.deep.equal({Substrate: alice.address});321    });322  });323324  // ---------- Non-Fungible ----------325326  it('NFT: disallows to nest token if nesting is disabled', async () => {327    await usingApi(async api => {328      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});329      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {}});330      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');331332      // Try to create a nested token333      await expect(executeTransaction(api, alice, api.tx.unique.createItem(334        collection,335        {Ethereum: tokenIdToAddress(collection, targetToken)},336          {nft: {const_data: [], variable_data: []}} as any,337      )), 'while creating nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);338339      // Create a token to be nested340      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');341      // Try to nest342      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);343      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});344      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});345    });346  });347348  it('NFT: disallows a non-Owner to nest someone else\'s token', async () => {349    await usingApi(async api => {350      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});351      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});352353      await addToAllowListExpectSuccess(alice, collection, bob.address);354      await enableAllowListExpectSuccess(alice, collection);355      await enablePublicMintingExpectSuccess(alice, collection);356357      // Create a token to attempt to be nested into358      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');359360      // Try to create a nested token in the wrong collection361      await expect(executeTransaction(api, alice, api.tx.unique.createItem(362        collection,363        {Ethereum: tokenIdToAddress(collection, targetToken)},364          {nft: {const_data: [], variable_data: []}} as any,365      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);366367      // Try to create and nest a token in the wrong collection368      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');369      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);370      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});371    });372  });373374  it('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {375    await usingApi(async api => {376      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});377      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[collection]}});378379      await addToAllowListExpectSuccess(alice, collection, bob.address);380      await enableAllowListExpectSuccess(alice, collection);381      await enablePublicMintingExpectSuccess(alice, collection);382383      // Create a token to attempt to be nested into384      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');385386      // Try to create a nested token in the wrong collection387      await expect(executeTransaction(api, alice, api.tx.unique.createItem(388        collection,389        {Ethereum: tokenIdToAddress(collection, targetToken)},390          {nft: {const_data: [], variable_data: []}} as any,391      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);392393      // Try to create and nest a token in the wrong collection394      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');395      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);396      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});397    });398  });399400  it('NFT: disallows to nest token in an unlisted collection', async () => {401    await usingApi(async api => {402      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});403      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[]}});404405      // Create a token to attempt to be nested into406      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');407408      // Try to create a nested token in the wrong collection409      await expect(executeTransaction(api, alice, api.tx.unique.createItem(410        collection,411        {Ethereum: tokenIdToAddress(collection, targetToken)},412          {nft: {const_data: [], variable_data: []}} as any,413      )), 'while creating nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);414415      // Try to create and nest a token in the wrong collection416      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');417      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);418      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});419    });420  });421422  // ---------- Fungible ----------423424  it('Fungible: disallows to nest token if nesting is disabled', async () => {425    await usingApi(async api => {426      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});427      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}});428      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');429      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};430431      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});432433      // Try to create a nested token434      await expect(executeTransaction(api, alice, api.tx.unique.createItem(435        collectionFT,436        targetAddress,437        {Fungible: {Value: 10}},438      )), 'while creating nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);439440      // Create a token to be nested441      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');442      // Try to nest443      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);444445      // Create another token to be nested446      const newToken2 = await createItemExpectSuccess(alice, collectionFT, 'Fungible');447      // Try to nest inside a fungible token448      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionFT, newToken)}, collectionFT, newToken2, 1)), 'while nesting new token inside fungible').to.be.rejectedWith(/fungible\.FungibleDisallowsNesting/);449    });450  });451452  it('Fungible: disallows a non-Owner to nest someone else\'s token', async () => {453    await usingApi(async api => {454      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});455      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});456457      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);458      await enableAllowListExpectSuccess(alice, collectionNFT);459      await enablePublicMintingExpectSuccess(alice, collectionNFT);460461      // Create a token to attempt to be nested into462      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');463      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};464465      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});466467      // Try to create a nested token in the wrong collection468      await expect(executeTransaction(api, alice, api.tx.unique.createItem(469        collectionFT,470        targetAddress,471        {Fungible: {Value: 10}},472      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);473474      // Try to create and nest a token in the wrong collection475      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');476      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);477    });478  });479480  it('Fungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {481    await usingApi(async api => {482      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});483      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);484      await enableAllowListExpectSuccess(alice, collectionNFT);485      await enablePublicMintingExpectSuccess(alice, collectionNFT);486487      // Create a token to attempt to be nested into488      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');489      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};490491      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});492      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionFT]}});493494      // Try to create a nested token in the wrong collection495      await expect(executeTransaction(api, alice, api.tx.unique.createItem(496        collectionFT,497        targetAddress,498        {Fungible: {Value: 10}},499      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);500501      // Try to create and nest a token in the wrong collection502      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');503      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);504    });505  });506507  it('Fungible: disallows to nest token in an unlisted collection', async () => {508    await usingApi(async api => {509      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});510      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}});511512      // Create a token to attempt to be nested into513      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');514      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};515516      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});517518      // Try to create a nested token in the wrong collection519      await expect(executeTransaction(api, alice, api.tx.unique.createItem(520        collectionFT,521        targetAddress,522        {Fungible: {Value: 10}},523      )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);524525      // Try to create and nest a token in the wrong collection526      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');527      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);528    });529  });530531  // ---------- Re-Fungible ----------532533  it('ReFungible: disallows to nest token if nesting is disabled', async () => {534    await usingApi(async api => {535      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});536      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}});537      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');538      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};539540      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});541542      // Create a nested token543      await expect(executeTransaction(api, alice, api.tx.unique.createItem(544        collectionRFT,545        targetAddress,546        {ReFungible: {const_data: [], pieces: 100}},547      )), 'while creating a nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);548549      // Create a token to be nested550      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');551      // Try to nest552      await transferExpectFailure(collectionRFT, newToken, alice, targetAddress, 100);553      // Try to nest554      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);555556      // Create another token to be nested557      const newToken2 = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');558      // Try to nest inside a fungible token559      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionRFT, newToken)}, collectionRFT, newToken2, 1)), 'while nesting new token inside refungible').to.be.rejectedWith(/refungible\.RefungibleDisallowsNesting/);560    });561  });562563  it('ReFungible: disallows a non-Owner to nest someone else\'s token', async () => {564    await usingApi(async api => {565      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});566      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});567568      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);569      await enableAllowListExpectSuccess(alice, collectionNFT);570      await enablePublicMintingExpectSuccess(alice, collectionNFT);571572      // Create a token to attempt to be nested into573      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');574      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};575576      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});577578      // Try to create a nested token in the wrong collection579      await expect(executeTransaction(api, alice, api.tx.unique.createItem(580        collectionRFT,581        targetAddress,582        {ReFungible: {const_data: [], pieces: 100}},583      )), 'while creating a nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);584585      // Try to create and nest a token in the wrong collection586      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');587      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);588    });589  });590591  it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {592    await usingApi(async api => {593      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});594      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);595      await enableAllowListExpectSuccess(alice, collectionNFT);596      await enablePublicMintingExpectSuccess(alice, collectionNFT);597598      // Create a token to attempt to be nested into599      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');600      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};601602      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});603      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionRFT]}});604605      // Try to create a nested token in the wrong collection606      await expect(executeTransaction(api, alice, api.tx.unique.createItem(607        collectionRFT,608        targetAddress,609        {ReFungible: {const_data: [], pieces: 100}},610      )), 'while creating a nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);611612      // Try to create and nest a token in the wrong collection613      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');614      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);615    });616  });617618  it('ReFungible: disallows to nest token to an unlisted collection', async () => {619    await usingApi(async api => {620      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});621      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}});622623      // Create a token to attempt to be nested into624      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');625      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};626627      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});628629      // Try to create a nested token in the wrong collection630      await expect(executeTransaction(api, alice, api.tx.unique.createItem(631        collectionRFT,632        targetAddress,633        {ReFungible: {const_data: [], pieces: 100}},634      )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);635636      // Try to create and nest a token in the wrong collection637      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');638      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);639    });640  });641});
after · tests/src/nesting/nest.test.ts
1import {expect} from 'chai';2import {tokenIdToAddress} from '../eth/util/helpers';3import usingApi, {executeTransaction} from '../substrate/substrate-api';4import {5  addCollectionAdminExpectSuccess,6  addToAllowListExpectSuccess,7  createCollectionExpectSuccess,8  createItemExpectSuccess,9  enableAllowListExpectSuccess,10  enablePublicMintingExpectSuccess,11  getTokenChildren,12  getTokenOwner,13  getTopmostTokenOwner,14  normalizeAccountId,15  setCollectionPermissionsExpectSuccess,16  transferExpectFailure,17  transferExpectSuccess,18  transferFromExpectSuccess,19} from '../util/helpers';20import {IKeyringPair} from '@polkadot/types/types';2122let alice: IKeyringPair;23let bob: IKeyringPair;24let charlie: IKeyringPair;2526describe('Integration Test: Composite nesting tests', () => {27  before(async () => {28    await usingApi(async (_, privateKeyWrapper) => {29      alice = privateKeyWrapper('//Alice');30      bob = privateKeyWrapper('//Bob');31    });32  });3334  it('Performs the full suite: bundles a token, transfers, and unnests', async () => {35    await usingApi(async api => {36      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});37      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});38      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');3940      // Create a nested token41      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});42      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});43      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});4445      // Create a token to be nested46      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');4748      // Nest49      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});50      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});51      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});5253      // Move bundle to different user54      await transferExpectSuccess(collection, targetToken, alice, {Substrate: bob.address});55      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address});56      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});5758      // Unnest59      await transferFromExpectSuccess(collection, newToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)}, {Substrate: bob.address});60      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});61    });62  });6364  it('Transfers an already bundled token', async () => {65    await usingApi(async api => {66      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});67      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});6869      const tokenA = await createItemExpectSuccess(alice, collection, 'NFT');70      const tokenB = await createItemExpectSuccess(alice, collection, 'NFT');7172      // Create a nested token73      const tokenC = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, tokenA)});74      expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});75      expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenA).toLowerCase()});7677      // Transfer the nested token to another token78      await expect(executeTransaction(79        api,80        alice,81        api.tx.unique.transferFrom(82          normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenA)}),83          normalizeAccountId({Ethereum: tokenIdToAddress(collection, tokenB)}),84          collection,85          tokenC,86          1,87        ),88      )).to.not.be.rejected;89      expect(await getTopmostTokenOwner(api, collection, tokenC)).to.be.deep.equal({Substrate: alice.address});90      expect(await getTokenOwner(api, collection, tokenC)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, tokenB).toLowerCase()});91    });92  });9394  it('Checks token children', async () => {95    await usingApi(async api => {96      const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}});97      await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {tokenOwner: true}});98      const collectionB = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});99100      const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT');101      const targetAddress = {Ethereum: tokenIdToAddress(collectionA, targetToken)};102      let children = await getTokenChildren(api, collectionA, targetToken);103      expect(children.length).to.be.equal(0, 'Children length check at creation');104105      // Create a nested NFT token106      const tokenA = await createItemExpectSuccess(alice, collectionA, 'NFT', targetAddress);107      children = await getTokenChildren(api, collectionA, targetToken);108      expect(children.length).to.be.equal(1, 'Children length check at nesting #1');109      expect(children).to.have.deep.members([110        {token: tokenA, collection: collectionA},111      ], 'Children contents check at nesting #1');112113      // Create then nest114      const tokenB = await createItemExpectSuccess(alice, collectionA, 'NFT');115      await transferExpectSuccess(collectionA, tokenB, alice, targetAddress);116      children = await getTokenChildren(api, collectionA, targetToken);117      expect(children.length).to.be.equal(2, 'Children length check at nesting #2');118      expect(children).to.have.deep.members([119        {token: tokenA, collection: collectionA},120        {token: tokenB, collection: collectionA},121      ], 'Children contents check at nesting #2');122123      // Move token B to a different user outside the nesting tree124      await transferExpectSuccess(collectionA, tokenB, alice, bob);125      children = await getTokenChildren(api, collectionA, targetToken);126      expect(children.length).to.be.equal(1, 'Children length check at unnesting');127      expect(children).to.be.have.deep.members([128        {token: tokenA, collection: collectionA},129      ], 'Children contents check at unnesting');130131      // Create a fungible token in another collection and then nest132      const tokenC = await createItemExpectSuccess(alice, collectionB, 'Fungible');133      await transferExpectSuccess(collectionB, tokenC, alice, targetAddress, 1, 'Fungible');134      children = await getTokenChildren(api, collectionA, targetToken);135      expect(children.length).to.be.equal(2, 'Children length check at nesting #3 (from another collection)');136      expect(children).to.be.have.deep.members([137        {token: tokenA, collection: collectionA},138        {token: tokenC, collection: collectionB},139      ], 'Children contents check at nesting #3 (from another collection)');140141      // Move the fungible token inside token A deeper in the nesting tree142      await transferFromExpectSuccess(collectionB, tokenC, alice, targetAddress, {Ethereum: tokenIdToAddress(collectionA, tokenA)}, 1, 'Fungible');143      children = await getTokenChildren(api, collectionA, targetToken);144      expect(children.length).to.be.equal(1, 'Children length check at deeper nesting');145      expect(children).to.be.have.deep.members([146        {token: tokenA, collection: collectionA},147      ], 'Children contents check at deeper nesting');148    });149  });150});151152describe('Integration Test: Various token type nesting', async () => {153  before(async () => {154    await usingApi(async (_, privateKeyWrapper) => {155      alice = privateKeyWrapper('//Alice');156      bob = privateKeyWrapper('//Bob');157      charlie = privateKeyWrapper('//Charlie');158    });159  });160161  it('Admin (NFT): allows an Admin to nest a token', async () => {162    await usingApi(async api => {163      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});164      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {collectionAdmin: true}});165      await addCollectionAdminExpectSuccess(alice, collection, bob.address);166      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT', charlie.address);167168      // Create a nested token169      const nestedToken = await createItemExpectSuccess(bob, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});170      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: charlie.address});171      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});172173      // Create a token to be nested and nest174      const newToken = await createItemExpectSuccess(bob, collection, 'NFT');175      await transferExpectSuccess(collection, newToken, bob, {Ethereum: tokenIdToAddress(collection, targetToken)});176      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: charlie.address});177      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});178    });179  });180181  it('Admin (NFT): Admin and Token Owner can operate together', async () => {182    await usingApi(async api => {183      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});184      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, collectionAdmin: true}});185      await addCollectionAdminExpectSuccess(alice, collection, bob.address);186      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT', charlie.address);187188      // Create a nested token by an administrator189      const nestedToken = await createItemExpectSuccess(bob, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});190      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: charlie.address});191      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});192193      // Create a token and allow the owner to nest too194      const newToken = await createItemExpectSuccess(alice, collection, 'NFT', charlie.address);195      await transferExpectSuccess(collection, newToken, charlie, {Ethereum: tokenIdToAddress(collection, nestedToken)});196      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: charlie.address});197      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, nestedToken).toLowerCase()});198    });199  });200201  it('Admin (NFT): allows an Admin to nest a token (Restricted nesting)', async () => {202    await usingApi(async api => {203      const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}});204      await addCollectionAdminExpectSuccess(alice, collectionA, bob.address);205      const collectionB = await createCollectionExpectSuccess({mode: {type: 'NFT'}});206      await addCollectionAdminExpectSuccess(alice, collectionB, bob.address);207      await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {collectionAdmin: true, restricted:[collectionA, collectionB]}});208      const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT', charlie.address);209210      // Create a nested token211      const nestedToken = await createItemExpectSuccess(bob, collectionB, 'NFT', {Ethereum: tokenIdToAddress(collectionA, targetToken)});212      expect(await getTopmostTokenOwner(api, collectionB, nestedToken)).to.be.deep.equal({Substrate: charlie.address});213      expect(await getTokenOwner(api, collectionB, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collectionA, targetToken).toLowerCase()});214215      // Create a token to be nested and nest216      const newToken = await createItemExpectSuccess(bob, collectionB, 'NFT');217      await transferExpectSuccess(collectionB, newToken, bob, {Ethereum: tokenIdToAddress(collectionA, targetToken)});218      expect(await getTopmostTokenOwner(api, collectionB, newToken)).to.be.deep.equal({Substrate: charlie.address});219      expect(await getTokenOwner(api, collectionB, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collectionA, targetToken).toLowerCase()});220    });221  });222223  // ---------- Non-Fungible ----------224225  it('NFT: allows an Owner to nest/unnest their token', async () => {226    await usingApi(async api => {227      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});228      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});229      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');230231      // Create a nested token232      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});233      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});234      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});235236      // Create a token to be nested and nest237      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');238      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});239      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});240      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});241    });242  });243244  it('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {245    await usingApi(async api => {246      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});247      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[collection]}});248      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');249250      // Create a nested token251      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', {Ethereum: tokenIdToAddress(collection, targetToken)});252      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: alice.address});253      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});254255      // Create a token to be nested and nest256      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');257      await transferExpectSuccess(collection, newToken, alice, {Ethereum: tokenIdToAddress(collection, targetToken)});258      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});259      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()});260    });261  });262263  // ---------- Fungible ----------264265  it('Fungible: allows an Owner to nest/unnest their token', async () => {266    await usingApi(async api => {267      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});268      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});269      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});270      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};271272      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});273274      // Create a nested token275      await expect(executeTransaction(api, alice, api.tx.unique.createItem(276        collectionFT,277        targetAddress,278        {Fungible: {Value: 10}},279      ))).to.not.be.rejected;280281      // Nest a new token282      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');283      await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible');284    });285  });286287  it('Fungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {288    await usingApi(async api => {289      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});290      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});291      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};292293      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});294295      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted: [collectionFT]}});296297      // Create a nested token298      await expect(executeTransaction(api, alice, api.tx.unique.createItem(299        collectionFT,300        targetAddress,301        {Fungible: {Value: 10}},302      ))).to.not.be.rejected;303304      // Nest a new token305      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');306      await transferExpectSuccess(collectionFT, newToken, alice, targetAddress, 1, 'Fungible');307    });308  });309310  // ---------- Re-Fungible ----------311312  it('ReFungible: allows an Owner to nest/unnest their token', async () => {313    await usingApi(async api => {314      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});315      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});316      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});317      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};318319      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});320321      // Create a nested token322      await expect(executeTransaction(api, alice, api.tx.unique.createItem(323        collectionRFT,324        targetAddress,325        {ReFungible: {pieces: 100}},326      ))).to.not.be.rejected;327328      // Nest a new token329      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');330      await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible');331    });332  });333334  it('ReFungible: allows an Owner to nest/unnest their token (Restricted nesting)', async () => {335    await usingApi(async api => {336      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});337      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT', {Substrate: alice.address});338      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};339340      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});341342      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionRFT]}});343344      // Create a nested token345      await expect(executeTransaction(api, alice, api.tx.unique.createItem(346        collectionRFT,347        targetAddress,348        {ReFungible: {pieces: 100}},349      ))).to.not.be.rejected;350351      // Nest a new token352      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');353      await transferExpectSuccess(collectionRFT, newToken, alice, targetAddress, 100, 'ReFungible');354    });355  });356});357358describe('Negative Test: Nesting', async() => {359  before(async () => {360    await usingApi(async (_, privateKeyWrapper) => {361      alice = privateKeyWrapper('//Alice');362      bob = privateKeyWrapper('//Bob');363    });364  });365366  it('Disallows excessive token nesting', async () => {367    await usingApi(async api => {368      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});369      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});370      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');371372      const maxNestingLevel = 5;373      let prevToken = targetToken;374375      // Create a nested-token matryoshka376      for (let i = 0; i < maxNestingLevel; i++) {377        const nestedToken = await createItemExpectSuccess(378          alice,379          collection,380          'NFT',381          {Ethereum: tokenIdToAddress(collection, prevToken)},382        );383384        prevToken = nestedToken;385      }386387      // The nesting depth is limited by `maxNestingLevel`388      await expect(executeTransaction(api, alice, api.tx.unique.createItem(389        collection,390        {Ethereum: tokenIdToAddress(collection, prevToken)},391          {nft: {}} as any,392      )), 'while creating nested token').to.be.rejectedWith(/^structure\.DepthLimit$/);393394      expect(await getTopmostTokenOwner(api, collection, prevToken)).to.be.deep.equal({Substrate: alice.address});395    });396  });397398  // ---------- Admin ------------399400  it('Admin (NFT): disallows an Admin to operate nesting when only TokenOwner is allowed', async () => {401    await usingApi(async api => {402      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});403      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});404      await addCollectionAdminExpectSuccess(alice, collection, bob.address);405      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');406407      // Try to create a nested token as collection admin when it's disallowed408      await expect(executeTransaction(api, bob, api.tx.unique.createItem(409        collection,410        {Ethereum: tokenIdToAddress(collection, targetToken)},411          {nft: {}} as any,412      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);413414      // Try to create and nest a token in the wrong collection415      const newToken = await createItemExpectSuccess(bob, collection, 'NFT');416      await expect(executeTransaction(417        api, 418        bob, 419        api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1),420      ), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);421      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});422    });423  });424425  it('Admin (NFT): disallows a Token Owner to operate nesting when only Admin is allowed', async () => {426    await usingApi(async api => {427      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});428      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {collectionAdmin: true}});429      await addToAllowListExpectSuccess(alice, collection, bob.address);430      await enableAllowListExpectSuccess(alice, collection);431      await enablePublicMintingExpectSuccess(alice, collection);432      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');433434      // Try to create a nested token as collection admin when it's disallowed435      await expect(executeTransaction(api, bob, api.tx.unique.createItem(436        collection,437        {Ethereum: tokenIdToAddress(collection, targetToken)},438          {nft: {}} as any,439      )), 'while creating nested token').to.be.rejectedWith(/common\.AddressNotInAllowlist/); 440441      // Try to create and nest a token in the wrong collection442      const newToken = await createItemExpectSuccess(bob, collection, 'NFT');443      await expect(executeTransaction(444        api, 445        bob, 446        api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1),447      ), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);448      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});449    });450  });451452  it('Admin (NFT): disallows an Admin to nest and unnest someone else\'s token', async () => {453    await usingApi(async api => {454      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});455      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {collectionAdmin: true}});456457      await addToAllowListExpectSuccess(alice, collection, bob.address);458      await enableAllowListExpectSuccess(alice, collection);459      await enablePublicMintingExpectSuccess(alice, collection);460461      // Create a token to attempt to be nested into462      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');463      const targetAddress = {Ethereum: tokenIdToAddress(collection, targetToken).toLowerCase()};464465      // Try to nest somebody else's token466      const newToken = await createItemExpectSuccess(bob, collection, 'NFT');467      await expect(executeTransaction(468        api, 469        alice, 470        api.tx.unique.transfer(targetAddress, collection, newToken, 1),471      ), 'while nesting another\'s token token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);472      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: bob.address});473474      // Nest a token as admin and try to unnest it, now belonging to someone else475      const nestedToken = await createItemExpectSuccess(alice, collection, 'NFT', targetAddress);476      await expect(executeTransaction(477        api, 478        alice, 479        api.tx.unique.transferFrom(targetAddress, normalizeAccountId(alice), collection, nestedToken, 1),480      ), 'while unnesting another\'s token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);481      expect(await getTokenOwner(api, collection, nestedToken)).to.be.deep.equal(targetAddress);482      expect(await getTopmostTokenOwner(api, collection, nestedToken)).to.be.deep.equal({Substrate: bob.address});483    });484  });485486  it('Admin (NFT): disallows an Admin to nest a token from an unlisted collection (Restricted nesting)', async () => {487    await usingApi(async api => {488      const collectionA = await createCollectionExpectSuccess({mode: {type: 'NFT'}});489      const collectionB = await createCollectionExpectSuccess({mode: {type: 'NFT'}});490      await setCollectionPermissionsExpectSuccess(alice, collectionA, {nesting: {collectionAdmin: true, restricted:[collectionA]}});491492      // Create a token to attempt to be nested into493      const targetToken = await createItemExpectSuccess(alice, collectionA, 'NFT');494495      // Try to create and nest a token in the wrong collection496      const newToken = await createItemExpectSuccess(alice, collectionB, 'NFT');497      await expect(executeTransaction(498        api, 499        alice, 500        api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionA, targetToken)}, collectionB, newToken, 1),501      ), 'while nesting a foreign token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);502      expect(await getTokenOwner(api, collectionB, newToken)).to.be.deep.equal({Substrate: alice.address});503    });504  });505506  // ---------- Non-Fungible ----------507508  it('NFT: disallows to nest token if nesting is disabled', async () => {509    await usingApi(async api => {510      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});511      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {}});512      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');513514      // Try to create a nested token515      await expect(executeTransaction(api, alice, api.tx.unique.createItem(516        collection,517        {Ethereum: tokenIdToAddress(collection, targetToken)},518          {nft: {}} as any,519      )), 'while creating nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);520521      // Create a token to be nested522      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');523      // Try to nest524      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);525      expect(await getTopmostTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});526      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});527    });528  });529530  it('NFT: disallows a non-Owner to nest someone else\'s token', async () => {531    await usingApi(async api => {532      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});533      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true}});534535      await addToAllowListExpectSuccess(alice, collection, bob.address);536      await enableAllowListExpectSuccess(alice, collection);537      await enablePublicMintingExpectSuccess(alice, collection);538539      // Create a token to attempt to be nested into540      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');541542      // Try to create a nested token in the wrong collection543      await expect(executeTransaction(api, alice, api.tx.unique.createItem(544        collection,545        {Ethereum: tokenIdToAddress(collection, targetToken)},546          {nft: {}} as any,547      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);548549      // Try to create and nest a token in the wrong collection550      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');551      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);552      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});553    });554  });555556  it('NFT: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {557    await usingApi(async api => {558      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});559      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[collection]}});560561      await addToAllowListExpectSuccess(alice, collection, bob.address);562      await enableAllowListExpectSuccess(alice, collection);563      await enablePublicMintingExpectSuccess(alice, collection);564565      // Create a token to attempt to be nested into566      const targetToken = await createItemExpectSuccess(bob, collection, 'NFT');567568      // Try to create a nested token in the wrong collection569      await expect(executeTransaction(api, alice, api.tx.unique.createItem(570        collection,571        {Ethereum: tokenIdToAddress(collection, targetToken)},572          {nft: {}} as any,573      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);574575      // Try to create and nest a token in the wrong collection576      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');577      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.AddressNotInAllowlist/);578      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});579    });580  });581582  it('NFT: disallows to nest token in an unlisted collection', async () => {583    await usingApi(async api => {584      const collection = await createCollectionExpectSuccess({mode: {type: 'NFT'}});585      await setCollectionPermissionsExpectSuccess(alice, collection, {nesting: {tokenOwner: true, restricted:[]}});586587      // Create a token to attempt to be nested into588      const targetToken = await createItemExpectSuccess(alice, collection, 'NFT');589590      // Try to create a nested token in the wrong collection591      await expect(executeTransaction(api, alice, api.tx.unique.createItem(592        collection,593        {Ethereum: tokenIdToAddress(collection, targetToken)},594          {nft: {}} as any,595      )), 'while creating nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);596597      // Try to create and nest a token in the wrong collection598      const newToken = await createItemExpectSuccess(alice, collection, 'NFT');599      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collection, targetToken)}, collection, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);600      expect(await getTokenOwner(api, collection, newToken)).to.be.deep.equal({Substrate: alice.address});601    });602  });603604  // ---------- Fungible ----------605606  it('Fungible: disallows to nest token if nesting is disabled', async () => {607    await usingApi(async api => {608      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});609      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}});610      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');611      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};612613      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});614615      // Try to create a nested token616      await expect(executeTransaction(api, alice, api.tx.unique.createItem(617        collectionFT,618        targetAddress,619        {Fungible: {Value: 10}},620      )), 'while creating nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);621622      // Create a token to be nested623      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');624      // Try to nest625      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);626627      // Create another token to be nested628      const newToken2 = await createItemExpectSuccess(alice, collectionFT, 'Fungible');629      // Try to nest inside a fungible token630      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionFT, newToken)}, collectionFT, newToken2, 1)), 'while nesting new token inside fungible').to.be.rejectedWith(/fungible\.FungibleDisallowsNesting/);631    });632  });633634  it('Fungible: disallows a non-Owner to nest someone else\'s token', async () => {635    await usingApi(async api => {636      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});637      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});638639      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);640      await enableAllowListExpectSuccess(alice, collectionNFT);641      await enablePublicMintingExpectSuccess(alice, collectionNFT);642643      // Create a token to attempt to be nested into644      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');645      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};646647      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});648649      // Try to create a nested token in the wrong collection650      await expect(executeTransaction(api, alice, api.tx.unique.createItem(651        collectionFT,652        targetAddress,653        {Fungible: {Value: 10}},654      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);655656      // Try to create and nest a token in the wrong collection657      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');658      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);659    });660  });661662  it('Fungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {663    await usingApi(async api => {664      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});665      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);666      await enableAllowListExpectSuccess(alice, collectionNFT);667      await enablePublicMintingExpectSuccess(alice, collectionNFT);668669      // Create a token to attempt to be nested into670      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');671      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};672673      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});674      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionFT]}});675676      // Try to create a nested token in the wrong collection677      await expect(executeTransaction(api, alice, api.tx.unique.createItem(678        collectionFT,679        targetAddress,680        {Fungible: {Value: 10}},681      )), 'while creating nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);682683      // Try to create and nest a token in the wrong collection684      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');685      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);686    });687  });688689  it('Fungible: disallows to nest token in an unlisted collection', async () => {690    await usingApi(async api => {691      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});692      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}});693694      // Create a token to attempt to be nested into695      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');696      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};697698      const collectionFT = await createCollectionExpectSuccess({mode: {type: 'Fungible', decimalPoints: 0}});699700      // Try to create a nested token in the wrong collection701      await expect(executeTransaction(api, alice, api.tx.unique.createItem(702        collectionFT,703        targetAddress,704        {Fungible: {Value: 10}},705      )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);706707      // Try to create and nest a token in the wrong collection708      const newToken = await createItemExpectSuccess(alice, collectionFT, 'Fungible');709      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);710    });711  });712713  // ---------- Re-Fungible ----------714715  it('ReFungible: disallows to nest token if nesting is disabled', async () => {716    await usingApi(async api => {717      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});718      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {}});719      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');720      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};721722      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});723724      // Create a nested token725      await expect(executeTransaction(api, alice, api.tx.unique.createItem(726        collectionRFT,727        targetAddress,728        {ReFungible: {pieces: 100}},729      )), 'while creating a nested token').to.be.rejectedWith(/^common\.UserIsNotAllowedToNest$/);730731      // Create a token to be nested732      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');733      // Try to nest734      await transferExpectFailure(collectionRFT, newToken, alice, targetAddress, 100);735      // Try to nest736      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);737738      // Create another token to be nested739      const newToken2 = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');740      // Try to nest inside a fungible token741      await expect(executeTransaction(api, alice, api.tx.unique.transfer({Ethereum: tokenIdToAddress(collectionRFT, newToken)}, collectionRFT, newToken2, 1)), 'while nesting new token inside refungible').to.be.rejectedWith(/refungible\.RefungibleDisallowsNesting/);742    });743  });744745  it('ReFungible: disallows a non-Owner to nest someone else\'s token', async () => {746    await usingApi(async api => {747      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});748      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true}});749750      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);751      await enableAllowListExpectSuccess(alice, collectionNFT);752      await enablePublicMintingExpectSuccess(alice, collectionNFT);753754      // Create a token to attempt to be nested into755      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');756      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};757758      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});759760      // Try to create a nested token in the wrong collection761      await expect(executeTransaction(api, alice, api.tx.unique.createItem(762        collectionRFT,763        targetAddress,764        {ReFungible: {pieces: 100}},765      )), 'while creating a nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);766767      // Try to create and nest a token in the wrong collection768      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');769      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);770    });771  });772773  it('ReFungible: disallows a non-Owner to nest someone else\'s token (Restricted nesting)', async () => {774    await usingApi(async api => {775      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});776      await addToAllowListExpectSuccess(alice, collectionNFT, bob.address);777      await enableAllowListExpectSuccess(alice, collectionNFT);778      await enablePublicMintingExpectSuccess(alice, collectionNFT);779780      // Create a token to attempt to be nested into781      const targetToken = await createItemExpectSuccess(bob, collectionNFT, 'NFT');782      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};783784      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});785      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[collectionRFT]}});786787      // Try to create a nested token in the wrong collection788      await expect(executeTransaction(api, alice, api.tx.unique.createItem(789        collectionRFT,790        targetAddress,791        {ReFungible: {pieces: 100}},792      )), 'while creating a nested token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);793794      // Try to create and nest a token in the wrong collection795      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');796      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.UserIsNotAllowedToNest/);797    });798  });799800  it('ReFungible: disallows to nest token to an unlisted collection', async () => {801    await usingApi(async api => {802      const collectionNFT = await createCollectionExpectSuccess({mode: {type: 'NFT'}});803      await setCollectionPermissionsExpectSuccess(alice, collectionNFT, {nesting: {tokenOwner: true, restricted:[]}});804805      // Create a token to attempt to be nested into806      const targetToken = await createItemExpectSuccess(alice, collectionNFT, 'NFT');807      const targetAddress = {Ethereum: tokenIdToAddress(collectionNFT, targetToken)};808809      const collectionRFT = await createCollectionExpectSuccess({mode: {type: 'ReFungible'}});810811      // Try to create a nested token in the wrong collection812      await expect(executeTransaction(api, alice, api.tx.unique.createItem(813        collectionRFT,814        targetAddress,815        {ReFungible: {pieces: 100}},816      )), 'while creating a nested token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);817818      // Try to create and nest a token in the wrong collection819      const newToken = await createItemExpectSuccess(alice, collectionRFT, 'ReFungible');820      await expect(executeTransaction(api, alice, api.tx.unique.transfer(targetAddress, collectionRFT, newToken, 1)), 'while nesting new token').to.be.rejectedWith(/common\.SourceCollectionIsNotAllowedToNest/);821    });822  });823});