git.delta.rocks / unique-network / refs/commits / b30d78a48678

difftreelog

added substrate interraction in tests `transferCross`

PraetorP2022-11-15parent: #bbafef4.patch.diff
in: master

3 files changed

modifiedtests/src/eth/fungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/fungible.test.ts
+++ b/tests/src/eth/fungible.test.ts
@@ -234,6 +234,7 @@
     const owner = await helper.eth.createAccountWithBalance(donor);
     const receiver = await helper.eth.createAccountWithBalance(donor);
     const to = helper.ethCrossAccount.fromAddress(receiver);
+    const toSubstrate = helper.ethCrossAccount.fromKeyringPair(donor);
     const collection = await helper.ft.mintCollection(alice);
     await collection.mint(alice, 200n, {Ethereum: owner});
 
@@ -259,6 +260,27 @@
       const balance = await contract.methods.balanceOf(receiver).call();
       expect(+balance).to.equal(50);
     }
+    
+    {
+      const result = await contract.methods.transferCross(toSubstrate, 50).send({from: owner});
+      
+      const event = result.events.Transfer;
+      expect(event.address).to.be.equal(collectionAddress);
+      expect(event.returnValues.from).to.be.equal(owner);
+      expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(donor.address));
+      expect(event.returnValues.value).to.be.equal('50');
+    }
+
+    {
+      const balance = await collection.getBalance({Ethereum: owner});
+      expect(balance).to.equal(100n);
+    }
+
+    {
+      const balance = await collection.getBalance({Substrate: donor.address});
+      expect(balance).to.equal(50n);
+    }
+    
   });
   
   itEth('Can perform transfer()', async ({helper}) => {
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
--- a/tests/src/eth/nonFungible.test.ts
+++ b/tests/src/eth/nonFungible.test.ts
@@ -406,8 +406,10 @@
   itEth('Can perform transferCross()', async ({helper}) => {
     const collection = await helper.nft.mintCollection(minter, {});
     const owner = await helper.eth.createAccountWithBalance(donor);
-    const receiver = helper.eth.createAccount();
+    const receiver = await helper.eth.createAccountWithBalance(donor);
     const to = helper.ethCrossAccount.fromAddress(receiver);
+    const toSubstrate = helper.ethCrossAccount.fromKeyringPair(minter);
+    
     const {tokenId} = await collection.mintToken(minter, {Ethereum: owner});
 
     const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId);
@@ -432,6 +434,27 @@
       const balance = await contract.methods.balanceOf(receiver).call();
       expect(+balance).to.equal(1);
     }
+    
+    {
+      const substrateResult = await contract.methods.transferCross(toSubstrate, tokenId).send({from: receiver});
+      
+
+      const event = substrateResult.events.Transfer;
+      expect(event.address).to.be.equal(collectionAddress);
+      expect(event.returnValues.from).to.be.equal(receiver);
+      expect(event.returnValues.to).to.be.equal(helper.address.substrateToEth(minter.address));
+      expect(event.returnValues.tokenId).to.be.equal(`${tokenId}`);
+    }
+
+    {
+      const balance = await contract.methods.balanceOf(receiver).call();
+      expect(+balance).to.equal(0);
+    }
+
+    {
+      const balance = await helper.nft.getTokensByAddress(collection.collectionId, {Substrate: minter.address});
+      expect(balance).to.be.contain(tokenId);
+    }
   });
 });
 
