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

difftreelog

source

tests/src/eth/collectionHelperAddress.test.ts2.5 KiBsourcehistory
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 {itEth, usingEthPlaygrounds, expect} from './util';18import {IKeyringPair} from '@polkadot/types/types';1920const EVM_COLLECTION_HELPERS_ADDRESS = '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f';2122describe('[eth]CollectionHelerpAddress test: ERC721 ', () => {23  let donor: IKeyringPair;2425  before(async function() {26    await usingEthPlaygrounds(async (helper, privateKey) => {27      donor = await privateKey({filename: __filename});28    });29  });3031  itEth('NFT\\RFT', async ({helper}) => {32    const owner =  await helper.eth.createAccountWithBalance(donor);33    34    const {collectionAddress: nftCollectionAddress} = await helper.eth.createNFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');35    const nftCollection = helper.ethNativeContract.collection(nftCollectionAddress, 'nft', owner);36    37    const {collectionAddress: rftCollectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ROC');38    const rftCollection = helper.ethNativeContract.collection(rftCollectionAddress, 'rft', owner);39    40    expect((await nftCollection.methods.collectionHelperAddress().call())41      .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);42    43    expect((await rftCollection.methods.collectionHelperAddress().call())44      .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);45  });46  47  itEth('FT', async ({helper}) => {48    const owner = await helper.eth.createAccountWithBalance(donor);4950    const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Sponsor', 18, 'absolutely anything', 'ROC');51    const collection = helper.ethNativeContract.collection(collectionAddress, 'ft', owner);52    53    expect((await collection.methods.collectionHelperAddress().call())54      .toString().toLowerCase()).to.be.equal(EVM_COLLECTION_HELPERS_ADDRESS);55  });56 57});