difftreelog
Add destroyCollection checks
in: master
4 files changed
tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createFTCollection.test.ts
+++ b/tests/src/eth/createFTCollection.test.ts
@@ -144,7 +144,7 @@
itEth('destroyCollection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createFungibleCollection(owner, 'Exister', DECIMALS, 'absolutely anything', 'WIWT');
+ const {collectionAddress, collectionId} = await helper.eth.createFungibleCollection(owner, 'Exister', DECIMALS, 'absolutely anything', 'WIWT');
const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
const result = await collectionHelper.methods
@@ -166,6 +166,7 @@
expect(await collectionHelper.methods
.isCollectionExist(collectionAddress)
.call()).to.be.false;
+ expect(await helper.collection.getData(collectionId)).to.be.null;
});
});
tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createNFTCollection.test.ts
+++ b/tests/src/eth/createNFTCollection.test.ts
@@ -308,7 +308,7 @@
itEth('destroyCollection', async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
- const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
+ const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'Limits', 'absolutely anything', 'OLF');
const collectionHelper = helper.ethNativeContract.collectionHelpers(owner);
@@ -331,5 +331,6 @@
expect(await collectionHelper.methods
.isCollectionExist(collectionAddress)
.call()).to.be.false;
+ expect(await helper.collection.getData(collectionId)).to.be.null;
});
});
\ No newline at end of file
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth340 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.methods350 expect(await collectionHelper.methods350 expect(await collectionHelper.methods351 .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});355356tests/src/eth/destroyCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/destroyCollection.test.ts
+++ b/tests/src/eth/destroyCollection.test.ts
@@ -33,7 +33,7 @@
});
testCases.map((testCase) =>
- itEth.ifWithPallets(`(!negative test!) ${testCase.method}`, testCase.requiredPallets, async ({helper}) => {
+ itEth.ifWithPallets(`Cannot burn non-owned or non-existing collection ${testCase.method}`, testCase.requiredPallets, async ({helper}) => {
const owner = await helper.eth.createAccountWithBalance(donor);
const signer = await helper.eth.createAccountWithBalance(donor);