git.delta.rocks / unique-network / refs/commits / 3f089fc34b06

difftreelog

refactor EthCrossAccount impl, signature some evm methods, tests and stubs

PraetorP2022-12-14parent: #1f3c059.patch.diff
in: master

16 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -36,7 +36,7 @@
 use crate::{
 	Pallet, CollectionHandle, Config, CollectionProperties, SelfWeightOf,
 	eth::{
-		EthCrossAccount, convert_cross_account_to_uint256, CollectionPermissions as EvmPermissions,
+		EthCrossAccount, CollectionPermissions as EvmPermissions,
 		CollectionLimits as EvmCollectionLimits,
 	},
 	weights::WeightInfo,
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
--- a/pallets/common/src/eth.rs
+++ b/pallets/common/src/eth.rs
@@ -53,15 +53,6 @@
 	address[0..16] == ETH_COLLECTION_PREFIX
 }
 
-/// Convert `CrossAccountId` to `uint256`.
-pub fn convert_cross_account_to_uint256<T: Config>(from: &T::CrossAccountId) -> uint256
-where
-	T::AccountId: AsRef<[u8; 32]>,
-{
-	let slice = from.as_sub().as_ref();
-	uint256::from_big_endian(slice)
-}
-
 /// Convert `uint256` to `CrossAccountId`.
 pub fn convert_uint256_to_cross_account<T: Config>(from: uint256) -> T::CrossAccountId
 where
@@ -71,22 +62,6 @@
 	from.to_big_endian(&mut new_admin_arr);
 	let account_id = T::AccountId::from(new_admin_arr);
 	T::CrossAccountId::from_sub(account_id)
-}
-
-/// Convert `CrossAccountId` to `(address, uint256)`.
-pub fn convert_cross_account_to_tuple<T: Config>(
-	cross_account_id: &T::CrossAccountId,
-) -> (address, uint256)
-where
-	T::AccountId: AsRef<[u8; 32]>,
-{
-	if cross_account_id.is_canonical_substrate() {
-		let sub = convert_cross_account_to_uint256::<T>(cross_account_id);
-		(Default::default(), sub)
-	} else {
-		let eth = *cross_account_id.as_eth();
-		(eth, Default::default())
-	}
 }
 
 /// Convert tuple `(address, uint256)` to `CrossAccountId`.
