--- a/pallets/collator-selection/src/tests.rs +++ b/pallets/collator-selection/src/tests.rs @@ -73,10 +73,7 @@ // cannot set invulnerables without associated validator keys assert_noop!( - CollatorSelection::add_invulnerable( - RuntimeOrigin::signed(RootAccount::get()), - 7 - ), + CollatorSelection::add_invulnerable(RuntimeOrigin::signed(RootAccount::get()), 7), Error::::ValidatorNotRegistered ); }); @@ -108,11 +105,8 @@ // cannot remove an invulnerable if there would be 0 invulnerables. assert_noop!( - CollatorSelection::add_invulnerable( - RuntimeOrigin::signed(RootAccount::get()), - 1 - ), - Error::::NotInvulnerable + CollatorSelection::remove_invulnerable(RuntimeOrigin::signed(RootAccount::get()), 1), + Error::::TooFewInvulnerables ); }); } --- a/tests/src/collatorSelection.seqtest.ts +++ b/tests/src/collatorSelection.seqtest.ts @@ -64,6 +64,10 @@ before(async function() { await usingPlaygrounds(async (helper, privateKey) => { + // todo:collator see again if blocks start to be finalized in dev mode + // Skip the collator block production in dev mode, since the blocks are sealed automatically. + if (await helper.arrange.isDevNode()) this.skip(); + alice = await privateKey('//Alice'); bob = await privateKey('//Bob'); charlie = await privateKey('//Charlie'); @@ -141,7 +145,7 @@ after(async () => { await usingPlaygrounds(async (helper) => { - if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return; + if (await helper.arrange.isDevNode()) return; let nonce = await helper.chain.getNonce(superuser.address); await Promise.all([ @@ -161,7 +165,7 @@ // todo:collator make sure that there is enough session time for a set of tests // 28 non-functioning collators, teehee. - describe.skip('Addition and removal of invulnerables', () => { + describe('Addition and removal of invulnerables', () => { before(async function() { await resetInvulnerables(); }); @@ -261,7 +265,14 @@ expect(await helper.collatorSelection.getInvulnerables()).to.have.all.members(invulnerables); }); }); + + after(async () => { + // eslint-disable-next-line require-await + await usingPlaygrounds(async (helper) => { + if (helper.fetchMissingPalletNames([Pallets.CollatorSelection]).length != 0) return; - // todo:collator after + // todo:collator after + }); + }); }); }); \ No newline at end of file