difftreelog
added `destroyCollection`method to `CollectionHelpers`
in: master
10 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6799,7 +6799,7 @@
[[package]]
name = "pallet-unique"
-version = "0.2.0"
+version = "0.2.1"
dependencies = [
"ethereum",
"evm-coder",
pallets/unique/CHANGELOG.mddiffbeforeafterboth--- a/pallets/unique/CHANGELOG.md
+++ b/pallets/unique/CHANGELOG.md
@@ -4,33 +4,40 @@
<!-- bureaucrate goes here -->
+## [v0.2.1] 2022-10-10
+
+### Changes
+
+- Addded **CollectionHelpers** method `destroyCollection`.
+
## [v0.2.0] 2022-09-13
### Changes
-- Change **collectionHelper** method `createRefungibleCollection` to `createRFTCollection`,
+- Change **collectionHelper** method `createRefungibleCollection` to `createRFTCollection`,
+
## [v0.1.4] 2022-09-05
### Added
-- Methods `force_set_sponsor` , `force_remove_collection_sponsor` to be able to administer sponsorships with other pallets. Added to implement `AppPromotion` pallet logic.
+- Methods `force_set_sponsor` , `force_remove_collection_sponsor` to be able to administer sponsorships with other pallets. Added to implement `AppPromotion` pallet logic.
## [v0.1.3] 2022-08-16
### Other changes
-- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
+- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
-- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
+- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
-- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31
+- refactor: Remove `#[transactional]` from extrinsics 7fd36cea2f6e00c02c67ccc1de9649ae404efd31
Every extrinsic now runs in transaction implicitly, and
`#[transactional]` on pallet dispatchable is now meaningless
Upstream-Change: https://github.com/paritytech/substrate/issues/10806
-- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975
+- refactor: Switch to new prefix removal methods 26734e9567589d75cdd99e404eabf11d5a97d975
New methods allows to call `remove_prefix` with limit multiple times
in the same block
@@ -39,12 +46,12 @@
Upstream-Change: https://github.com/paritytech/substrate/pull/11490
-- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
+- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
## [v0.1.1] - 2022-07-25
### Added
-- Method for creating `ERC721Metadata` compatible NFT collection.
-- Method for creating `ERC721Metadata` compatible ReFungible collection.
-- Method for creating ReFungible collection.
+- Method for creating `ERC721Metadata` compatible NFT collection.
+- Method for creating `ERC721Metadata` compatible ReFungible collection.
+- Method for creating ReFungible collection.
pallets/unique/Cargo.tomldiffbeforeafterboth--- a/pallets/unique/Cargo.toml
+++ b/pallets/unique/Cargo.toml
@@ -9,7 +9,7 @@
license = 'GPLv3'
name = 'pallet-unique'
repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = "0.2.0"
+version = "0.2.1"
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
pallets/unique/src/eth/mod.rsdiffbeforeafterboth--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -19,7 +19,9 @@
use core::marker::PhantomData;
use ethereum as _;
use evm_coder::{execution::*, generate_stubgen, solidity_interface, solidity, weight, types::*};
-use frame_support::traits::Get;
+use frame_support::{traits::Get, storage::StorageNMap};
+
+use crate::sp_api_hidden_includes_decl_storage::hidden_include::StorageDoubleMap;
use pallet_common::{
CollectionById,
dispatch::CollectionDispatch,
@@ -37,7 +39,10 @@
CollectionMode, PropertyValue, CollectionFlags,
};
-use crate::{Config, SelfWeightOf, weights::WeightInfo};
+use crate::{
+ Config, SelfWeightOf, weights::WeightInfo, NftTransferBasket, FungibleTransferBasket,
+ ReFungibleTransferBasket, NftApproveBasket, FungibleApproveBasket, RefungibleApproveBasket,
+};
use sp_std::vec::Vec;
use alloc::format;
@@ -296,6 +301,33 @@
Ok(())
}
+ #[weight(<SelfWeightOf<T>>::destroy_collection())]
+ #[solidity(rename_selector = "destroyCollection")]
+ fn destroy_collection(&mut self, caller: caller, collection_address: address) -> Result<void> {
+ let caller = T::CrossAccountId::from_eth(caller);
+ let collection_id = pallet_common::eth::map_eth_to_id(&collection_address)
+ .ok_or("Invalid collection address format".into())
+ .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+ let collection = <pallet_common::CollectionHandle<T>>::try_get(collection_id)
+ .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+ collection
+ .check_is_internal()
+ .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+
+ T::CollectionDispatch::destroy(caller, collection)
+ .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
+
+ let _ = <NftTransferBasket<T>>::clear_prefix(collection_id, u32::MAX, None);
+ let _ = <FungibleTransferBasket<T>>::clear_prefix(collection_id, u32::MAX, None);
+ let _ = <ReFungibleTransferBasket<T>>::clear_prefix((collection_id,), u32::MAX, None);
+
+ let _ = <NftApproveBasket<T>>::clear_prefix(collection_id, u32::MAX, None);
+ let _ = <FungibleApproveBasket<T>>::clear_prefix(collection_id, u32::MAX, None);
+ let _ = <RefungibleApproveBasket<T>>::clear_prefix((collection_id,), u32::MAX, None);
+
+ Ok(())
+ }
+
/// Check if a collection exists
/// @param collectionAddress Address of the collection in question
/// @return bool Does the collection exist?
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -23,7 +23,7 @@
}
/// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0x58918631
+/// @dev the ERC-165 identifier for this interface is 0x0edfb42e
contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
/// Create an NFT collection
/// @param name Name of the collection
@@ -85,6 +85,14 @@
dummy = 0;
}
+ /// @dev EVM selector for this function is: 0x564e321f,
+ /// or in textual repr: destroyCollection(address)
+ function destroyCollection(address collectionAddress) public {
+ require(false, stub_error);
+ collectionAddress;
+ dummy = 0;
+ }
+
/// Check if a collection exists
/// @param collectionAddress Address of the collection in question
/// @return bool Does the collection exist?
tests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -18,7 +18,7 @@
}
/// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0x58918631
+/// @dev the ERC-165 identifier for this interface is 0x0edfb42e
interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
/// Create an NFT collection
/// @param name Name of the collection
@@ -54,6 +54,10 @@
/// or in textual repr: makeCollectionERC721MetadataCompatible(address,string)
function makeCollectionERC721MetadataCompatible(address collection, string memory baseUri) external;
+ /// @dev EVM selector for this function is: 0x564e321f,
+ /// or in textual repr: destroyCollection(address)
+ function destroyCollection(address collectionAddress) external;
+
/// Check if a collection exists
/// @param collectionAddress Address of the collection in question
/// @return bool Does the collection exist?
tests/src/eth/collectionHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/collectionHelpersAbi.json
+++ b/tests/src/eth/collectionHelpersAbi.json
@@ -55,6 +55,19 @@
"type": "address"
}
],
+ "name": "destroyCollection",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "collectionAddress",
+ "type": "address"
+ }
+ ],
"name": "isCollectionExist",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth1// 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.8//9// 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 {evmToAddress} from '@polkadot/util-crypto';18import {IKeyringPair} from '@polkadot/types/types';19import {Pallets, requirePalletsOrSkip} from '../util';20import {expect, itEth, usingEthPlaygrounds} from './util';212223describe('Create RFT collection from EVM', () => {24 let donor: IKeyringPair;2526 before(async function() {27 await usingEthPlaygrounds(async (helper, privateKey) => {28 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);29 donor = await privateKey({filename: __filename});30 });31 });3233 itEth('Create collection', async ({helper}) => {34 const owner = await helper.eth.createAccountWithBalance(donor);35 36 const name = 'CollectionEVM';37 const description = 'Some description';38 const prefix = 'token prefix';39 40 const {collectionId} = await helper.eth.createRFTCollection(owner, name, description, prefix);41 const data = (await helper.rft.getData(collectionId))!;42 const collection = helper.rft.getCollectionObject(collectionId);4344 expect(data.name).to.be.eq(name);45 expect(data.description).to.be.eq(description);46 expect(data.raw.tokenPrefix).to.be.eq(prefix);47 expect(data.raw.mode).to.be.eq('ReFungible');4849 const options = await collection.getOptions();5051 expect(options.tokenPropertyPermissions).to.be.empty;52 });5354 5556 itEth('Create collection with properties', async ({helper}) => {57 const owner = await helper.eth.createAccountWithBalance(donor);5859 const name = 'CollectionEVM';60 const description = 'Some description';61 const prefix = 'token prefix';62 const baseUri = 'BaseURI';6364 const {collectionId} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, name, description, prefix, baseUri);6566 const collection = helper.rft.getCollectionObject(collectionId);67 const data = (await collection.getData())!;68 69 expect(data.name).to.be.eq(name);70 expect(data.description).to.be.eq(description);71 expect(data.raw.tokenPrefix).to.be.eq(prefix);72 expect(data.raw.mode).to.be.eq('ReFungible');7374 const options = await collection.getOptions();75 expect(options.tokenPropertyPermissions).to.be.deep.equal([76 {77 key: 'URI',78 permission: {mutable: true, collectionAdmin: true, tokenOwner: false},79 },80 {81 key: 'URISuffix',82 permission: {mutable: true, collectionAdmin: true, tokenOwner: false},83 },84 ]);85 });86 87 // this test will occasionally fail when in async environment.88 itEth.skip('Check collection address exist', async ({helper}) => {89 const owner = await helper.eth.createAccountWithBalance(donor);9091 const expectedCollectionId = +(await helper.callRpc('api.rpc.unique.collectionStats')).created + 1;92 const expectedCollectionAddress = helper.ethAddress.fromCollectionId(expectedCollectionId);93 const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner);9495 expect(await collectionHelpers.methods96 .isCollectionExist(expectedCollectionAddress)97 .call()).to.be.false;9899 await collectionHelpers.methods100 .createRFTCollection('A', 'A', 'A')101 .send({value: Number(2n * helper.balance.getOneTokenNominal())});102 103 expect(await collectionHelpers.methods104 .isCollectionExist(expectedCollectionAddress)105 .call()).to.be.true;106 });107 108 itEth('Set sponsorship', async ({helper}) => {109 const owner = await helper.eth.createAccountWithBalance(donor);110 const sponsor = await helper.eth.createAccountWithBalance(donor);111 const ss58Format = helper.chain.getChainProperties().ss58Format;112 const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Sponsor', 'absolutely anything', 'ENVY');113114 const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);115 await collection.methods.setCollectionSponsor(sponsor).send();116117 let data = (await helper.rft.getData(collectionId))!;118 expect(data.raw.sponsorship.Unconfirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));119120 await expect(collection.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor');121122 const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);123 await sponsorCollection.methods.confirmCollectionSponsorship().send();124125 data = (await helper.rft.getData(collectionId))!;126 expect(data.raw.sponsorship.Confirmed).to.be.equal(evmToAddress(sponsor, Number(ss58Format)));127 });128129 itEth('Set limits', async ({helper}) => {130 const owner = await helper.eth.createAccountWithBalance(donor);131 const {collectionId, collectionAddress} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'INSI');132 const limits = {133 accountTokenOwnershipLimit: 1000,134 sponsoredDataSize: 1024,135 sponsoredDataRateLimit: 30,136 tokenLimit: 1000000,137 sponsorTransferTimeout: 6,138 sponsorApproveTimeout: 6,139 ownerCanTransfer: false,140 ownerCanDestroy: false,141 transfersEnabled: false,142 };143144 const collection = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);145 await collection.methods['setCollectionLimit(string,uint32)']('accountTokenOwnershipLimit', limits.accountTokenOwnershipLimit).send();146 await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataSize', limits.sponsoredDataSize).send();147 await collection.methods['setCollectionLimit(string,uint32)']('sponsoredDataRateLimit', limits.sponsoredDataRateLimit).send();148 await collection.methods['setCollectionLimit(string,uint32)']('tokenLimit', limits.tokenLimit).send();149 await collection.methods['setCollectionLimit(string,uint32)']('sponsorTransferTimeout', limits.sponsorTransferTimeout).send();150 await collection.methods['setCollectionLimit(string,uint32)']('sponsorApproveTimeout', limits.sponsorApproveTimeout).send();151 await collection.methods['setCollectionLimit(string,bool)']('ownerCanTransfer', limits.ownerCanTransfer).send();152 await collection.methods['setCollectionLimit(string,bool)']('ownerCanDestroy', limits.ownerCanDestroy).send();153 await collection.methods['setCollectionLimit(string,bool)']('transfersEnabled', limits.transfersEnabled).send();154 155 const data = (await helper.rft.getData(collectionId))!;156 expect(data.raw.limits.accountTokenOwnershipLimit).to.be.eq(limits.accountTokenOwnershipLimit);157 expect(data.raw.limits.sponsoredDataSize).to.be.eq(limits.sponsoredDataSize);158 expect(data.raw.limits.sponsoredDataRateLimit.blocks).to.be.eq(limits.sponsoredDataRateLimit);159 expect(data.raw.limits.tokenLimit).to.be.eq(limits.tokenLimit);160 expect(data.raw.limits.sponsorTransferTimeout).to.be.eq(limits.sponsorTransferTimeout);161 expect(data.raw.limits.sponsorApproveTimeout).to.be.eq(limits.sponsorApproveTimeout);162 expect(data.raw.limits.ownerCanTransfer).to.be.eq(limits.ownerCanTransfer);163 expect(data.raw.limits.ownerCanDestroy).to.be.eq(limits.ownerCanDestroy);164 expect(data.raw.limits.transfersEnabled).to.be.eq(limits.transfersEnabled);165 });166167 itEth('Collection address exist', async ({helper}) => {168 const owner = await helper.eth.createAccountWithBalance(donor);169 const collectionAddressForNonexistentCollection = '0x17C4E6453CC49AAAAEACA894E6D9683E00112233';170 expect(await helper.ethNativeContract.collectionHelpers(collectionAddressForNonexistentCollection)171 .methods.isCollectionExist(collectionAddressForNonexistentCollection).call())172 .to.be.false;173 174 const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Exister', 'absolutely anything', 'WIWT');175 expect(await helper.ethNativeContract.collectionHelpers(collectionAddress)176 .methods.isCollectionExist(collectionAddress).call())177 .to.be.true;178 });179});180181describe('(!negative tests!) Create RFT collection from EVM', () => {182 let donor: IKeyringPair;183 let nominal: bigint;184185 before(async function() {186 await usingEthPlaygrounds(async (helper, privateKey) => {187 requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);188 donor = await privateKey({filename: __filename});189 nominal = helper.balance.getOneTokenNominal();190 });191 });192193 itEth('(!negative test!) Create collection (bad lengths)', async ({helper}) => {194 const owner = await helper.eth.createAccountWithBalance(donor);195 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);196 {197 const MAX_NAME_LENGTH = 64;198 const collectionName = 'A'.repeat(MAX_NAME_LENGTH + 1);199 const description = 'A';200 const tokenPrefix = 'A';201202 await expect(collectionHelper.methods203 .createRFTCollection(collectionName, description, tokenPrefix)204 .call({value: Number(2n * nominal)})).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGTH);205 }206 {207 const MAX_DESCRIPTION_LENGTH = 256;208 const collectionName = 'A';209 const description = 'A'.repeat(MAX_DESCRIPTION_LENGTH + 1);210 const tokenPrefix = 'A';211 await expect(collectionHelper.methods212 .createRFTCollection(collectionName, description, tokenPrefix)213 .call({value: Number(2n * nominal)})).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGTH);214 }215 {216 const MAX_TOKEN_PREFIX_LENGTH = 16;217 const collectionName = 'A';218 const description = 'A';219 const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGTH + 1);220 await expect(collectionHelper.methods221 .createRFTCollection(collectionName, description, tokenPrefix)222 .call({value: Number(2n * nominal)})).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGTH);223 }224 });225 226 itEth('(!negative test!) Create collection (no funds)', async ({helper}) => {227 const owner = await helper.eth.createAccountWithBalance(donor);228 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);229 await expect(collectionHelper.methods230 .createRFTCollection('Peasantry', 'absolutely anything', 'TWIW')231 .call({value: Number(1n * nominal)})).to.be.rejectedWith('Sent amount not equals to collection creation price (2000000000000000000)');232 });233234 itEth('(!negative test!) Check owner', async ({helper}) => {235 const owner = await helper.eth.createAccountWithBalance(donor);236 const peasant = helper.eth.createAccount();237 const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Transgressed', 'absolutely anything', 'YVNE');238 const peasantCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', peasant);239 const EXPECTED_ERROR = 'NoPermission';240 {241 const sponsor = await helper.eth.createAccountWithBalance(donor);242 await expect(peasantCollection.methods243 .setCollectionSponsor(sponsor)244 .call()).to.be.rejectedWith(EXPECTED_ERROR);245 246 const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'rft', sponsor);247 await expect(sponsorCollection.methods248 .confirmCollectionSponsorship()249 .call()).to.be.rejectedWith('caller is not set as sponsor');250 }251 {252 await expect(peasantCollection.methods253 .setCollectionLimit('account_token_ownership_limit', '1000')254 .call()).to.be.rejectedWith(EXPECTED_ERROR);255 }256 });257258 itEth('(!negative test!) Set limits', async ({helper}) => {259 const owner = await helper.eth.createAccountWithBalance(donor);260 const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'ISNI');261 const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);262 await expect(collectionEvm.methods263 .setCollectionLimit('badLimit', 'true')264 .call()).to.be.rejectedWith('unknown boolean limit "badLimit"');265 });266});tests/src/eth/destroyCollection.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/eth/destroyCollection.test.ts
@@ -0,0 +1,76 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {IKeyringPair} from '@polkadot/types/types';
+import {Pallets, requirePalletsOrSkip} from '../util';
+import {expect, itEth, usingEthPlaygrounds} from './util';
+
+
+describe('Destroy Collection from EVM', () => {
+ let donor: IKeyringPair;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (helper, privateKey) => {
+ requirePalletsOrSkip(this, helper, [Pallets.ReFungible, Pallets.NFT]);
+ donor = await privateKey('//Alice');
+ });
+ });
+
+
+ itEth('(!negative test!) RFT', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const signer = await helper.eth.createAccountWithBalance(donor);
+
+ const unexistedCollection = helper.ethAddress.fromCollectionId(1000000);
+
+ const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
+ const collectionHelper = helper.ethNativeContract.collectionHelpers(signer);
+
+ await expect(collectionHelper.methods
+ .destroyCollection(collectionAddress)
+ .send({from: signer})).to.be.rejected;
+
+ await expect(collectionHelper.methods
+ .destroyCollection(unexistedCollection)
+ .send({from: signer})).to.be.rejected;
+
+ expect(await collectionHelper.methods
+ .isCollectionExist(unexistedCollection)
+ .call()).to.be.false;
+ });
+
+ itEth('(!negative test!) NFT', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const signer = await helper.eth.createAccountWithBalance(donor);
+
+ const unexistedCollection = helper.ethAddress.fromCollectionId(1000000);
+
+ const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
+ const collectionHelper = helper.ethNativeContract.collectionHelpers(signer);
+
+ await expect(collectionHelper.methods
+ .destroyCollection(collectionAddress)
+ .send({from: signer})).to.be.rejected;
+
+ await expect(collectionHelper.methods
+ .destroyCollection(unexistedCollection)
+ .send({from: signer})).to.be.rejected;
+
+ expect(await collectionHelper.methods
+ .isCollectionExist(unexistedCollection)
+ .call()).to.be.false;
+ });
+});