@@ -128,10 +103,7 @@
 		T::AccountId: AsRef<[u8; 32]>,
 	{
 		if cross_account_id.is_canonical_substrate() {
-			Self {
-				eth: Default::default(),
-				sub: convert_cross_account_to_uint256::<T>(cross_account_id),
-			}
+			Self::from_sub::<T>(cross_account_id.as_sub())
 		} else {
 			Self {
 				eth: *cross_account_id.as_eth(),
modifiedpallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -50,6 +50,7 @@
     "pallet-evm-coder-substrate/std",
     "pallet-evm/std",
     "up-sponsorship/std",
+    "pallet-common/std",
 ]
 try-runtime = ["frame-support/try-runtime"]
-stubgen = ["evm-coder/stubgen"]
+stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -175,18 +175,11 @@
 	///
 	/// @param contractAddress The contract for which a sponsor is requested.
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
-	fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
-		let sponsor =
-			Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
-		Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
-			&sponsor,
+	fn sponsor(&self, contract_address: address) -> Result<EthCrossAccount> {
+		Ok(EthCrossAccount::from_sub_cross_account::<T>(
+			&Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,
 		))
 	}
-	// fn sponsor(&self, contract_address: address) -> Result<EthCrossAccount> {
-	// 	Ok(EthCrossAccount::from_sub_cross_account::<T>(
-	// 		&Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?,
-	// 	))
-	// }
 
 	/// Check tat contract has confirmed sponsor.
 	///
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -96,11 +96,11 @@
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
 	/// @dev EVM selector for this function is: 0x766c4f37,
 	///  or in textual repr: sponsor(address)
-	function sponsor(address contractAddress) public view returns (Tuple0 memory) {
+	function sponsor(address contractAddress) public view returns (EthCrossAccount memory) {
 		require(false, stub_error);
 		contractAddress;
 		dummy;
-		return Tuple0(0x0000000000000000000000000000000000000000, 0);
+		return EthCrossAccount(0x0000000000000000000000000000000000000000, 0);
 	}
 
 	/// Check tat contract has confirmed sponsor.
@@ -265,8 +265,8 @@
 	}
 }
 
-/// @dev anonymous struct
-struct Tuple0 {
-	address field_0;
-	uint256 field_1;
+/// @dev Cross account struct
+struct EthCrossAccount {
+	address eth;
+	uint256 sub;
 }
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -605,7 +605,7 @@
 		Ok(false)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	#[weight(<SelfWeightOf<T>>::create_item())]
@@ -618,7 +618,7 @@
 		Ok(token_id)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @dev `tokenId` should be obtained with `nextTokenId` method,
 	///  unlike standard, you can't specify it manually
 	/// @param to The new owner
@@ -1070,7 +1070,7 @@
 		Ok(true)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -738,7 +738,7 @@
 		return false;
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
@@ -750,7 +750,7 @@
 		return 0;
 	}
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -995,7 +995,7 @@
 	// 	return false;
 	// }
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -637,7 +637,7 @@
 		Ok(false)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	#[weight(<SelfWeightOf<T>>::create_item())]
@@ -650,7 +650,7 @@
 		Ok(token_id)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @dev `tokenId` should be obtained with `nextTokenId` method,
 	///  unlike standard, you can't specify it manually
 	/// @param to The new owner
@@ -1120,7 +1120,7 @@
 		Ok(true)
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -733,7 +733,7 @@
 		return false;
 	}
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
@@ -745,7 +745,7 @@
 		return 0;
 	}
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -979,7 +979,7 @@
 	// 	return false;
 	// }
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedtests/src/eth/abi/contractHelpers.jsondiffbeforeafterboth
before · tests/src/eth/abi/contractHelpers.json
1[2  {3    "anonymous": false,4    "inputs": [5      {6        "indexed": true,7        "internalType": "address",8        "name": "contractAddress",9        "type": "address"10      }11    ],12    "name": "ContractSponsorRemoved",13    "type": "event"14  },15  {16    "anonymous": false,17    "inputs": [18      {19        "indexed": true,20        "internalType": "address",21        "name": "contractAddress",22        "type": "address"23      },24      {25        "indexed": false,26        "internalType": "address",27        "name": "sponsor",28        "type": "address"29      }30    ],31    "name": "ContractSponsorSet",32    "type": "event"33  },34  {35    "anonymous": false,36    "inputs": [37      {38        "indexed": true,39        "internalType": "address",40        "name": "contractAddress",41        "type": "address"42      },43      {44        "indexed": false,45        "internalType": "address",46        "name": "sponsor",47        "type": "address"48      }49    ],50    "name": "ContractSponsorshipConfirmed",51    "type": "event"52  },53  {54    "inputs": [55      {56        "internalType": "address",57        "name": "contractAddress",58        "type": "address"59      },60      { "internalType": "address", "name": "user", "type": "address" }61    ],62    "name": "allowed",63    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],64    "stateMutability": "view",65    "type": "function"66  },67  {68    "inputs": [69      {70        "internalType": "address",71        "name": "contractAddress",72        "type": "address"73      }74    ],75    "name": "allowlistEnabled",76    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],77    "stateMutability": "view",78    "type": "function"79  },80  {81    "inputs": [82      {83        "internalType": "address",84        "name": "contractAddress",85        "type": "address"86      }87    ],88    "name": "confirmSponsorship",89    "outputs": [],90    "stateMutability": "nonpayable",91    "type": "function"92  },93  {94    "inputs": [95      {96        "internalType": "address",97        "name": "contractAddress",98        "type": "address"99      }100    ],101    "name": "contractOwner",102    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],103    "stateMutability": "view",104    "type": "function"105  },106  {107    "inputs": [108      {109        "internalType": "address",110        "name": "contractAddress",111        "type": "address"112      }113    ],114    "name": "hasPendingSponsor",115    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],116    "stateMutability": "view",117    "type": "function"118  },119  {120    "inputs": [121      {122        "internalType": "address",123        "name": "contractAddress",124        "type": "address"125      }126    ],127    "name": "hasSponsor",128    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],129    "stateMutability": "view",130    "type": "function"131  },132  {133    "inputs": [134      {135        "internalType": "address",136        "name": "contractAddress",137        "type": "address"138      }139    ],140    "name": "removeSponsor",141    "outputs": [],142    "stateMutability": "nonpayable",143    "type": "function"144  },145  {146    "inputs": [147      {148        "internalType": "address",149        "name": "contractAddress",150        "type": "address"151      }152    ],153    "name": "selfSponsoredEnable",154    "outputs": [],155    "stateMutability": "nonpayable",156    "type": "function"157  },158  {159    "inputs": [160      {161        "internalType": "address",162        "name": "contractAddress",163        "type": "address"164      },165      { "internalType": "address", "name": "sponsor", "type": "address" }166    ],167    "name": "setSponsor",168    "outputs": [],169    "stateMutability": "nonpayable",170    "type": "function"171  },172  {173    "inputs": [174      {175        "internalType": "address",176        "name": "contractAddress",177        "type": "address"178      },179      { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }180    ],181    "name": "setSponsoringFeeLimit",182    "outputs": [],183    "stateMutability": "nonpayable",184    "type": "function"185  },186  {187    "inputs": [188      {189        "internalType": "address",190        "name": "contractAddress",191        "type": "address"192      },193      { "internalType": "uint8", "name": "mode", "type": "uint8" }194    ],195    "name": "setSponsoringMode",196    "outputs": [],197    "stateMutability": "nonpayable",198    "type": "function"199  },200  {201    "inputs": [202      {203        "internalType": "address",204        "name": "contractAddress",205        "type": "address"206      },207      { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }208    ],209    "name": "setSponsoringRateLimit",210    "outputs": [],211    "stateMutability": "nonpayable",212    "type": "function"213  },214  {215    "inputs": [216      {217        "internalType": "address",218        "name": "contractAddress",219        "type": "address"220      }221    ],222    "name": "sponsor",223    "outputs": [224      {225        "components": [226          { "internalType": "address", "name": "field_0", "type": "address" },227          { "internalType": "uint256", "name": "field_1", "type": "uint256" }228        ],229        "internalType": "struct Tuple0",230        "name": "",231        "type": "tuple"232      }233    ],234    "stateMutability": "view",235    "type": "function"236  },237  {238    "inputs": [239      {240        "internalType": "address",241        "name": "contractAddress",242        "type": "address"243      }244    ],245    "name": "sponsoringEnabled",246    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],247    "stateMutability": "view",248    "type": "function"249  },250  {251    "inputs": [252      {253        "internalType": "address",254        "name": "contractAddress",255        "type": "address"256      }257    ],258    "name": "sponsoringFeeLimit",259    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],260    "stateMutability": "view",261    "type": "function"262  },263  {264    "inputs": [265      {266        "internalType": "address",267        "name": "contractAddress",268        "type": "address"269      }270    ],271    "name": "sponsoringRateLimit",272    "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],273    "stateMutability": "view",274    "type": "function"275  },276  {277    "inputs": [278      { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }279    ],280    "name": "supportsInterface",281    "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],282    "stateMutability": "view",283    "type": "function"284  },285  {286    "inputs": [287      {288        "internalType": "address",289        "name": "contractAddress",290        "type": "address"291      },292      { "internalType": "address", "name": "user", "type": "address" },293      { "internalType": "bool", "name": "isAllowed", "type": "bool" }294    ],295    "name": "toggleAllowed",296    "outputs": [],297    "stateMutability": "nonpayable",298    "type": "function"299  },300  {301    "inputs": [302      {303        "internalType": "address",304        "name": "contractAddress",305        "type": "address"306      },307      { "internalType": "bool", "name": "enabled", "type": "bool" }308    ],309    "name": "toggleAllowlist",310    "outputs": [],311    "stateMutability": "nonpayable",312    "type": "function"313  }314]
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -69,7 +69,7 @@
 	/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
 	/// @dev EVM selector for this function is: 0x766c4f37,
 	///  or in textual repr: sponsor(address)
