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
206 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});206 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: bob.address});
207 // 4. Storage is not corrupted:207 // 4. Storage is not corrupted:
208 await tokenAlice.transfer(alice, {Substrate: bob.address});208 await tokenAlice.transfer(alice, {Substrate: bob.address});
209 await tokenBob.transfer(alice, {Substrate: alice.address});209 await tokenBob.transfer(bob, {Substrate: alice.address});
210 expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});210 expect(await tokenAlice.getOwner()).to.deep.eq({Substrate: bob.address});
211 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});211 expect(await tokenBob.getOwner()).to.deep.eq({Substrate: alice.address});
212 });212 });
modifiedtests/src/transferFrom.test.tsdiffbeforeafterboth
359 // 1. Cannot zero transferFrom (non-existing token)359 // 1. Cannot zero transferFrom (non-existing token)
360 await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');360 await expect(helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, 9999, 0])).to.be.rejectedWith('common.ApprovedValueTooLow');
361 // 2. Cannot zero transferFrom (not approved token)361 // 2. Cannot zero transferFrom (not approved token)
362 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');362 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');
363 // 3. Can zero transferFrom (approved token):363 // 3. Can zero transferFrom (approved token):
364 await helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, approvedNft.tokenId, 0]);364 await helper.executeExtrinsic(alice, 'api.tx.unique.transferFrom', [{Substrate: bob.address}, {Substrate: alice.address}, collection.collectionId, approvedNft.tokenId, 0]);
365365