git.delta.rocks / unique-network / refs/commits / 185ad3642ef5

difftreelog

Add destroyCollection checks

Max Andreev2022-12-03parent: #2849d0e.patch.diff
in: master

4 files changed

modifiedtests/src/eth/createFTCollection.test.tsdiffbeforeafterboth
144 144
145 itEth('destroyCollection', async ({helper}) => {145 itEth('destroyCollection', async ({helper}) => {
146 const owner = await helper.eth.createAccountWithBalance(donor);146 const owner = await helper.eth.createAccountWithBalance(donor);
147 const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Exister', DECIMALS, 'absolutely anything', 'WIWT');147 const {collectionAddress, collectionId} = await helper.eth.createFungibleCollection(owner, 'Exister', DECIMALS, 'absolutely anything', 'WIWT');
148 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);148 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
149149
150 const result = await collectionHelper.methods150 const result = await collectionHelper.methods
166 expect(await collectionHelper.methods166 expect(await collectionHelper.methods
167 .isCollectionExist(collectionAddress)167 .isCollectionExist(collectionAddress)
168 .call()).to.be.false;168 .call()).to.be.false;
169 expect(await helper.collection.getData(collectionId)).to.be.null;
169 });170 });
170});171});
171172
modifiedtests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth
308308
309 itEth('destroyCollection', async ({helper}) => {309 itEth('destroyCollection', async ({helper}) => {
310 const owner = await helper.eth.createAccountWithBalance(donor);310 const owner = await helper.eth.createAccountWithBalance(donor);
311 const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');311 const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
312 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);312 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
313313
314314
331 expect(await collectionHelper.methods331 expect(await collectionHelper.methods
332 .isCollectionExist(collectionAddress)332 .isCollectionExist(collectionAddress)
333 .call()).to.be.false;333 .call()).to.be.false;
334 expect(await helper.collection.getData(collectionId)).to.be.null;
334 });335 });
335});336});
modifiedtests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth
340 340
341 itEth('destroyCollection', async ({helper}) => {341 itEth('destroyCollection', async ({helper}) => {
342 const owner = await helper.eth.createAccountWithBalance(donor);342 const owner = await helper.eth.createAccountWithBalance(donor);
343 const {collectionAddress} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');343 const {collectionAddress, collectionId} = await helper.eth.createRFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
344 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);344 const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
345 345
346 await expect(collectionHelper.methods346 await expect(collectionHelper.methods
350 expect(await collectionHelper.methods350 expect(await collectionHelper.methods
351 .isCollectionExist(collectionAddress)351 .isCollectionExist(collectionAddress)
352 .call()).to.be.false; 352 .call()).to.be.false;
353 expect(await helper.collection.getData(collectionId)).to.be.null;
353 });354 });
354});355});
355356
modifiedtests/src/eth/destroyCollection.test.tsdiffbeforeafterboth
33 });33 });
3434
35 testCases.map((testCase) => 35 testCases.map((testCase) =>
36 itEth.ifWithPallets(`(!negative test!) ${testCase.method}`, testCase.requiredPallets, async ({helper}) => {36 itEth.ifWithPallets(`Cannot burn non-owned or non-existing collection ${testCase.method}`, testCase.requiredPallets, async ({helper}) => {
37 const owner = await helper.eth.createAccountWithBalance(donor);37 const owner = await helper.eth.createAccountWithBalance(donor);
38 const signer = await helper.eth.createAccountWithBalance(donor);38 const signer = await helper.eth.createAccountWithBalance(donor);
39 39