-	function sponsor(address contractAddress) external view returns (Tuple0 memory);
+	function sponsor(address contractAddress) external view returns (EthCrossAccount memory);
 
 	/// Check tat contract has confirmed sponsor.
 	///
@@ -171,8 +171,8 @@
 	function toggleAllowlist(address contractAddress, bool enabled) external;
 }
 
-/// @dev anonymous struct
-struct Tuple0 {
-	address field_0;
-	uint256 field_1;
+/// @dev Cross account struct
+struct EthCrossAccount {
+	address eth;
+	uint256 sub;
 }
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -515,14 +515,14 @@
 	///  or in textual repr: mintingFinished()
 	function mintingFinished() external view returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
 	///  or in textual repr: mint(address)
 	function mint(address to) external returns (uint256);
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -674,7 +674,7 @@
 	// ///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
 	// function mintBulkWithTokenURI(address to, Tuple13[] memory tokens) external returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -513,14 +513,14 @@
 	///  or in textual repr: mintingFinished()
 	function mintingFinished() external view returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner
 	/// @return uint256 The id of the newly minted token
 	/// @dev EVM selector for this function is: 0x6a627842,
 	///  or in textual repr: mint(address)
 	function mint(address to) external returns (uint256);
 
-	// /// @notice Function to mint token.
+	// /// @notice Function to a mint token.
 	// /// @dev `tokenId` should be obtained with `nextTokenId` method,
 	// ///  unlike standard, you can't specify it manually
 	// /// @param to The new owner
@@ -666,7 +666,7 @@
 	// ///  or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
 	// function mintBulkWithTokenURI(address to, Tuple12[] memory tokens) external returns (bool);
 
-	/// @notice Function to mint token.
+	/// @notice Function to a mint token.
 	/// @param to The new owner crossAccountId
 	/// @param properties Properties of minted token
 	/// @return uint256 The id of the newly minted token
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -17,7 +17,6 @@
 import {itEth, usingEthPlaygrounds, expect, EthUniqueHelper} from './util';
 import {IKeyringPair} from '@polkadot/types/types';
 import {Contract} from 'web3-eth-contract';
-import exp from 'constants';
 import {ITokenPropertyPermission} from '../util/playgrounds/types';
 
 
@@ -180,9 +179,16 @@
     const caller = await helper.eth.createAccountWithBalance(donor);
     const receiverCross = helper.ethCrossAccount.fromKeyringPair(bob);
     const properties = Array(5).fill(0).map((_, i) => { return {key: `key_${i}`, value: Buffer.from(`value_${i}`)}; });
-    const permissions: ITokenPropertyPermission[] = properties.map(p => { return {key: p.key, permission: {tokenOwner: true,
-      collectionAdmin: true,
-      mutable: true}}; });
+    const permissions: ITokenPropertyPermission[] = properties
+      .map(p => {
+        return {
+          key: p.key, permission: {
+            tokenOwner: true,
+            collectionAdmin: true,
+            mutable: true,
+          },
+        };
+      });
     
     
     const collection = await helper.nft.mintCollection(minter, {
@@ -198,7 +204,7 @@
     let tokenId = result.events.Transfer.returnValues.tokenId;
     expect(tokenId).to.be.equal(expectedTokenId);
 
-    const event = result.events.Transfer;
+    let event = result.events.Transfer;
     expect(event.address).to.be.equal(collectionAddress);
     expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
     expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
@@ -206,10 +212,16 @@
     
     expectedTokenId = await contract.methods.nextTokenId().call();
     result = await contract.methods.mintCross(receiverCross, properties).send();
+    event = result.events.Transfer;
+    expect(event.address).to.be.equal(collectionAddress);
+    expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
+    expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
+    expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
+    
     tokenId = result.events.Transfer.returnValues.tokenId;
-
+    
     expect(tokenId).to.be.equal(expectedTokenId);
-    
+
     expect(await contract.methods.properties(tokenId, []).call()).to.be.like(properties
       .map(p => { return helper.ethProperty.property(p.key, p.value.toString()); }));
   });
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/reFungible.test.ts
+++ b/tests/src/eth/reFungible.test.ts
@@ -17,7 +17,7 @@
 import {Pallets, requirePalletsOrSkip} from '../util';
 import {expect, itEth, usingEthPlaygrounds} from './util';
 import {IKeyringPair} from '@polkadot/types/types';
-import { ITokenPropertyPermission } from '../util/playgrounds/types';
+import {ITokenPropertyPermission} from '../util/playgrounds/types';
 
 describe('Refungible: Information getting', () => {
   let donor: IKeyringPair;
@@ -159,7 +159,7 @@
     let tokenId = result.events.Transfer.returnValues.tokenId;
     expect(tokenId).to.be.equal(expectedTokenId);
 
-    const event = result.events.Transfer;
+    let event = result.events.Transfer;
     expect(event.address).to.be.equal(collectionAddress);
     expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
     expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
@@ -167,6 +167,12 @@
     
     expectedTokenId = await contract.methods.nextTokenId().call();
     result = await contract.methods.mintCross(receiverCross, properties).send();
+    event = result.events.Transfer;
+    expect(event.address).to.be.equal(collectionAddress);
+    expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000');
+    expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(bob.address));
+    expect(await contract.methods.properties(tokenId, []).call()).to.be.like([]);
+    
     tokenId = result.events.Transfer.returnValues.tokenId;
 
     expect(tokenId).to.be.equal(expectedTokenId);