From 89fdc7343ec8598022eef782319c2f42bf4c65ff Mon Sep 17 00:00:00 2001 From: Max Andreev Date: Fri, 21 Apr 2023 13:39:18 +0000 Subject: [PATCH] Use uint32 max value for collection id --- --- a/tests/src/approve.test.ts +++ b/tests/src/approve.test.ts @@ -386,6 +386,7 @@ let alice: IKeyringPair; let bob: IKeyringPair; let charlie: IKeyringPair; + const NONEXISTENT_COLLECTION = (2 ** 32) - 1; before(async () => { await usingPlaygrounds(async (helper, privateKey) => { @@ -395,20 +396,17 @@ }); itSub('[nft] Approve for a collection that does not exist', async ({helper}) => { - const collectionId = 999999; - const approveTx = (helper.nft as any)[testCase.method](bob, collectionId, 1, {Substrate: charlie.address}); + const approveTx = (helper.nft as any)[testCase.method](bob, NONEXISTENT_COLLECTION, 1, {Substrate: charlie.address}); await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound'); }); itSub('[fungible] Approve for a collection that does not exist', async ({helper}) => { - const collectionId = 999999; - const approveTx = (helper.ft as any)[testCase.method](bob, collectionId, 1, {Substrate: charlie.address}); + const approveTx = (helper.ft as any)[testCase.method](bob, NONEXISTENT_COLLECTION, 1, {Substrate: charlie.address}); await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound'); }); itSub.ifWithPallets('[refungible] Approve for a collection that does not exist', [Pallets.ReFungible], async ({helper}) => { - const collectionId = 999999; - const approveTx = (helper.rft as any)[testCase.method](bob, collectionId, 1, {Substrate: charlie.address}); + const approveTx = (helper.rft as any)[testCase.method](bob, NONEXISTENT_COLLECTION, 1, {Substrate: charlie.address}); await expect(approveTx).to.be.rejectedWith('common.CollectionNotFound'); }); -- gitstuff