git.delta.rocks / unique-network / refs/commits / 38774eb63ed6

difftreelog

fix types in tests

Daniel Shiposha2022-12-07parent: #ea3ed4f.patch.diff
in: master

3 files changed

modifiedtests/src/burnItem.test.tsdiffbeforeafterboth
197 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});197 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});
198 // 4. Storage is not corrupted:198 // 4. Storage is not corrupted:
199 await tokenAlice.transfer(alice, {Substrate: bob.address});199 await tokenAlice.transfer(alice, {Substrate: bob.address});
200 await tokenBob.transfer(alice, {Substrate: alice.address});200 await tokenBob.transfer(bob, {Substrate: alice.address});
201 expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});201 expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});
202 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});202 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});
203 });203 });
204204
205 itSub('zero burnFrom NFT', async ({helper}) => {205 itSub('zero burnFrom NFT', async ({helper}) => {
206 const api = helper.getApi();
207 const collection = await helper.nft.mintCollection(alice, {name: 'Zero', description: 'Zero transfer', tokenPrefix: 'TF'});206 const collection = await helper.nft.mintCollection(alice, {name: 'Zero', description: 'Zero transfer', tokenPrefix: 'TF'});
208 const notApprovedNft = await collection.mintToken(alice, {Substrate: bob.address});207 const notApprovedNft = await collection.mintToken(alice, {Substrate: bob.address});
209 const approvedNft = await collection.mintToken(alice, {Substrate: bob.address});208 const approvedNft = await collection.mintToken(alice, {Substrate: bob.address});
212 // 1. Zero burnFrom of non-existing tokens not allowed:211 // 1. Zero burnFrom of non-existing tokens not allowed:
213 await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');212 await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
214 // 2. Zero burnFrom of not approved tokens not allowed:213 // 2. Zero burnFrom of not approved tokens not allowed:
215 await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.NoPermission');214 await expect(helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, notApprovedNft.tokenId, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
216 // 3. Zero burnFrom of approved tokens allowed:215 // 3. Zero burnFrom of approved tokens allowed:
217 await helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, approvedNft.tokenId, 0]);216 await helper.executeExtrinsic(alice, 'api.tx.unique.burnFrom', [collection.collectionId, {Substrate: bob.address}, approvedNft.tokenId, 0]);
218217
modifiedtests/src/transfer.test.tsdiffbeforeafterboth
--- 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});
   });
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
--- 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]);