modifiedtests/src/eth/reFungible.test.tsdiffbeforeafterboth
before · tests/src/eth/reFungible.test.ts
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617import {Pallets, requirePalletsOrSkip} from '../util';18import {expect, itEth, usingEthPlaygrounds} from './util';19import {IKeyringPair} from '@polkadot/types/types';2021describe('Refungible: Information getting', () => {22  let donor: IKeyringPair;2324  before(async function() {25    await usingEthPlaygrounds(async (helper, privateKey) => {26      requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);2728      donor = await privateKey({filename: __filename});29    });30  });3132  itEth('totalSupply', async ({helper}) => {33    const caller = await helper.eth.createAccountWithBalance(donor);34    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'TotalSupply', '6', '6');35    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);3637    await contract.methods.mint(caller).send();3839    const totalSupply = await contract.methods.totalSupply().call();40    expect(totalSupply).to.equal('1');41  });4243  itEth('balanceOf', async ({helper}) => {44    const caller = await helper.eth.createAccountWithBalance(donor);45    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'BalanceOf', '6', '6');46    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);4748    await contract.methods.mint(caller).send();49    await contract.methods.mint(caller).send();50    await contract.methods.mint(caller).send();5152    const balance = await contract.methods.balanceOf(caller).call();53    expect(balance).to.equal('3');54  });5556  itEth('ownerOf', async ({helper}) => {57    const caller = await helper.eth.createAccountWithBalance(donor);58    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf', '6', '6');59    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);6061    const result = await contract.methods.mint(caller).send();62    const tokenId = result.events.Transfer.returnValues.tokenId;6364    const owner = await contract.methods.ownerOf(tokenId).call();65    expect(owner).to.equal(caller);66  });6768  itEth('ownerOf after burn', async ({helper}) => {69    const caller = await helper.eth.createAccountWithBalance(donor);70    const receiver = helper.eth.createAccount();71    const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'OwnerOf-AfterBurn', '6', '6');72    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);7374    const result = await contract.methods.mint(caller).send();75    const tokenId = result.events.Transfer.returnValues.tokenId;76    const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);7778    await tokenContract.methods.repartition(2).send();79    await tokenContract.methods.transfer(receiver, 1).send();8081    await tokenContract.methods.burnFrom(caller, 1).send();8283    const owner = await contract.methods.ownerOf(tokenId).call();84    expect(owner).to.equal(receiver);85  });8687  itEth('ownerOf for partial ownership', async ({helper}) => {88    const caller = await helper.eth.createAccountWithBalance(donor);89    const receiver = helper.eth.createAccount();90    const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Partial-OwnerOf', '6', '6');91    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);9293    const result = await contract.methods.mint(caller).send();94    const tokenId = result.events.Transfer.returnValues.tokenId;95    const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);9697    await tokenContract.methods.repartition(2).send();98    await tokenContract.methods.transfer(receiver, 1).send();99100    const owner = await contract.methods.ownerOf(tokenId).call();101    expect(owner).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF');102  });103});104105describe('Refungible: Plain calls', () => {106  let donor: IKeyringPair;107  let minter: IKeyringPair;108  let bob: IKeyringPair;109  let charlie: IKeyringPair;110111  before(async function() {112    await usingEthPlaygrounds(async (helper, privateKey) => {113      requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);114115      donor = await privateKey({filename: __filename});116      [minter, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);117    });118  });119120  itEth('Can perform mint()', async ({helper}) => {121    const owner = await helper.eth.createAccountWithBalance(donor);122    const receiver = helper.eth.createAccount();123    const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Minty', '6', '6', '');124    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);125126    const result = await contract.methods.mintWithTokenURI(receiver, 'Test URI').send();127128    const event = result.events.Transfer;129    expect(event.address).to.equal(collectionAddress);130    expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000');131    expect(event.returnValues.to).to.equal(receiver);132    const tokenId = event.returnValues.tokenId;133    expect(tokenId).to.be.equal('1');134135    expect(await contract.methods.tokenURI(tokenId).call()).to.be.equal('Test URI');136  });137138  itEth.skip('Can perform mintBulk()', async ({helper}) => {139    const owner = await helper.eth.createAccountWithBalance(donor);140    const receiver = helper.eth.createAccount();141    const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'MintBulky', '6', '6', '');142    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);143144    {145      const nextTokenId = await contract.methods.nextTokenId().call();146      expect(nextTokenId).to.be.equal('1');147      const result = await contract.methods.mintBulkWithTokenURI(148        receiver,149        [150          [nextTokenId, 'Test URI 0'],151          [+nextTokenId + 1, 'Test URI 1'],152          [+nextTokenId + 2, 'Test URI 2'],153        ],154      ).send();155156      const events = result.events.Transfer;157      for (let i = 0; i < 2; i++) {158        const event = events[i];159        expect(event.address).to.equal(collectionAddress);160        expect(event.returnValues.from).to.equal('0x0000000000000000000000000000000000000000');161        expect(event.returnValues.to).to.equal(receiver);162        expect(event.returnValues.tokenId).to.equal(String(+nextTokenId + i));163      }164165      expect(await contract.methods.tokenURI(nextTokenId).call()).to.be.equal('Test URI 0');166      expect(await contract.methods.tokenURI(+nextTokenId + 1).call()).to.be.equal('Test URI 1');167      expect(await contract.methods.tokenURI(+nextTokenId + 2).call()).to.be.equal('Test URI 2');168    }169  });170171  itEth('Can perform burn()', async ({helper}) => {172    const caller = await helper.eth.createAccountWithBalance(donor);173    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Burny', '6', '6');174    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);175176    const result = await contract.methods.mint(caller).send();177    const tokenId = result.events.Transfer.returnValues.tokenId;178    {179      const result = await contract.methods.burn(tokenId).send();180      const event = result.events.Transfer;181      expect(event.address).to.equal(collectionAddress);182      expect(event.returnValues.from).to.equal(caller);183      expect(event.returnValues.to).to.equal('0x0000000000000000000000000000000000000000');184      expect(event.returnValues.tokenId).to.equal(tokenId.toString());185    }186  });187188  itEth('Can perform transferFrom()', async ({helper}) => {189    const caller = await helper.eth.createAccountWithBalance(donor);190    const receiver = helper.eth.createAccount();191    const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'TransferFromy', '6', '6');192    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);193194    const result = await contract.methods.mint(caller).send();195    const tokenId = result.events.Transfer.returnValues.tokenId;196197    const tokenAddress = helper.ethAddress.fromTokenId(collectionId, tokenId);198199    const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, caller);200    await tokenContract.methods.repartition(15).send();201202    {203      const tokenEvents: any = [];204      tokenContract.events.allEvents((_: any, event: any) => {205        tokenEvents.push(event);206      });207      const result = await contract.methods.transferFrom(caller, receiver, tokenId).send();208      if (tokenEvents.length == 0) await helper.wait.newBlocks(1);209210      let event = result.events.Transfer;211      expect(event.address).to.equal(collectionAddress);212      expect(event.returnValues.from).to.equal(caller);213      expect(event.returnValues.to).to.equal(receiver);214      expect(event.returnValues.tokenId).to.equal(tokenId.toString());215216      event = tokenEvents[0];217      expect(event.address).to.equal(tokenAddress);218      expect(event.returnValues.from).to.equal(caller);219      expect(event.returnValues.to).to.equal(receiver);220      expect(event.returnValues.value).to.equal('15');221    }222223    {224      const balance = await contract.methods.balanceOf(receiver).call();225      expect(+balance).to.equal(1);226    }227228    {229      const balance = await contract.methods.balanceOf(caller).call();230      expect(+balance).to.equal(0);231    }232  });233234  itEth('Can perform burnFrom()', async ({helper}) => {235    const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});236237    const owner = await helper.eth.createAccountWithBalance(donor, 100n);238    const spender = await helper.eth.createAccountWithBalance(donor, 100n);239240    const token = await collection.mintToken(minter, 100n, {Ethereum: owner});241242    const address = helper.ethAddress.fromCollectionId(collection.collectionId);243    const contract = helper.ethNativeContract.collection(address, 'rft');244245    const tokenAddress = helper.ethAddress.fromTokenId(collection.collectionId, token.tokenId);246    const tokenContract = helper.ethNativeContract.rftToken(tokenAddress, owner);247    await tokenContract.methods.repartition(15).send();248    await tokenContract.methods.approve(spender, 15).send();249250    {251      const result = await contract.methods.burnFrom(owner, token.tokenId).send({from: spender});252      const event = result.events.Transfer;253      expect(event).to.be.like({254        address: helper.ethAddress.fromCollectionId(collection.collectionId),255        event: 'Transfer',256        returnValues: {257          from: owner,258          to: '0x0000000000000000000000000000000000000000',259          tokenId: token.tokenId.toString(),260        },261      });262    }263264    expect(await collection.getTokenBalance(token.tokenId, {Ethereum: owner})).to.be.eq(0n);265  });266267  itEth('Can perform burnFromCross()', async ({helper}) => {268    const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});269    270    const owner = bob;271    const spender = await helper.eth.createAccountWithBalance(donor, 100n);272273    const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});274275    const address = helper.ethAddress.fromCollectionId(collection.collectionId);276    const contract = helper.ethNativeContract.collection(address, 'rft');277278    await token.repartition(owner, 15n);279    await token.approve(owner, {Ethereum: spender}, 15n);280281    {282      const ownerCross = helper.ethCrossAccount.fromKeyringPair(owner);283      const result = await contract.methods.burnFromCross(ownerCross, token.tokenId).send({from: spender});284      const event = result.events.Transfer;285      expect(event).to.be.like({286        address: helper.ethAddress.fromCollectionId(collection.collectionId),287        event: 'Transfer',288        returnValues: {289          from: helper.address.substrateToEth(owner.address),290          to: '0x0000000000000000000000000000000000000000',291          tokenId: token.tokenId.toString(),292        },293      });294    }295296    expect(await collection.getTokenBalance(token.tokenId, {Substrate: owner.address})).to.be.eq(0n);297  });298299  itEth('Can perform transferFromCross()', async ({helper}) => {300    const collection = await helper.rft.mintCollection(minter, {name: 'A', description: 'B', tokenPrefix: 'C'});301302    const owner = bob;303    const spender = await helper.eth.createAccountWithBalance(donor, 100n);304    const receiver = charlie;305306    const token = await collection.mintToken(minter, 100n, {Substrate: owner.address});307308    const address = helper.ethAddress.fromCollectionId(collection.collectionId);309    const contract = helper.ethNativeContract.collection(address, 'rft');310311    await token.repartition(owner, 15n);312    await token.approve(owner, {Ethereum: spender}, 15n);313314    {315      const ownerCross = helper.ethCrossAccount.fromKeyringPair(owner);316      const recieverCross = helper.ethCrossAccount.fromKeyringPair(receiver);317      const result = await contract.methods.transferFromCross(ownerCross, recieverCross, token.tokenId).send({from: spender});318      const event = result.events.Transfer;319      expect(event).to.be.like({320        address: helper.ethAddress.fromCollectionId(collection.collectionId),321        event: 'Transfer',322        returnValues: {323          from: helper.address.substrateToEth(owner.address),324          to: helper.address.substrateToEth(receiver.address),325          tokenId: token.tokenId.toString(),326        },327      });328    }329330    expect(await token.getTop10Owners()).to.be.like([{Substrate: receiver.address}]);331  });332333  itEth('Can perform transfer()', async ({helper}) => {334    const caller = await helper.eth.createAccountWithBalance(donor);335    const receiver = helper.eth.createAccount();336    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry', '6', '6');337    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);338339    const result = await contract.methods.mint(caller).send();340    const tokenId = result.events.Transfer.returnValues.tokenId;341342    {343      const result = await contract.methods.transfer(receiver, tokenId).send();344345      const event = result.events.Transfer;346      expect(event.address).to.equal(collectionAddress);347      expect(event.returnValues.from).to.equal(caller);348      expect(event.returnValues.to).to.equal(receiver);349      expect(event.returnValues.tokenId).to.equal(tokenId.toString());350    }351352    {353      const balance = await contract.methods.balanceOf(caller).call();354      expect(+balance).to.equal(0);355    }356357    {358      const balance = await contract.methods.balanceOf(receiver).call();359      expect(+balance).to.equal(1);360    }361  });362  363  itEth('Can perform transferCross()', async ({helper}) => {364    const caller = await helper.eth.createAccountWithBalance(donor);365    const receiver = helper.eth.createAccount();366    const to = helper.ethCrossAccount.fromAddress(receiver);367    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry', '6', '6');368    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);369370    const result = await contract.methods.mint(caller).send();371    const tokenId = result.events.Transfer.returnValues.tokenId;372373    {374      const result = await contract.methods.transferCross(to, tokenId).send({from: caller});375376      const event = result.events.Transfer;377      expect(event.address).to.equal(collectionAddress);378      expect(event.returnValues.from).to.equal(caller);379      expect(event.returnValues.to).to.equal(receiver);380      expect(event.returnValues.tokenId).to.equal(tokenId.toString());381    }382383    {384      const balance = await contract.methods.balanceOf(caller).call();385      expect(+balance).to.equal(0);386    }387388    {389      const balance = await contract.methods.balanceOf(receiver).call();390      expect(+balance).to.equal(1);391    }392  });393394  itEth('transfer event on transfer from partial ownership to full ownership', async ({helper}) => {395    const caller = await helper.eth.createAccountWithBalance(donor);396    const receiver = helper.eth.createAccount();397    const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Partial-to-Full', '6', '6');398    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);399400    const result = await contract.methods.mint(caller).send();401    const tokenId = result.events.Transfer.returnValues.tokenId;402403    const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);404405    await tokenContract.methods.repartition(2).send();406    await tokenContract.methods.transfer(receiver, 1).send();407408    const events: any = [];409    contract.events.allEvents((_: any, event: any) => {410      events.push(event);411    });412413    await tokenContract.methods.transfer(receiver, 1).send();414    if (events.length == 0) await helper.wait.newBlocks(1);415    const event = events[0];416417    expect(event.address).to.equal(collectionAddress);418    expect(event.returnValues.from).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF');419    expect(event.returnValues.to).to.equal(receiver);420    expect(event.returnValues.tokenId).to.equal(tokenId.toString());421  });422423  itEth('transfer event on transfer from full ownership to partial ownership', async ({helper}) => {424    const caller = await helper.eth.createAccountWithBalance(donor);425    const receiver = helper.eth.createAccount();426    const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(caller, 'Transferry-Full-to-Partial', '6', '6');427    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);428429    const result = await contract.methods.mint(caller).send();430    const tokenId = result.events.Transfer.returnValues.tokenId;431432    const tokenContract = helper.ethNativeContract.rftTokenById(collectionId, tokenId, caller);433434    await tokenContract.methods.repartition(2).send();435436    const events: any = [];437    contract.events.allEvents((_: any, event: any) => {438      events.push(event);439    });440441    await tokenContract.methods.transfer(receiver, 1).send();442    if (events.length == 0) await helper.wait.newBlocks(1);443    const event = events[0];444445    expect(event.address).to.equal(collectionAddress);446    expect(event.returnValues.from).to.equal(caller);447    expect(event.returnValues.to).to.equal('0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF');448    expect(event.returnValues.tokenId).to.equal(tokenId.toString());449  });450});451452describe('RFT: Fees', () => {453  let donor: IKeyringPair;454455  before(async function() {456    await usingEthPlaygrounds(async (helper, privateKey) => {457      requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);458459      donor = await privateKey({filename: __filename});460    });461  });462463  itEth('transferFrom() call fee is less than 0.2UNQ', async ({helper}) => {464    const caller = await helper.eth.createAccountWithBalance(donor);465    const receiver = helper.eth.createAccount();466    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer-From', '6', '6');467    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);468469    const result = await contract.methods.mint(caller).send();470    const tokenId = result.events.Transfer.returnValues.tokenId;471472    const cost = await helper.eth.recordCallFee(caller, () => contract.methods.transferFrom(caller, receiver, tokenId).send());473    expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));474    expect(cost > 0n);475  });476477  itEth('transfer() call fee is less than 0.2UNQ', async ({helper}) => {478    const caller = await helper.eth.createAccountWithBalance(donor);479    const receiver = helper.eth.createAccount();480    const {collectionAddress} = await helper.eth.createRFTCollection(caller, 'Feeful-Transfer', '6', '6');481    const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', caller);482483    const result = await contract.methods.mint(caller).send();484    const tokenId = result.events.Transfer.returnValues.tokenId;485486    const cost = await helper.eth.recordCallFee(caller, () => contract.methods.transfer(receiver, tokenId).send());487    expect(cost < BigInt(0.2 * Number(helper.balance.getOneTokenNominal())));488    expect(cost > 0n);489  });490});491492describe('Common metadata', () => {493  let donor: IKeyringPair;494  let alice: IKeyringPair;495496  before(async function() {497    await usingEthPlaygrounds(async (helper, privateKey) => {498      requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);499500      donor = await privateKey({filename: __filename});501      [alice] = await helper.arrange.createAccounts([20n], donor);502    });503  });504505  itEth('Returns collection name', async ({helper}) => {506    const caller = helper.eth.createAccount();507    const tokenPropertyPermissions = [{508      key: 'URI',509      permission: {510        mutable: true,511        collectionAdmin: true,512        tokenOwner: false,513      },514    }];515    const collection = await helper.rft.mintCollection(516      alice,517      {518        name: 'Leviathan',519        tokenPrefix: '11',520        properties: [{key: 'ERC721Metadata', value: '1'}],521        tokenPropertyPermissions,522      },523    );524525    const contract = helper.ethNativeContract.collectionById(collection.collectionId, 'rft', caller);526    const name = await contract.methods.name().call();527    expect(name).to.equal('Leviathan');528  });529530  itEth('Returns symbol name', async ({helper}) => {531    const caller = await helper.eth.createAccountWithBalance(donor);532    const tokenPropertyPermissions = [{533      key: 'URI',534      permission: {535        mutable: true,536        collectionAdmin: true,537        tokenOwner: false,538      },539    }];540    const {collectionId} = await helper.rft.mintCollection(541      alice,542      {543        name: 'Leviathan',544        tokenPrefix: '12',545        properties: [{key: 'ERC721Metadata', value: '1'}],546        tokenPropertyPermissions,547      },548    );549550    const contract = helper.ethNativeContract.collectionById(collectionId, 'rft', caller);551    const symbol = await contract.methods.symbol().call();552    expect(symbol).to.equal('12');553  });554});