difftreelog
chore fix code review request
in: master
1 file changed
tests/src/approve.test.tsdiffbeforeafterboth618 itSub('[nft] Enable and disable approval', async ({helper}) => {618 itSub('[nft] Enable and disable approval', async ({helper}) => {619 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});619 const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});620 await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});620 await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});621 const checkBeforeApprovalTx = () => helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});621 const checkBeforeApproval = await helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});622 expect(await checkBeforeApprovalTx()).to.be.false;622 expect(checkBeforeApproval).to.be.false;623 await helper.nft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, true);623 await helper.nft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, true);624 const checkAfterApprovalTx = () => helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});624 const checkAfterApproval = await helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});625 expect(await checkAfterApprovalTx()).to.be.true;625 expect(checkAfterApproval).to.be.true;626 await helper.nft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, false);626 await helper.nft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, false);627 const checkAfterDisapprovalTx = () => helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});627 const checkAfterDisapproval = await helper.nft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});628 expect(await checkAfterDisapprovalTx()).to.be.false;628 expect(checkAfterDisapproval).to.be.false;629 });629 });630630631 itSub.ifWithPallets('[rft] Enable and disable approval', [Pallets.ReFungible], async ({helper}) => {631 itSub.ifWithPallets('[rft] Enable and disable approval', [Pallets.ReFungible], async ({helper}) => {632 const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});632 const {collectionId} = await helper.rft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});633 const checkBeforeApprovalTx = () => helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});633 const checkBeforeApproval = await helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});634 expect(await checkBeforeApprovalTx()).to.be.false;634 expect(checkBeforeApproval).to.be.false;635 await helper.rft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, true);635 await helper.rft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, true);636 const checkAfterApprovalTx = () => helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});636 const checkAfterApproval = await helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});637 expect(await checkAfterApprovalTx()).to.be.true;637 expect(checkAfterApproval).to.be.true;638 await helper.rft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, false);638 await helper.rft.setApprovalForAll(alice, collectionId, {Substrate: bob.address}, false);639 const checkAfterDisapprovalTx = () => helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});639 const checkAfterDisapproval = await helper.rft.isApprovedForAll(collectionId, {Substrate: alice.address}, {Substrate: bob.address});640 expect(await checkAfterDisapprovalTx()).to.be.false;640 expect(checkAfterDisapproval).to.be.false;641 });641 });642});642});643643