From 8ca43b552b31dbd82166ed2235b3ff31223e3096 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Tue, 20 Sep 2022 10:30:24 +0000 Subject: [PATCH] fix(scheduler): minimize wait time in test, comment sponsorship, remove unused imports --- --- a/tests/src/.outdated/scheduler.test.ts +++ b/tests/src/.outdated/scheduler.test.ts @@ -20,23 +20,8 @@ submitTransactionExpectFailAsync, } from '../substrate/substrate-api'; import { - createItemExpectSuccess, - createCollectionExpectSuccess, - scheduleTransferExpectSuccess, - setCollectionSponsorExpectSuccess, - confirmSponsorshipExpectSuccess, - findUnusedAddress, UNIQUE, - enablePublicMintingExpectSuccess, - addToAllowListExpectSuccess, waitNewBlocks, - normalizeAccountId, - getTokenOwner, - getGenericResult, - getFreeBalance, - confirmSponsorshipByKeyExpectSuccess, - scheduleExpectFailure, - scheduleAfter, } from './util/helpers'; import {expect, itSub, Pallets, usingPlaygrounds} from './util/playgrounds'; import {IKeyringPair} from '@polkadot/types/types'; @@ -191,7 +176,7 @@ itSub.ifWithPallets('Scheduled tasks should take correct fees', [Pallets.Scheduler, Pallets.TestUtils], async function({helper}) { const scheduledId = await helper.arrange.makeScheduledId(); - const waitForBlocks = 8; + const waitForBlocks = 4; const periodic = { period: 2, repetitions: 2, @@ -304,7 +289,7 @@ itSub.ifWithPallets('A scheduled operation can cancel itself', [Pallets.Scheduler, Pallets.TestUtils], async ({helper}) => { const scheduledId = await helper.arrange.makeScheduledId(); - const waitForBlocks = 8; + const waitForBlocks = 4; const periodic = { period: 2, repetitions: 5, @@ -391,7 +376,7 @@ const token = await collection.mintToken(bob); const scheduledId = await helper.arrange.makeScheduledId(); - const waitForBlocks = 4; + const waitForBlocks = 6; await token.scheduleAfter(scheduledId, waitForBlocks) .transfer(bob, {Substrate: alice.address}); @@ -423,7 +408,7 @@ const prioLow = 255; const periodic = { - period: 8, + period: 6, repetitions: 2, }; @@ -508,7 +493,7 @@ const token = await collection.mintToken(alice); const scheduledId = await helper.arrange.makeScheduledId(); - const waitForBlocks = 8; + const waitForBlocks = 4; await token.scheduleAfter(scheduledId, waitForBlocks) .transfer(alice, {Substrate: bob.address}); @@ -567,15 +552,15 @@ // Implementation of the functionality tested here was postponed/shelved describe.skip('Sponsoring scheduling', () => { - let alice: IKeyringPair; - let bob: IKeyringPair; + // let alice: IKeyringPair; + // let bob: IKeyringPair; - before(async() => { - await usingApi(async (_, privateKeyWrapper) => { - alice = privateKeyWrapper('//Alice'); - bob = privateKeyWrapper('//Bob'); - }); - }); + // before(async() => { + // await usingApi(async (_, privateKeyWrapper) => { + // alice = privateKeyWrapper('//Alice'); + // bob = privateKeyWrapper('//Bob'); + // }); + // }); it('Can sponsor scheduling a transaction', async () => { // const collectionId = await createCollectionExpectSuccess(); -- gitstuff