From 38774eb63ed6f68bec94c3baa94ff4fbc3044e23 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 07 Dec 2022 13:01:25 +0000 Subject: [PATCH] fix: types in tests --- --- a/tests/src/burnItem.test.ts +++ b/tests/src/burnItem.test.ts @@ -197,13 +197,12 @@ expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address}); // 4. Storage is not corrupted: await tokenAlice.transfer(alice, {Substrate: bob.address}); - await tokenBob.transfer(alice, {Substrate: alice.address}); + await tokenBob.transfer(bob, {Substrate: alice.address}); expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address}); expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address}); }); itSub('zero burnFrom NFT', async ({helper}) => { - const api = helper.getApi(); const collection = await helper.nft.mintCollection(alice, {name: 'Zero', description: 'Zero transfer', tokenPrefix: 'TF'}); const notApprovedNft = await collection.mintToken(alice, {Substrate: bob.address}); const approvedNft = await collection.mintToken(alice, {Substrate: bob.address}); @@ -212,7 +211,7 @@ // 1. Zero burnFrom of non-existing tokens not allowed: await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow'); // 2. Zero burnFrom of not approved tokens not allowed: - await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.NoPermission'); + await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.ApprovedValueTooLow'); // 3. Zero burnFrom of approved tokens allowed: await helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, approvedNft.tokenId, 0]); --- a/tests/src/transfer.test.ts +++ b/tests/src/transfer.test.ts @@ -206,7 +206,7 @@ expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address}); // 4. Storage is not corrupted: await tokenAlice.transfer(alice, {Substrate: bob.address}); - await tokenBob.transfer(alice, {Substrate: alice.address}); + await tokenBob.transfer(bob, {Substrate: alice.address}); expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address}); expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address}); }); --- a/tests/src/transferFrom.test.ts +++ b/tests/src/transferFrom.test.ts @@ -359,7 +359,7 @@ // 1. Cannot zero transferFrom (non-existing token) await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow'); // 2. Cannot zero transferFrom (not approved token) - await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.NoPermission'); + await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.ApprovedValueTooLow'); // 3. Can zero transferFrom (approved token): await helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, approvedNft.tokenId, 0]); -- gitstuff