git.delta.rocks / unique-network / refs/commits / 89fdc7343ec8

difftreelog

Use uint32 max value for collection id

Max Andreev2023-04-21parent: #3aa00d4.patch.diff
in: master

1 file changed

modifiedtests/src/approve.test.tsdiffbeforeafterboth
386 let alice: IKeyringPair;386 let alice: IKeyringPair;
387 let bob: IKeyringPair;387 let bob: IKeyringPair;
388 let charlie: IKeyringPair;388 let charlie: IKeyringPair;
389 const NONEXISTENT_COLLECTION = (2 ** 32) - 1;
389390
390 before(async () => {391 before(async () => {
391 await usingPlaygrounds(async (helper, privateKey) => {392 await usingPlaygrounds(async (helper, privateKey) => {
395 });396 });
396397
397 itSub('[nft] Approve for a collection that does not exist', async ({helper}) => {398 itSub('[nft] Approve for a collection that does not exist', async ({helper}) => {
398 const collectionId = 999999;
399 const approveTx = (helper.nft as any)[testCase.method](bob, collectionId, 1, {Substrate: charlie.address});399 const approveTx = (helper.nft as any)[testCase.method](bob, NONEXISTENT_COLLECTION, 1, {Substrate: charlie.address});
400 await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound');400 await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound');
401 });401 });
402402
403 itSub('[fungible] Approve for a collection that does not exist', async ({helper}) => {403 itSub('[fungible] Approve for a collection that does not exist', async ({helper}) => {
404 const collectionId = 999999;
405 const approveTx = (helper.ft as any)[testCase.method](bob, collectionId, 1, {Substrate: charlie.address});404 const approveTx = (helper.ft as any)[testCase.method](bob, NONEXISTENT_COLLECTION, 1, {Substrate: charlie.address});
406 await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound');405 await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound');
407 });406 });
408407
409 itSub.ifWithPallets('[refungible] Approve for a collection that does not exist', [Pallets.ReFungible], async ({helper}) => {408 itSub.ifWithPallets('[refungible] Approve for a collection that does not exist', [Pallets.ReFungible], async ({helper}) => {
410 const collectionId = 999999;
411 const approveTx = (helper.rft as any)[testCase.method](bob, collectionId, 1, {Substrate: charlie.address});409 const approveTx = (helper.rft as any)[testCase.method](bob, NONEXISTENT_COLLECTION, 1, {Substrate: charlie.address});
412 await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound');410 await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound');
413 });411 });
414412