difftreelog
chore add `collectionCreationFee` method to CollectionHelpers
in: master
6 files changed
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth23}23}242425/// @title Contract, which allows users to operate with collections25/// @title Contract, which allows users to operate with collections26/// @dev the ERC-165 identifier for this interface is 0x88ee8ef126/// @dev the ERC-165 identifier for this interface is 0x5ad4f44027contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {27contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {28 /// Create an NFT collection28 /// Create an NFT collection29 /// @param name Name of the collection29 /// @param name Name of the collection106 return false;106 return false;107 }107 }108109 /// @dev EVM selector for this function is: 0xd23a7ab1,110 /// or in textual repr: collectionCreationFee()111 function collectionCreationFee() public view returns (uint256) {112 require(false, stub_error);113 dummy;114 return 0;115 }108}116}109117tests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth18}18}191920/// @title Contract, which allows users to operate with collections20/// @title Contract, which allows users to operate with collections21/// @dev the ERC-165 identifier for this interface is 0x88ee8ef121/// @dev the ERC-165 identifier for this interface is 0x5ad4f44022interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {22interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {23 /// Create an NFT collection23 /// Create an NFT collection24 /// @param name Name of the collection24 /// @param name Name of the collection66 /// or in textual repr: isCollectionExist(address)66 /// or in textual repr: isCollectionExist(address)67 function isCollectionExist(address collectionAddress) external view returns (bool);67 function isCollectionExist(address collectionAddress) external view returns (bool);6869 /// @dev EVM selector for this function is: 0xd23a7ab1,70 /// or in textual repr: collectionCreationFee()71 function collectionCreationFee() external view returns (uint256);68}72}6973tests/src/eth/collectionHelpersAbi.jsondiffbeforeafterboth18 "name": "CollectionCreated",18 "name": "CollectionCreated",19 "type": "event"19 "type": "event"20 },20 },21 {22 "inputs": [],23 "name": "collectionCreationFee",24 "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],25 "stateMutability": "view",26 "type": "function"27 },21 {28 {22 "inputs": [29 "inputs": [23 { "internalType": "string", "name": "name", "type": "string" },30 { "internalType": "string", "name": "name", "type": "string" },tests/src/eth/payable.test.tsdiffbeforeafterboth171 expect(finalContractBalance == initialContractBalance).to.be.true;171 expect(finalContractBalance == initialContractBalance).to.be.true;172 });172 });173174 itEth('Get collection creation fee', async({helper}) => {175 const deployer = await helper.eth.createAccountWithBalance(donor);176 expect(await helper.eth.getCollectionCreationFee(deployer)).to.be.equal(String(2n * helper.balance.getOneTokenNominal()));177 });173178174 async function deployProxyContract(helper: EthUniqueHelper, deployer: string) {179 async function deployProxyContract(helper: EthUniqueHelper, deployer: string) {175 return await helper.ethContract.deployByCode(180 return await helper.ethContract.deployByCode(tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth153 return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n));153 return await this.helper.balance.transferToSubstrate(donor, evmToAddress(recepient), amount * (inTokens ? this.helper.balance.getOneTokenNominal() : 1n));154 }154 }155 156 async getCollectionCreationFee(signer: string) {157 const collectionHelper = this.helper.ethNativeContract.collectionHelpers(signer);158 return await collectionHelper.methods.collectionCreationFee().call();159 }155160156 async sendEVM(signer: IKeyringPair, contractAddress: string, abi: string, value: string, gasLimit?: number) {161 async sendEVM(signer: IKeyringPair, contractAddress: string, abi: string, value: string, gasLimit?: number) {157 if(!gasLimit) gasLimit = this.DEFAULT_GAS;162 if(!gasLimit) gasLimit = this.DEFAULT_GAS;