difftreelog
Add destroyCollection checks
in: master
4 files changed
tests/src/eth/createFTCollection.test.tsdiffbeforeafterboth144 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);149149150 const result = await collectionHelper.methods150 const result = await collectionHelper.methods166 expect(await collectionHelper.methods166 expect(await collectionHelper.methods167 .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});171172tests/src/eth/createNFTCollection.test.tsdiffbeforeafterboth308308309 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);313313314314331 expect(await collectionHelper.methods331 expect(await collectionHelper.methods332 .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});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.tsdiffbeforeafterboth33 });33 });343435 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